/* ── CHECKOUT PAGE ── */
.checkout-page {
  min-height: 100vh;
  background: #ffffff;
  padding: 20px 0;
}

.checkout-header {
  padding: 20px 0;
  border-bottom: 1px solid #e0dbd0;
  margin-bottom: 2rem;
}

.checkout-header h1 {
  text-align: center;
  font: 600 2rem/1 var(--font-display);
  color: #181818;
  margin: 0;
}

.back-link {
  background: none;
  border: none;
  color: #b48645;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.checkout-empty {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.checkout-empty-content {
  text-align: center;
}

.checkout-empty-content h2 {
  font: 600 1.8rem/1 var(--font-display);
  color: #181818;
  margin: 0 0 0.5rem;
}

.checkout-empty-content p {
  color: #666;
  margin: 0 0 1.5rem;
}

/* ── CHECKOUT CONTAINER ── */
.checkout-container {
  width: min(1400px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
}

.checkout-main {
  display: grid;
  gap: 2.5rem;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f9f7f4;
  border-radius: 12px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.progress-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.progress-step.active .progress-circle {
  background: #b48645;
  color: #fff;
}

.progress-step span {
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
  text-align: center;
}

.progress-step.active span {
  color: #b48645;
  font-weight: 600;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: #e8e8e8;
  margin: 0 1rem;
  margin-top: 20px;
}

.progress-step:last-child .progress-line {
  display: none;
}

/* ── CHECKOUT SECTION ── */
.checkout-section {
  background: #ffffff;
  padding: 2rem;
  border: 1px solid #e0dbd0;
  border-radius: 12px;
}

.checkout-section h2 {
  font: 600 1.5rem/1 var(--font-display);
  color: #181818;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0eeea;
}

.checkout-mode-note {
  margin: -0.5rem 0 1.5rem;
  padding: 14px 16px;
  border: 1px solid #eadfcd;
  background: #fffaf3;
  color: #6b5d4c;
  font: 600 0.9rem/1.55 var(--font-sans);
}

.checkout-address-book {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #eadfcd;
  border-radius: 10px;
  background: #fffdf8;
}

.checkout-address-book-head,
.checkout-address-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.checkout-address-book-head strong {
  display: block;
  color: #181818;
  font: 700 0.95rem/1.2 var(--font-sans);
}

.checkout-address-book-head p,
.checkout-address-option small,
.checkout-address-validation {
  margin: 0.35rem 0 0;
  color: #6b5d4c;
  font: 500 0.84rem/1.5 var(--font-sans);
}

.checkout-address-options {
  display: grid;
  gap: 0.75rem;
}

.checkout-address-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid #e4dacb;
  border-radius: 8px;
  background: #fbf7ef;
  cursor: pointer;
}

.checkout-address-option input,
.checkout-save-address input {
  accent-color: #b48645;
}

.checkout-address-option strong,
.checkout-address-option small {
  display: block;
}

.checkout-address-option strong {
  color: #29231d;
  font: 700 0.9rem/1.2 var(--font-sans);
}

.checkout-small-btn {
  border: 1px solid rgba(180, 134, 69, 0.35);
  border-radius: 999px;
  background: #fffaf3;
  color: #6a451e;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font: 700 0.78rem/1 var(--font-sans);
  white-space: nowrap;
}

.checkout-small-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.checkout-text-btn {
  border: 0;
  background: none;
  color: #8a5a1f;
  cursor: pointer;
  font: 700 0.78rem/1 var(--font-sans);
  padding: 0;
}

.checkout-address-tools {
  flex-wrap: wrap;
  padding-top: 0.4rem;
}

.checkout-save-address {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #333;
  font: 600 0.9rem/1.4 var(--font-sans);
}

.checkout-address-validation {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: #fffaf3;
}

/* ── FORM STYLES ── */
.checkout-form {
  display: grid;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: grid;
  gap: 0.5rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font: 500 0.9rem/1 var(--font-sans);
  color: #333;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select {
  padding: 0.85rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: #333;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #b48645;
  background: #fffaf3;
}

.checkout-phone-control,
.checkout-phone-control .iti {
  width: 100%;
}

.checkout-phone-control .iti__tel-input {
  width: 100%;
}

.checkout-phone-control .iti__selected-dial-code {
  color: #333;
  font: 700 0.92rem/1 var(--font-sans);
}

.checkout-phone-control .iti__country-container {
  border-right: 1px solid #e6ddcf;
}

.form-group input.error,
.form-group select.error {
  border-color: #c0392b;
  background: #fff5f5;
}

.error-msg {
  font-size: 0.8rem;
  color: #c0392b;
  font-weight: 500;
}

/* ── PAYMENT METHODS ── */
.payment-methods {
  display: grid;
  gap: 1rem;
}

.saved-card-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eadfcd;
  border-radius: 10px;
  background: #fffdf8;
}

.saved-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.saved-card-head strong {
  display: block;
  color: #181818;
  font: 700 0.95rem/1.2 var(--font-sans);
}

.saved-card-head p,
.saved-card-empty {
  margin: 0.35rem 0 0;
  color: #6b5d4c;
  font: 500 0.84rem/1.5 var(--font-sans);
}

.saved-card-list {
  display: grid;
  gap: 0.7rem;
}

.saved-card-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.85rem 1rem;
  border: 1.5px solid #e0dbd0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.saved-card-option:has([name="savedPaymentMethodId"]:checked) {
  border-color: #b48645;
  background: #fffaf3;
}

.saved-card-option input[type="radio"] {
  accent-color: #b48645;
}

.saved-card-method-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.saved-card-option strong,
.saved-card-option small {
  display: block;
}

.saved-card-option strong {
  color: #29231d;
  font: 700 0.92rem/1.25 var(--font-sans);
}

.saved-card-option small {
  margin-top: 0.2rem;
  color: #6b5d4c;
  font: 500 0.82rem/1.4 var(--font-sans);
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  border: 2px solid #e0dbd0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-option input[type="radio"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-option input[type="radio"]:checked {
  border-color: #b48645;
  background: #b48645;
  box-shadow: inset 0 0 0 4px #fff;
}

.payment-option:has(input[type="radio"]:checked) {
  border-color: #b48645;
  background: #fffaf3;
}

.payment-label {
  font: 500 1rem/1 var(--font-sans);
  color: #333;
}

.card-form {
  grid-column: 1 / -1;
  padding: 1.5rem;
  background: #f9f7f4;
  border-radius: 8px;
  margin-top: 0.5rem;
  display: grid;
  gap: 1rem;
}

.card-form .form-group input {
  background: #fff;
}

/* ── TERMS ── */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.terms-checkbox input[type="checkbox"]:checked {
  background: #b48645;
  border-color: #b48645;
}

.terms-checkbox span {
  font: 500 0.95rem/1.6 var(--font-sans);
  color: #333;
}

/* ── CONFIRMATION ── */
.confirm-box {
  padding: 1.5rem;
  background: #f9f7f4;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.confirm-box h3 {
  margin: 0 0 1rem;
  font: 600 1rem/1 var(--font-sans);
  color: #181818;
}

.confirm-box p {
  margin: 0 0 0.75rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

.confirm-box p:last-child {
  margin-bottom: 0;
}

.notes-box {
  padding: 1rem;
  background: #f5eadc;
  border-left: 4px solid #b48645;
  border-radius: 4px;
  margin-top: 1.5rem;
}

.notes-box p {
  margin: 0;
  color: #b48645;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── ACTION BUTTONS ── */
.checkout-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0dbd0;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 1rem 2rem;
  font: 600 0.95rem/1 var(--font-sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #b48645;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #5f3f21;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(180, 134, 69, 0.2);
}

.btn-secondary {
  background: #e8e8e8;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #d0d0d0;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── ORDER SUMMARY SIDEBAR ── */
.checkout-sidebar {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.order-summary {
  background: #f9f7f4;
  border: 1px solid #e0dbd0;
  border-radius: 12px;
  padding: 1.5rem;
}

.order-summary h3 {
  font: 600 1.1rem/1 var(--font-display);
  color: #181818;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0dbd0;
}

.checkout-promo-box {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #e0dbd0;
  border-radius: 12px;
  background: #fffdf9;
}

.checkout-promo-head {
  display: grid;
  gap: 0.2rem;
}

.checkout-promo-head strong {
  color: #24180f;
  font: 700 0.95rem/1.1 var(--font-sans);
}

.checkout-promo-head small {
  color: #75695d;
  font: 500 0.8rem/1.4 var(--font-sans);
}

.checkout-promo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.checkout-promo-form input {
  min-width: 0;
  border: 1px solid #d9cfbf;
  border-radius: 999px;
  background: #fff;
  color: #1f1a15;
  padding: 0.78rem 1rem;
  font: 600 0.9rem/1 var(--font-sans);
  text-transform: uppercase;
}

.checkout-promo-form input:focus {
  outline: none;
  border-color: #b48645;
  box-shadow: 0 0 0 3px rgba(180, 134, 69, 0.14);
}

.checkout-promo-actions {
  display: flex;
  justify-content: flex-end;
}

.checkout-promo-message {
  margin: 0;
  padding: 0.78rem 0.95rem;
  border-radius: 10px;
  background: #f8f1e6;
  color: #6c4b20;
  font: 600 0.82rem/1.4 var(--font-sans);
}

.checkout-promo-message.is-success {
  background: #e7f3eb;
  color: #235336;
}

.checkout-promo-message.is-error {
  background: #f9e4df;
  color: #8c2f24;
}

.order-items {
  border-bottom: 1px solid #e0dbd0;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.order-item:last-child {
  margin-bottom: 0;
}

.item-name {
  font: 500 0.9rem/1 var(--font-sans);
  color: #333;
  margin: 0;
}

.item-qty {
  font: 400 0.8rem/1 var(--font-sans);
  color: #888;
  margin: 0.3rem 0 0;
}

.item-price {
  font: 600 0.95rem/1 var(--font-sans);
  color: #b48645;
  margin: 0;
  white-space: nowrap;
}

.order-totals {
  display: grid;
  gap: 0.75rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font: 500 0.9rem/1 var(--font-sans);
  color: #666;
}

.total-row.total {
  font-size: 1.1rem;
  font-weight: 600;
  color: #181818;
  padding-top: 0.75rem;
  border-top: 2px solid #e0dbd0;
  margin-top: 0.5rem;
}

.total-row-discount {
  color: #2b6a46;
  font-weight: 700;
}

.total-row.total strong {
  color: #b48645;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .checkout-sidebar {
    position: static;
  }

  .checkout-promo-form {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .checkout-address-book-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .checkout-page {
    padding: 10px 0;
  }

  .checkout-section {
    padding: 1.5rem 1rem;
  }

  .checkout-section h2 {
    font-size: 1.2rem;
  }

  .progress-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0.5rem;
  }

  .progress-step {
    width: 100%;
  }

  .progress-line {
    display: none;
  }

  .checkout-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .form-group input,
  .form-group select {
    padding: 0.75rem;
    font-size: 16px;
  }

  .payment-option {
    flex-direction: column;
    text-align: center;
  }

  .saved-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-summary {
    padding: 1rem;
  }

  .order-summary h3 {
    font-size: 1rem;
  }
}

/* ── SUCCESS MODAL ── */
.success-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: start center;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  width: 100%;
  margin: auto;
  animation: slideUp 0.4s ease;
  overflow: hidden;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.success-header {
  background: linear-gradient(135deg, #b48645 0%, #5f3f21 100%);
  color: #ffffff;
  padding: 2.5rem 2rem;
  text-align: center;
}

.success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  animation: scaleIn 0.5s ease 0.2s both;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-header h2 {
  margin: 0 0 0.5rem;
  font: 600 1.8rem/1 var(--font-display);
}

.success-header p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.95;
}

.success-content {
  padding: 2rem;
}

.order-number-box {
  background: #fbf7ef;
  border: 2px solid #b48645;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.order-number-box .label {
  display: block;
  font: 500 0.9rem/1 var(--font-sans);
  color: #666;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-number-box .value {
  display: block;
  font: 700 1.8rem/1 var(--font-display);
  color: #b48645;
}

.success-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0dbd0;
}

.success-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.success-section h3 {
  font: 600 1.1rem/1 var(--font-sans);
  color: #181818;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.success-items {
  display: grid;
  gap: 0.75rem;
}

.success-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f9f7f4;
  border-radius: 8px;
  font-size: 0.95rem;
}

.success-item span {
  color: #555;
  font: 500 0.9rem/1 var(--font-sans);
}

.success-item .price {
  color: #b48645;
  font-weight: 600;
}

.total-amount {
  font: 700 2rem/1 var(--font-display);
  color: #b48645;
  padding: 1rem;
  background: #fbf7ef;
  border-radius: 8px;
  text-align: center;
}

.email-box {
  background: #f5eadc;
  border-left: 4px solid #b48645;
  padding: 1.25rem;
  border-radius: 8px;
}

.email-box p {
  margin: 0 0 0.5rem;
  color: #b48645;
  font: 500 0.9rem/1 var(--font-sans);
}

.email-box p:first-child {
  margin-bottom: 1rem;
}

.email-address {
  font: 700 1.1rem/1 var(--font-display);
  color: #5f3f21;
  margin-bottom: 0.75rem !important;
  word-break: break-all;
}

.small-text {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 0.75rem !important;
}

.shipping-info-box {
  background: #f9f7f4;
  padding: 1.25rem;
  border-radius: 8px;
}

.shipping-info-box h3 {
  margin: 0 0 0.75rem;
}

.shipping-info-box p {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
}

.success-actions {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e0dbd0;
  display: flex;
  gap: 1rem;
}

.success-actions .btn-primary {
  flex: 1;
}

@media (max-width: 640px) {
  .success-modal {
    border-radius: 12px;
  }

  .success-header {
    padding: 2rem 1.5rem;
  }

  .success-content {
    padding: 1.5rem;
  }

  .success-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .success-header h2 {
    font-size: 1.4rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }

  .order-number-box .value {
    font-size: 1.4rem;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-item {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}

