/* checkout.css
   Scoped overrides for the Russian dark-amber router store checkout.
   Only touches .checkout-* and .purchase-actions .direct-buy.
   No animations / transitions are used. No JS, auth or payments logic. */

/* ---------- Backdrop ---------- */
.checkout-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(12px, 3vmin, 32px);
  background: rgba(8, 10, 14, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.checkout-backdrop *,
.checkout-backdrop *::before,
.checkout-backdrop *::after {
  box-sizing: border-box;
}

/* ---------- Modal shell ---------- */
.checkout-modal {
  position: relative;
  width: 100%;
  max-width: 680px;
  min-width: 0;
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 32px;
  background: #121720;
  color: #eef1f6;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

/* Wrap long words / flex children safely. */
.checkout-modal *,
.checkout-modal *::before,
.checkout-modal *::after {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Heading ---------- */
.checkout-modal h2 {
  margin: 0 0 20px;
  padding-right: 56px; /* reserve space so the close button never overlaps */
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  font-weight: 700;
  color: #f7d9a6;
}

/* ---------- Close button ---------- */
.checkout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #eef1f6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.checkout-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Form ---------- */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.4;
  color: #c7cedb;
}

.checkout-form input,
.checkout-form textarea,
.checkout-form select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.4;
  color: #eef1f6;
  background: #0d1119;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}

.checkout-form input::placeholder,
.checkout-form textarea::placeholder {
  color: #8b93a3;
}

.checkout-form textarea {
  min-height: 96px;
  resize: vertical;
}

/* ---------- Layout grid ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

/* ---------- Product preview ---------- */
.checkout-product {
  display: flex;
  align-items: center;
  gap: 16px;
}

.checkout-product img {
  flex: 0 0 auto;
  max-width: 120px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: #0d1119;
}

/* ---------- Legal / checkbox rows ---------- */
.checkout-legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-legal label,
.checkout-legal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #c7cedb;
}

.checkout-legal input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 2px 0 0;
  accent-color: #f0a93b;
}

/* ---------- Submit ---------- */
.checkout-submit {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1206;
  background: linear-gradient(180deg, #ffc65c, #f0a93b);
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

.checkout-submit:hover {
  background: linear-gradient(180deg, #ffd27a, #f0a93b);
}

/* ---------- Purchase actions ---------- */
.purchase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.purchase-actions .direct-buy {
  flex: 1 1 100%;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1206;
  background: linear-gradient(180deg, #ffc65c, #f0a93b);
  border: none;
  border-radius: 14px;
  cursor: pointer;
}

.purchase-actions .direct-buy:hover {
  background: linear-gradient(180deg, #ffd27a, #f0a93b);
}

/* ---------- Keyboard focus ---------- */
.checkout-modal button:focus-visible,
.checkout-modal a:focus-visible,
.checkout-modal input:focus-visible,
.checkout-modal textarea:focus-visible,
.checkout-modal select:focus-visible,
.purchase-actions .direct-buy:focus-visible {
  outline: 3px solid #ffd27a;
  outline-offset: 2px;
}

/* ---------- Notes / warnings ---------- */
.checkout-note,
.pickup-warning {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #c7cedb;
}

.pickup-warning {
  padding: 12px 14px;
  color: #f7d9a6;
  background: rgba(240, 169, 59, 0.12);
  border: 1px solid rgba(240, 169, 59, 0.3);
  border-radius: 12px;
}

/* ---------- Responsive: single column + tighter shell ---------- */
@media (max-width: 600px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-backdrop {
    padding: 8px;
  }

  .checkout-modal {
    padding: 20px 16px;
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .checkout-modal h2 {
    padding-right: 48px;
  }
}

/* ---------- Very narrow (320px) safety ---------- */
@media (max-width: 360px) {
  .checkout-backdrop {
    padding: 6px;
  }

  .checkout-modal {
    padding: 16px 12px;
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
  }

  .checkout-product {
    flex-direction: column;
    align-items: flex-start;
  }

  .checkout-product img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
  }
}
/* Preserve readable checkout typography over legacy responsive rules. */
.checkout-backdrop .checkout-modal .checkout-form label{font-size:15px!important;color:#c7cedb!important;line-height:1.5!important}
.checkout-backdrop .checkout-modal .checkout-form input,.checkout-backdrop .checkout-modal .checkout-form textarea{font-size:16px!important;color:#eef1f6!important;min-height:46px}
.checkout-backdrop .checkout-modal .checkout-product b{font-size:24px!important;color:#ffca61!important;display:block}
.checkout-backdrop .checkout-modal .checkout-product small,.checkout-backdrop .checkout-modal .checkout-product span,.checkout-backdrop .checkout-modal label>span{font-size:13px!important;color:#b9c2d1!important}
.checkout-backdrop .checkout-modal .checkout-legal input[type=checkbox]{min-height:20px;width:20px;height:20px;flex:0 0 20px;padding:0}
.checkout-backdrop .checkout-modal .checkout-close{color:#eef1f6!important;background:#232c38!important}

.checkout-form .checkout-fields{display:flex;flex-direction:column;gap:16px;min-width:0;margin:0;padding:0;border:0}.checkout-close:disabled{opacity:.45;cursor:wait}.checkout-modal .order-confirmation h2{padding-right:0}
