/* ============================================================
   CHECKOUT – Redesign visual inspirado em Wepink / Granado
   ============================================================ */

/* ── Force scroll always available ─────────────────────── */
/* Bootstrap adds overflow:hidden to <body> via .modal-open while a modal
   is open. Our JS removes the class after every close, but this rule
   acts as a hard override so the checkout page is never scroll-locked. */
body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

/* ── Page title ─────────────────────────────────────────── */
.checkout-page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin: 30px 0 24px;
  color: var(--light-text);
  text-transform: uppercase;
}

/* ── Steps bar ──────────────────────────────────────────── */
.checkout-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 0 24px;
  border-bottom: 1px solid #e0dace;
  margin-bottom: 32px;
}

.checkout-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.38;
  transition: opacity 0.2s, color 0.2s;
  cursor: default;
}

.checkout-step.active {
  opacity: 1;
}

.checkout-step.completed {
  opacity: 1;
}

/* Step number badge */
.checkout-step-num {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--light-mid);
  color: var(--light-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.25s;
}

/* Hide the check icon by default, show number */
.checkout-step-num .fa-check { display: none; }
.checkout-step-num span      { display: inline; }

.checkout-step.active .checkout-step-num {
  background: var(--gold);
}

/* Completed: show check, hide number */
.checkout-step.completed .checkout-step-num {
  background: var(--gold);
}
.checkout-step.completed .checkout-step-num .fa-check { display: inline; }
.checkout-step.completed .checkout-step-num span      { display: none; }

.checkout-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--light-text);
  white-space: nowrap;
}

.checkout-step-sep {
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: #e0dace;
  margin: 0 8px;
  margin-bottom: 20px;
  transition: background 0.25s;
}

/* ── Main layout ────────────────────────────────────────── */
.checkout-body {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.checkout-forms {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

/* ── Checkout blocks (cards) ────────────────────────────── */
.checkout-block {
  background: var(--light-card);
  border: 1px solid #e0dace;
  border-radius: 12px;
  padding: 24px;
}

.checkout-block fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.checkout-block fieldset legend,
.checkout-block .confirm-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--gold);
  display: block;
  width: 100%;
  float: none;
}

.checkout-block-confirm {
  padding: 16px 24px;
}

.btn-checkout-confirm {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 8px;
}

/* ── Step panels ─────────────────────────────────────────── */
.step-panel {
  background: var(--light-card);
  border: 1px solid #e0dace;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.step-panel.active {
  border-color: var(--gold);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.step-panel.done {
  border-color: #e0dace;
  opacity: 0.85;
}

/* Header */
.step-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--light-card);
  cursor: default;
}

/* Done panels are clickable to go back */
.step-panel.done .step-panel-header {
  cursor: pointer;
}
.step-panel.done .step-panel-header:hover {
  background: var(--light-bg);
}

.step-badge {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--light-card);
  background: var(--light-mid);
  transition: background 0.25s;
}

/* Hide check icon by default, show number */
.step-badge .fa-check { display: none; }
.step-badge span      { display: inline; }

.step-panel.active .step-badge {
  background: var(--gold);
}

/* Completed: show check, hide number, green tint */
.step-panel.done .step-badge {
  background: #4caf50;
}
.step-panel.done .step-badge .fa-check { display: inline; }
.step-panel.done .step-badge span      { display: none; }

.step-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--light-text);
}

.step-panel.locked .step-title {
  color: var(--light-mid);
}

/* Body */
.step-panel-body {
  padding: 0 22px 22px;
  display: none;
}

.step-panel.active .step-panel-body {
  display: block;
  animation: stepFadeIn 0.25s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fieldset/legend inside a step panel */
.step-panel .step-panel-body fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}

.step-panel .step-panel-body fieldset legend {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--light-dim);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e0dace;
  display: block;
  width: 100%;
  float: none;
}

/* Divider between address sub-sections */
#checkout-payment-address + #checkout-shipping-address {
  border-top: 1px solid #e0dace;
  padding-top: 18px;
  margin-top: 4px;
}

/* Continue button bar */
.step-continue-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e0dace;
}

.btn-step-continue {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

/* ── Confirm order summary ──────────────────────────────── */
.confirm-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--gold);
}

.confirm-product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.confirm-product-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.confirm-product-img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0dace;
}

.confirm-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.confirm-product-details {
  flex: 1;
  min-width: 0;
}

.confirm-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--light-text);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  margin-bottom: 3px;
}

.confirm-product-name:hover {
  color: var(--gold);
}

.confirm-product-option {
  font-size: 11px;
  color: var(--light-dim);
  line-height: 1.5;
}

.confirm-product-qty {
  font-size: 11px;
  color: var(--light-dim);
  margin-top: 4px;
}

.confirm-product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--light-text);
  white-space: nowrap;
  padding-top: 2px;
}

/* ── Confirm totals ─────────────────────────────────────── */
.confirm-totals {
  border-top: 1px solid #e0dace;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--light-mid);
}

.confirm-total-grand {
  font-size: 16px;
  font-weight: 700;
  color: var(--light-text);
  padding-top: 10px;
  border-top: 1px solid #e0dace;
  margin-top: 4px;
}

/* ── Cart page layout ───────────────────────────────────── */
.cart-layout {
  background: var(--light-card);
  border: 1px solid #e0dace;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e0dace;
}

.btn-cart-checkout {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border-radius: 8px;
}

.btn-cart-continue {
  font-size: 14px;
}

/* ── Cart product rows ──────────────────────────────────── */
#cart-product-list {
  padding: 8px 20px;
}

.cart-product-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #e0dace;
}

.cart-product-row:last-of-type {
  border-bottom: none;
}

.cart-product-img {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0dace;
}

.cart-product-img a {
  display: block;
  height: 100%;
}

.cart-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.cart-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cart-product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--light-text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.cart-product-name:hover {
  color: var(--gold);
}

.cart-product-option {
  font-size: 12px;
  color: var(--light-dim);
}

.cart-product-price-mobile {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--light-text);
}

.cart-product-qty-form {
  margin-top: 4px;
}

.cart-product-qty-form .input-group {
  max-width: 140px;
  flex-wrap: nowrap;
}

.cart-remove-btn {
  padding: 4px 10px !important;
  border: none !important;
  box-shadow: none !important;
}

.cart-product-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 90px;
  padding-top: 2px;
}

.cart-product-unit-price {
  font-size: 12px;
  color: var(--light-dim);
}

.cart-product-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--light-text);
}

/* ── Cart totals block ──────────────────────────────────── */
.cart-totals-block {
  padding: 18px 0 6px;
  border-top: 2px solid #e0dace;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--light-mid);
}

.cart-total-grand {
  font-size: 17px;
  font-weight: 700;
  color: var(--light-text);
  padding-top: 10px;
  border-top: 1px solid #e0dace;
  margin-top: 4px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-sidebar {
    position: static;
  }

  .checkout-steps-bar {
    gap: 0;
  }

  .checkout-step-sep {
    max-width: 30px;
  }
}

@media (max-width: 767px) {
  .checkout-steps-bar {
    padding: 18px 10px 16px;
  }

  .checkout-step-label {
    font-size: 10px;
  }

  .checkout-step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .checkout-block {
    padding: 16px;
  }

  .step-panel-header {
    padding: 14px 16px;
  }

  .step-panel-body {
    padding: 0 16px 16px;
  }

  .cart-product-img {
    width: 72px;
    height: 72px;
  }

  .cart-product-totals {
    min-width: 70px;
  }

  .cart-product-unit-price {
    display: none;
  }

  .cart-product-price-mobile {
    display: block;
  }

  #cart-product-list {
    padding: 4px 12px;
  }
}

@media (max-width: 480px) {
  .checkout-step-sep {
    max-width: 16px;
    margin: 0 4px;
    margin-bottom: 20px;
  }

  .btn-step-continue {
    width: 100%;
    justify-content: center;
  }

  .step-continue-bar {
    justify-content: stretch;
  }
}


/* ── Page title ─────────────────────────────────────────── */
.checkout-page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin: 30px 0 24px;
  color: var(--light-text);
  text-transform: uppercase;
}

/* ── Steps bar ──────────────────────────────────────────── */
.checkout-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 28px 0 24px;
  border-bottom: 1px solid #e0dace;
  margin-bottom: 32px;
}

.checkout-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.38;
  transition: opacity 0.2s;
}

.checkout-step.active {
  opacity: 1;
}

.checkout-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--light-text);
  color: var(--light-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.checkout-step.active .checkout-step-num {
  background: var(--gold);
}

.checkout-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--light-text);
  white-space: nowrap;
}

.checkout-step-sep {
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: #e0dace;
  margin: 0 8px;
  margin-bottom: 20px;
}

/* ── Main layout ────────────────────────────────────────── */
.checkout-body {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.checkout-forms {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

/* ── Checkout blocks (cards) ────────────────────────────── */
.checkout-block {
  background: var(--light-card);
  border: 1px solid #e0dace;
  border-radius: 12px;
  padding: 24px;
}

.checkout-block fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.checkout-block fieldset legend,
.checkout-block .confirm-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--gold);
  display: block;
  width: 100%;
  float: none;
}

.checkout-block-confirm {
  padding: 16px 24px;
}

.btn-checkout-confirm {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 8px;
}

/* ── Confirm order summary ──────────────────────────────── */
.confirm-product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.confirm-product-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.confirm-product-img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0dace;
}

.confirm-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.confirm-product-details {
  flex: 1;
  min-width: 0;
}

.confirm-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--light-text);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  margin-bottom: 3px;
}

.confirm-product-name:hover {
  color: var(--gold);
}

.confirm-product-option {
  font-size: 11px;
  color: var(--light-dim);
  line-height: 1.5;
}

.confirm-product-qty {
  font-size: 11px;
  color: var(--light-dim);
  margin-top: 4px;
}

.confirm-product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--light-text);
  white-space: nowrap;
  padding-top: 2px;
}

/* ── Confirm totals ─────────────────────────────────────── */
.confirm-totals {
  border-top: 1px solid #e0dace;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--light-mid);
}

.confirm-total-grand {
  font-size: 16px;
  font-weight: 700;
  color: var(--light-text);
  padding-top: 10px;
  border-top: 1px solid #e0dace;
  margin-top: 4px;
}

/* ── Cart page layout ───────────────────────────────────── */
.cart-layout {
  background: var(--light-card);
  border: 1px solid #e0dace;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e0dace;
}

.btn-cart-checkout {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border-radius: 8px;
}

.btn-cart-continue {
  font-size: 14px;
}

/* ── Cart product rows ──────────────────────────────────── */
#cart-product-list {
  padding: 8px 20px;
}

.cart-product-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #e0dace;
}

.cart-product-row:last-of-type {
  border-bottom: none;
}

.cart-product-img {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0dace;
}

.cart-product-img a {
  display: block;
  height: 100%;
}

.cart-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.cart-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cart-product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--light-text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.cart-product-name:hover {
  color: var(--gold);
}

.cart-product-option {
  font-size: 12px;
  color: var(--light-dim);
}

.cart-product-price-mobile {
  display: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--light-text);
}

.cart-product-qty-form {
  margin-top: 4px;
}

.cart-product-qty-form .input-group {
  max-width: 140px;
  flex-wrap: nowrap;
}

.cart-remove-btn {
  padding: 4px 10px !important;
  border: none !important;
  box-shadow: none !important;
}

.cart-product-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 90px;
  padding-top: 2px;
}

.cart-product-unit-price {
  font-size: 12px;
  color: var(--light-dim);
}

.cart-product-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--light-text);
}

/* ── Cart totals block ──────────────────────────────────── */
.cart-totals-block {
  padding: 18px 0 6px;
  border-top: 2px solid #e0dace;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--light-mid);
}

.cart-total-grand {
  font-size: 17px;
  font-weight: 700;
  color: var(--light-text);
  padding-top: 10px;
  border-top: 1px solid #e0dace;
  margin-top: 4px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-sidebar {
    position: static;
  }

  .checkout-steps-bar {
    gap: 0;
  }

  .checkout-step-sep {
    max-width: 30px;
  }
}

@media (max-width: 767px) {
  .checkout-steps-bar {
    padding: 18px 10px 16px;
  }

  .checkout-step-label {
    font-size: 10px;
  }

  .checkout-step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .checkout-block {
    padding: 16px;
  }

  .cart-product-img {
    width: 72px;
    height: 72px;
  }

  .cart-product-totals {
    min-width: 70px;
  }

  .cart-product-unit-price {
    display: none;
  }

  .cart-product-price-mobile {
    display: block;
  }

  #cart-product-list {
    padding: 4px 12px;
  }
}

@media (max-width: 480px) {
  .checkout-step-sep {
    max-width: 16px;
    margin: 0 4px;
    margin-bottom: 20px;
  }
}
