/* ── Cart/Checkout Page ── */
.cart-page-section {
  min-height: 100vh;
  padding: 2rem 0 60px;
  background: var(--body-background);
}

/* ── Buttons ── */
.checkout-btn-primary {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: var(--brand-secondary-gradient);
  color: var(--text-on-dark);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 16px var(--secondary-25);
}

.checkout-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--secondary-30);
  color: var(--text-on-dark);
}

/* ── Checkout Form Card ── */
.checkout-form-card {
  margin-bottom: 1.25rem;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  overflow: visible;
}

/* ── Form Panel ── */
.checkout-form-panel {
  background: var(--card-dark-bg);
  border: 1px solid var(--card-dark-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.checkout-form-panel:hover {
  border-color: var(--card-dark-border-hover);
  box-shadow: var(--card-dark-shadow);
}

/* ── Form Headings ── */
.checkout-form-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-on-dark);
  margin-bottom: 1.25rem;
}

.checkout-form-heading-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-secondary-gradient);
  color: var(--text-on-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--secondary-25);
}

/* ── Form Labels ── */
.checkout-form-panel .form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

/* ── Input Wraps ── */
.checkout-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.checkout-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-on-dark-faint);
  font-size: 1rem;
  z-index: 2;
}

.checkout-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  border: 1.5px solid var(--card-dark-border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--card-dark-bg);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.checkout-input:-webkit-autofill,
.checkout-input:-webkit-autofill:hover,
.checkout-input:-webkit-autofill:focus,
.checkout-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--card-dark-bg) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  transition: background-color 5000s ease-in-out 0s;
}

.checkout-input::placeholder {
  color: var(--text-on-dark-faint);
}

.checkout-input:focus {
  outline: none;
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px var(--secondary-10);
  background: var(--card-dark-bg-hover);
}

.checkout-textarea-wrap .checkout-input {
  padding-left: 1rem;
  min-height: 80px;
  resize: vertical;
}

.checkout-textarea-wrap .checkout-textarea-icon {
  top: 18px;
  transform: none;
}

.checkout-textarea-wrap .checkout-input-icon {
  top: 18px;
  transform: none;
}

/* ── Payment Options ── */
.checkout-payment-options {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.checkout-payment-options .checkout-payment-card {
  flex: 1;
}

.checkout-payment-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 2px solid var(--card-dark-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: transparent;
}

.checkout-payment-card:hover {
  border-color: var(--card-dark-border-hover);
  background: var(--card-dark-bg);
}

.checkout-payment-card:has(input:checked) {
  border-color: var(--brand-secondary);
  background: var(--secondary-10);
}

.checkout-payment-body {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.checkout-payment-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.checkout-payment-icon-wrap--cod {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.checkout-payment-icon-wrap--online {
  background: var(--secondary-10);
  color: var(--brand-secondary);
}

.checkout-payment-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-on-dark);
}

.checkout-payment-check {
  margin-left: auto;
  color: var(--brand-secondary);
  font-size: 1.15rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.checkout-payment-card:has(input:checked) .checkout-payment-check {
  opacity: 1;
}

/* ── Summary Card ── */
.checkout-summary-card {
  background: var(--card-dark-bg);
  border: 1px solid var(--card-dark-border);
  border-radius: 16px;
  overflow: hidden;
}

.checkout-summary-header {
  padding: 1.1rem 1.35rem;
  color: var(--text-on-dark);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--card-dark-border);
}

.checkout-summary-body {
  padding: 0.75rem 1.35rem;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-on-dark-muted);
}

.checkout-summary-val {
  font-weight: 600;
  color: var(--text-on-dark);
}

.checkout-summary-divider {
  height: 1px;
  background: var(--card-dark-border);
  margin: 0.5rem 0;
}

.checkout-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0 0.25rem;
}

.checkout-summary-total-row span {
  font-weight: 600;
  color: var(--text-on-dark);
}

.checkout-summary-total-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-on-dark);
}

/* ── Summary Items ── */
.checkout-summary-items-wrap {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.75rem 1.35rem;
  border-bottom: 1px solid var(--card-dark-border);
}

.checkout-summary-items-wrap::-webkit-scrollbar { width: 4px; }
.checkout-summary-items-wrap::-webkit-scrollbar-track { background: transparent; }
.checkout-summary-items-wrap::-webkit-scrollbar-thumb { background: var(--shine-edge); border-radius: 4px; }

/* ── Checkout Order Item ── */
.checkout-order-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--card-dark-border);
}

.checkout-order-item:last-child {
  border-bottom: none;
}

.checkout-order-img-wrap {
  flex-shrink: 0;
}

.checkout-order-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--card-dark-border);
}

.checkout-order-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.checkout-order-top {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.checkout-order-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-on-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-order-tag {
  font-size: 0.72rem;
  color: var(--text-on-dark-faint);
}

.checkout-order-tag .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--secondary-10);
  color: var(--brand-secondary);
  font-weight: 600;
}

/* ── Offer locked behind Min Order Total ──
   The offer exists but only unlocks once the whole order subtotal reaches its
   min_total, so the item shows this pill instead of a discounted price. */
.checkout-order-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.15rem 0 0.1rem;
}

.checkout-order-flags:empty {
  display: none;
}

.cart-min-order-badge,
.checkout-min-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 42, 56, 0.55);
  border: 1px dashed rgba(231, 174, 7, 0.5);
  color: var(--brand-gold);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.35;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-min-order-badge i,
.checkout-min-order-badge i {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.checkout-order-flags .checkout-min-order-badge {
  margin-top: 0;
}

/* ── "Add ৳X more to unlock" notice (cart + checkout summaries) ── */
.checkout-offer-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(231, 174, 7, 0.1);
  border: 1px dashed rgba(231, 174, 7, 0.45);
  color: var(--brand-gold);
  font-size: 0.75rem;
  line-height: 1.5;
}

.checkout-offer-notice[hidden] {
  display: none;
}

.checkout-offer-notice i {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.checkout-offer-notice strong {
  font-weight: 700;
}

.checkout-order-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.checkout-order-price {
  font-size: 0.78rem;
  color: var(--text-on-dark-faint);
}

.checkout-order-subtotal {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-on-dark);
  white-space: nowrap;
}

/* ── Summary Empty State ── */
.checkout-summary-empty {
  color: rgba(255, 255, 255, 0.45);
}

/* ── Summary Footer ── */
.checkout-summary-footer {
  padding: 1.1rem 1.35rem 1.35rem;
  border-top: 1px solid var(--card-dark-border);
}

/* ── Continue Link ── */
.checkout-continue-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-on-dark-subtle);
  text-decoration: none;
  transition: color 0.25s ease;
}

.checkout-continue-link:hover {
  color: var(--brand-secondary);
}

/* ── Summary Sticky ── */
.checkout-summary-sticky {
  position: sticky;
  top: 100px;
}

/* ── Delivery Info Toast Badge ── */
.delivery-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.delivery-info-badge i {
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .checkout-summary-sticky {
    position: static;
    margin-top: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .cart-page-section { padding: 1rem 0 40px; }
  .checkout-form-panel { padding: 1.15rem; border-radius: 14px; }
  .checkout-payment-options {
    flex-direction: column;
  }
  .checkout-summary-card { border-radius: 14px; }
  .checkout-summary-items-wrap { max-height: 200px; }
  .checkout-order-img { width: 42px; height: 42px; }
}

@media (max-width: 575.98px) {
  .cart-page-section { padding: 0.75rem 0 30px; }
  .checkout-form-panel { padding: 1rem; border-radius: 12px; margin-bottom: 1rem; }
  .checkout-form-heading { font-size: 0.92rem; gap: 0.5rem; }
  .checkout-form-heading-icon { width: 32px; height: 32px; font-size: 0.85rem; }
  .checkout-input { font-size: 0.85rem; padding: 0.7rem 0.85rem 0.7rem 2.5rem; }
  .checkout-btn-primary { padding: 0.75rem; font-size: 0.9rem; }
  .checkout-summary-body { padding: 0.6rem 1rem; }
  .checkout-summary-header { padding: 0.9rem 1rem; }
  .checkout-summary-footer { padding: 0.9rem 1rem 1.15rem; }
  .checkout-summary-items-wrap { padding: 0.6rem 1rem; }
  .checkout-summary-total-val { font-size: 1.2rem; }
  .delivery-info-badge { font-size: 0.7rem; padding: 0.35rem 0.6rem; }
}
