/**
 * genxbuy.com - Cart, Drawer & Checkout Styles
 * Modern, responsive, premium e-commerce design.
 */

@import url('theme.css');

/* ==========================================================================
   1. CART DRAWER (SLIDE-OVER FROM RIGHT)
   ========================================================================== */

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.cart-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  z-index: 9999;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.cart-drawer.active {
  transform: translateX(0);
}

/* Drawer Header */
.cart-drawer-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cart-border);
  background: #ffffff;
}

.cart-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cart-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--cart-primary);
  color: #000000;
  border-radius: 999px;
}

.cart-drawer-close-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-gray);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-drawer-close-btn:hover {
  background: var(--cart-gray-light);
  color: var(--cart-dark);
  transform: rotate(90deg);
}

/* Drawer Body (Scrollable items) */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  overscroll-behavior: contain;
}

.cart-drawer-items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Single Cart Item */
.cart-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--cart-border);
  border-radius: var(--cart-radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.cart-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.cart-item-thumb-link {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f1f5f9;
}

.cart-item-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cart-dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 6px;
  transition: color 0.15s ease;
}

.cart-item-name:hover {
  color: var(--cart-primary);
}

.cart-item-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.cart-item-unit-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cart-primary);
}

/* Quantity Controls */
.cart-qty-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-qty-spinner {
  display: inline-flex;
  align-items: center;
  background: var(--cart-gray-light);
  border: 1px solid var(--cart-border);
  border-radius: 6px;
  overflow: hidden;
}

.cart-qty-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-dark);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

.cart-qty-btn:hover {
  background: #e2e8f0;
}

.cart-qty-val {
  width: 32px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cart-dark);
  border: none;
  background: transparent;
  padding: 0;
}

.cart-item-remove-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.cart-item-remove-btn:hover {
  color: var(--cart-danger);
  background: #fee2e2;
}

/* Empty State */
.cart-drawer-empty {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.cart-empty-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--cart-primary-light);
  color: var(--cart-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.cart-empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin-bottom: 6px;
}

.cart-empty-text {
  font-size: 0.88rem;
  color: var(--cart-gray);
  margin-bottom: 20px;
  max-width: 260px;
}

.btn-cart-shop-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--cart-primary);
  color: #000000;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(60, 172, 240, 0.3);
}

.btn-cart-shop-now:hover {
  background: var(--cart-primary-dark);
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(60, 172, 240, 0.4);
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--cart-border);
  background: #f8fafc;
}

.cart-drawer-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cart-drawer-subtotal-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cart-gray);
}

.cart-drawer-subtotal-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cart-dark);
}

.cart-drawer-shipping-note {
  font-size: 0.78rem;
  color: var(--cart-gray);
  margin-bottom: 14px;
}

.cart-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-drawer-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: var(--cart-primary);
  color: #000000;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(60, 172, 240, 0.35);
}

.btn-drawer-checkout:hover {
  background: var(--cart-primary-dark);
  color: #000000;
  box-shadow: 0 6px 18px rgba(60, 172, 240, 0.45);
}

.btn-drawer-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 18px;
  background: #ffffff;
  color: var(--cart-dark);
  border: 1px solid var(--cart-border);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-drawer-cart:hover {
  background: var(--cart-gray-light);
  border-color: #cbd5e1;
}

/* Quick Added Toast */
.cart-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

.cart-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.cart-toast-icon {
  color: var(--cart-success);
}

/* ==========================================================================
   2. CART PAGE STYLES (`cart.php`)
   ========================================================================== */

.cart-page-wrap {
  padding: 30px 0 60px;
  background: #f8fafc;
  min-height: calc(100vh - 400px);
}

.cart-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.cart-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.cart-page-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--cart-dark);
  margin-bottom: 4px;
}

.cart-page-subtitle {
  font-size: 0.92rem;
  color: var(--cart-gray);
  margin: 0;
}

.cart-page-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .cart-page-grid {
    grid-template-columns: 1fr;
  }
}

/* Cart Table Card */
.cart-table-card {
  background: #ffffff;
  border-radius: var(--cart-radius);
  border: 1px solid var(--cart-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  background: #f8fafc;
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cart-gray);
  text-align: left;
  border-bottom: 1px solid var(--cart-border);
}

.cart-table td {
  padding: 16px;
  border-bottom: 1px solid var(--cart-border);
  vertical-align: middle;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.cart-product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-table-thumb {
  width: 64px;
  height: 64px;
  background: #f8fafc;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}

.cart-table-prod-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--cart-dark);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-table-prod-name:hover {
  color: var(--cart-primary);
}

.cart-table-price {
  font-weight: 700;
  color: var(--cart-dark);
  font-size: 0.95rem;
  white-space: nowrap;
}

.cart-table-total {
  font-weight: 800;
  color: var(--cart-primary);
  font-size: 1.05rem;
  white-space: nowrap;
}

.cart-table-footer {
  padding: 14px 16px;
  background: #fafafa;
  border-top: 1px solid var(--cart-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-clear-cart {
  background: transparent;
  border: 1px solid #fecaca;
  color: var(--cart-danger);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-clear-cart:hover {
  background: #fee2e2;
}

.btn-continue-shop {
  color: var(--cart-gray);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.btn-continue-shop:hover {
  color: var(--cart-primary);
}

/* Order Summary Box */
.cart-summary-card {
  background: #ffffff;
  border-radius: var(--cart-radius);
  border: 1px solid var(--cart-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.cart-summary-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cart-border);
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--cart-gray);
}

.cart-summary-row.total-row {
  border-top: 1px dashed var(--cart-border);
  padding-top: 14px;
  margin-top: 14px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cart-dark);
}

.cart-summary-total-val {
  color: var(--cart-primary);
  font-size: 1.35rem;
}

.cart-summary-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--cart-primary);
  color: #000000;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  margin-top: 18px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(60, 172, 240, 0.35);
}

.cart-summary-btn-checkout:hover {
  background: var(--cart-primary-dark);
  color: #000000;
  box-shadow: 0 6px 20px rgba(60, 172, 240, 0.45);
  transform: translateY(-1px);
}

.cart-trust-badges {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--cart-border);
}

.cart-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--cart-gray);
}

.cart-trust-item svg {
  color: var(--cart-success);
  flex-shrink: 0;
}

/* ==========================================================================
   3. CHECKOUT PAGE STYLES (`checkout.php`)
   ========================================================================== */

.checkout-page-wrap {
  padding: 30px 0 60px;
  background: #f8fafc;
  min-height: calc(100vh - 400px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#checkoutForm {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.checkout-forms-col,
.checkout-sidebar-col {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

/* Mobile Order Summary Collapsible Bar (<=992px) */
.checkout-mobile-summary-bar {
  display: none;
}

@media (max-width: 992px) {
  .checkout-mobile-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--cart-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    width: 100%;
    box-sizing: border-box;
  }

  .checkout-mobile-summary-bar:hover,
  .checkout-mobile-summary-bar:active {
    border-color: var(--cart-primary);
    background: #fbfdf9;
  }

  .checkout-mobile-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cart-dark);
    font-size: 0.92rem;
    font-weight: 600;
  }

  .checkout-mobile-summary-left svg {
    color: var(--cart-primary);
    flex-shrink: 0;
  }

  .checkout-mobile-summary-chevron {
    transition: transform 0.25s ease;
    color: var(--cart-gray);
    flex-shrink: 0;
  }

  .checkout-mobile-summary-bar.active .checkout-mobile-summary-chevron {
    transform: rotate(180deg);
  }

  .checkout-mobile-summary-right {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cart-primary);
    white-space: nowrap;
    margin-left: 8px;
  }

  .checkout-mobile-summary-content {
    background: #ffffff;
    border: 1px solid var(--cart-border);
    border-radius: 10px;
    padding: 16px;
    margin-top: -10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    animation: fadeIn 0.2s ease;
    width: 100%;
    box-sizing: border-box;
  }
}

.checkout-card {
  background: #ffffff;
  border-radius: var(--cart-radius);
  border: 1px solid var(--cart-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  padding: 24px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.checkout-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cart-border);
}

.checkout-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cart-primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin: 0;
  line-height: 1.3;
}

/* Form Styles */
.form-group-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .form-group-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
  }
}

.form-group {
  margin-bottom: 16px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.checkout-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cart-dark);
  margin-bottom: 6px;
}

.checkout-label .required {
  color: var(--cart-danger);
}

.checkout-input,
.checkout-select,
.checkout-textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--cart-dark);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.checkout-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 38px;
}

.checkout-input:focus,
.checkout-select:focus,
.checkout-textarea:focus {
  outline: none;
  border-color: var(--cart-primary);
  box-shadow: 0 0 0 3px rgba(60, 172, 240, 0.25);
}

.checkout-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Payment Method Selection */
.payment-method-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.payment-option-card {
  border: 2px solid var(--cart-border);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s ease;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.payment-option-card:hover {
  border-color: #94a3b8;
}

.payment-option-card.selected {
  border-color: var(--cart-primary);
  background: #fbfdf9;
}

.payment-option-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  margin: 0;
  user-select: none;
}

.payment-radio {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--cart-primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.payment-option-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.payment-option-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-option-desc {
  font-size: 0.82rem;
  color: var(--cart-gray);
  margin: 0;
  line-height: 1.4;
}

/* Bank Details Accordion / Callout */
.bank-transfer-details-box {
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: none;
  width: 100%;
  box-sizing: border-box;
}

.bank-transfer-details-box.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.bank-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .bank-info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

.bank-info-item {
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--cart-border);
  min-width: 0;
  box-sizing: border-box;
}

.bank-info-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--cart-gray);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.bank-info-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cart-dark);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.bank-slip-upload-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--cart-border);
  width: 100%;
  box-sizing: border-box;
}

.bank-slip-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cart-dark);
  margin-bottom: 6px;
  display: block;
}

.bank-slip-upload-wrap input[type="file"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 10px;
}

.bank-slip-help {
  font-size: 0.76rem;
  color: var(--cart-gray);
  margin-top: 4px;
  line-height: 1.35;
}

/* Checkout Review / Sidebar */
.checkout-order-summary {
  background: #ffffff;
  border-radius: var(--cart-radius);
  border: 1px solid var(--cart-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  padding: 24px;
  position: sticky;
  top: 90px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .checkout-order-summary {
    position: static;
    padding: 20px 16px;
    margin-top: 4px;
    border-radius: 10px;
  }
}

.checkout-items-preview {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.checkout-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.checkout-preview-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.checkout-preview-thumb {
  width: 48px;
  height: 48px;
  background: #f8fafc;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  object-fit: contain;
  padding: 2px;
  flex-shrink: 0;
}

.checkout-preview-info {
  flex: 1;
  min-width: 0;
}

.checkout-preview-name {
  font-weight: 600;
  color: var(--cart-dark);
  font-size: 0.88rem;
  line-height: 1.35;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.checkout-preview-qty-price {
  font-size: 0.78rem;
  color: var(--cart-gray);
}

.checkout-preview-subtotal {
  font-weight: 700;
  color: var(--cart-dark);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
  font-size: 0.92rem;
}

.btn-place-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--cart-primary);
  color: #000000;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(60, 172, 240, 0.35);
  box-sizing: border-box;
  min-height: 48px;
}

.btn-place-order:hover:not(:disabled) {
  background: var(--cart-primary-dark);
  color: #000000;
  box-shadow: 0 6px 20px rgba(60, 172, 240, 0.45);
  transform: translateY(-1px);
}

.btn-place-order:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==========================================================================
   4. ORDER SUCCESS PAGE STYLES (`order-success.php`)
   ========================================================================== */

.order-success-wrap {
  padding: 40px 0 70px;
  background: #f8fafc;
  min-height: calc(100vh - 400px);
}

.order-success-card {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--cart-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 36px 30px;
  text-align: center;
}

.order-success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--cart-primary-light);
  color: var(--cart-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.order-success-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--cart-dark);
  margin-bottom: 8px;
}

.order-success-subtitle {
  font-size: 0.95rem;
  color: var(--cart-gray);
  margin-bottom: 24px;
}

.order-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cart-dark);
  margin-bottom: 28px;
}

.order-receipt-details {
  text-align: left;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--cart-border);
  padding: 20px;
  margin-bottom: 28px;
}

.order-receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--cart-gray);
}

.order-receipt-row strong {
  color: var(--cart-dark);
}

.order-receipt-divider {
  border-top: 1px solid var(--cart-border);
  margin: 14px 0;
}

.order-success-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-success-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-success-wa:hover {
  background: #20ba5a;
  transform: translateY(-1px);
}

.btn-success-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cart-dark);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-success-home:hover {
  background: #1e293b;
}

.btn-success-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--cart-dark);
  border: 1px solid var(--cart-border);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-success-print:hover {
  background: var(--cart-gray-light);
}

@media print {
  body * {
    visibility: hidden;
  }
  .order-success-card, .order-success-card * {
    visibility: visible;
  }
  .order-success-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
  }
  .order-success-actions, .site-header, .site-footer {
    display: none !important;
  }
}

/* ==========================================================================
   5. SINGLE PRODUCT ACTIONS & QUICK ADD STYLES
   ========================================================================== */

.product-purchase-box {
  margin-bottom: 24px;
}

.product-cart-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.product-qty-selector-wrap {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--cart-border);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  height: 48px;
}

.btn-qty-adj {
  background: #f8fafc;
  border: none;
  width: 40px;
  height: 100%;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cart-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.btn-qty-adj:hover {
  background: #e2e8f0;
}

.product-qty-field {
  width: 48px;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cart-dark);
  -moz-appearance: textfield;
}

.product-qty-field::-webkit-inner-spin-button,
.product-qty-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-product-add-cart {
  flex: 1;
  min-width: 140px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--cart-primary);
  color: #000000;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(60, 172, 240, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-product-add-cart:hover {
  background: var(--cart-primary-dark);
  color: #000000;
  box-shadow: 0 6px 18px rgba(60, 172, 240, 0.45);
  transform: translateY(-1px);
}

.btn-product-buy-now {
  flex: 1;
  min-width: 130px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-product-buy-now:hover {
  background: #1f1f1f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

/* Quick Add to Cart button on product cards */
.btn-card-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--cart-primary-light);
  color: #000000;
  border: 1px solid rgba(60, 172, 240, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-add-cart:hover {
  background: var(--cart-primary);
  color: #000000;
  border-color: var(--cart-primary);
  transform: scale(1.05);
}

/* ==========================================================================
   6. MOBILE RESPONSIVE STYLES (Cart & Checkout Pages)
   ========================================================================== */

@media (max-width: 768px) {
  /* Common Container & Spacing */
  .cart-page-wrap,
  .checkout-page-wrap {
    padding: 16px 0 44px;
  }

  .cart-page-container {
    padding: 0 12px;
  }

  .cart-page-header {
    margin-bottom: 16px;
    gap: 10px;
  }

  .cart-page-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .cart-page-subtitle {
    font-size: 0.84rem;
  }

  .btn-open-drawer-cta {
    display: none !important;
  }

  /* Cart Layout Grid */
  .cart-page-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Cart Table to Mobile Card Transformation */
  .cart-table-card {
    border-radius: 10px;
    overflow: visible;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table,
  .cart-table tbody {
    display: block;
    width: 100%;
  }

  .cart-table tr,
  .cart-table-row {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "product product"
      "price   price"
      "qty     total";
    row-gap: 10px;
    column-gap: 12px;
    align-items: center;
    position: relative;
    padding: 14px 12px;
    border-bottom: 1px solid var(--cart-border);
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
  }

  .cart-table td {
    padding: 0 !important;
    border: none !important;
    display: block;
  }

  /* 1. Product Cell (Thumbnail + Title) */
  .cart-col-product,
  .cart-table td:nth-child(1) {
    grid-area: product;
    padding-right: 36px !important; /* Space for absolute remove button */
  }

  .cart-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .cart-table-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--cart-border);
    padding: 3px;
    object-fit: contain;
  }

  .cart-product-meta {
    flex: 1;
    min-width: 0;
  }

  .cart-table-prod-name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cart-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 2. Unit Price */
  .cart-col-price,
  .cart-table td:nth-child(2) {
    grid-area: price;
    font-size: 0.82rem;
    color: var(--cart-gray);
    font-weight: 500;
  }

  .cart-col-price::before,
  .cart-table td:nth-child(2)::before {
    content: "Unit Price: ";
    color: var(--cart-gray);
    font-weight: 500;
  }

  /* 3. Quantity Controls */
  .cart-col-qty,
  .cart-table td:nth-child(3) {
    grid-area: qty;
    justify-self: start;
  }

  .cart-table .cart-qty-spinner {
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid var(--cart-border);
  }

  .cart-table .cart-qty-btn {
    width: 34px;
    height: 36px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cart-dark);
  }

  .cart-table .cart-qty-val {
    width: 38px;
    height: 36px;
    font-size: 0.95rem;
    font-weight: 700;
  }

  /* 4. Line Subtotal */
  .cart-col-total,
  .cart-table td:nth-child(4) {
    grid-area: total;
    justify-self: end;
    text-align: right;
  }

  .cart-col-total::before,
  .cart-table td:nth-child(4)::before {
    content: "Subtotal: ";
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cart-gray);
    margin-right: 2px;
  }

  .cart-table-total {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cart-primary);
  }

  /* 5. Remove Button */
  .cart-col-action,
  .cart-table td:nth-child(5) {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
  }

  .cart-table .cart-item-remove-btn {
    width: 32px;
    height: 32px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 6px;
    border: 1px solid #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .cart-table .cart-item-remove-btn:active {
    background: #fee2e2;
    transform: scale(0.95);
  }

  /* Cart Table Footer */
  .cart-table-footer {
    padding: 12px 14px;
    gap: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .btn-continue-shop {
    font-size: 0.82rem;
  }

  .btn-clear-cart {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  /* Cart Order Summary Card */
  .cart-summary-card {
    position: static;
    padding: 18px 14px;
    border-radius: 10px;
  }

  .cart-summary-title {
    font-size: 1.05rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .cart-summary-btn-checkout {
    padding: 13px 18px;
    font-size: 0.98rem;
    min-height: 48px;
    border-radius: 8px;
  }

  /* Checkout Layout */
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 100%;
  }

  .checkout-forms-col,
  .checkout-sidebar-col {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .checkout-card {
    padding: 16px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .checkout-card-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .checkout-step-num {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
    flex-shrink: 0;
  }

  .checkout-card-title {
    font-size: 1.02rem;
    line-height: 1.3;
  }

  .form-group-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
  }

  .form-group {
    margin-bottom: 12px;
    min-width: 0;
    width: 100%;
  }

  .checkout-label {
    font-size: 0.8rem;
    margin-bottom: 5px;
  }

  /* 16px font-size to strictly prevent iOS Safari auto-zoom */
  .checkout-input,
  .checkout-select,
  .checkout-textarea {
    font-size: 16px !important;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .checkout-textarea {
    min-height: 80px;
  }

  /* Payment Selection */
  .payment-method-selector {
    gap: 10px;
    width: 100%;
  }

  .payment-option-card {
    padding: 12px;
    gap: 10px;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .payment-option-header {
    gap: 10px;
  }

  .payment-radio {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex-shrink: 0;
  }

  .payment-option-title {
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }

  .payment-option-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  /* Bank Info Box */
  .bank-transfer-details-box {
    padding: 12px 10px;
    margin-top: 10px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .bank-info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
  }

  .bank-info-item {
    padding: 8px 10px;
    min-width: 0;
    box-sizing: border-box;
  }

  .bank-info-label {
    font-size: 0.68rem;
  }

  .bank-info-val {
    font-size: 0.85rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .bank-slip-upload-wrap {
    margin-top: 10px;
    padding-top: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .bank-slip-upload-wrap input[type="file"] {
    min-height: auto;
    font-size: 13px !important;
    padding: 6px 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .bank-slip-help {
    font-size: 0.72rem;
  }

  /* Checkout Order Summary */
  .checkout-order-summary {
    position: static;
    padding: 18px 14px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .checkout-items-preview {
    max-height: 220px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .checkout-preview-item {
    gap: 10px;
    font-size: 0.82rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .checkout-preview-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .btn-place-order {
    padding: 13px 18px;
    font-size: 1rem;
    min-height: 48px;
    margin-top: 16px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Extra Compact Phones (≤ 380px) */
@media (max-width: 380px) {
  .cart-table tr,
  .cart-table-row {
    padding: 12px 10px;
    row-gap: 8px;
  }

  .cart-table-thumb {
    width: 50px;
    height: 50px;
  }

  .cart-table-prod-name {
    font-size: 0.85rem;
  }

  .cart-table .cart-qty-spinner {
    height: 32px;
  }

  .cart-table .cart-qty-btn {
    width: 30px;
    height: 32px;
    font-size: 1rem;
  }

  .cart-table .cart-qty-val {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .cart-table-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .btn-continue-shop,
  .btn-clear-cart {
    justify-content: center;
    width: 100%;
  }

  .checkout-mobile-summary-bar {
    padding: 12px 10px;
  }

  .checkout-mobile-summary-left {
    gap: 6px;
    font-size: 0.86rem;
  }

  .checkout-mobile-summary-right {
    font-size: 0.92rem;
  }

  .checkout-card {
    padding: 14px 10px;
  }

  .checkout-order-summary {
    padding: 14px 10px;
  }

  .payment-option-card {
    padding: 10px 8px;
  }

  .bank-transfer-details-box {
    padding: 10px 8px;
  }
}
