/* ==========================================================================
   BASHI JEWELRY — Cart & Checkout Styles
   cart.css
   ========================================================================== */

/* Cart Page Layout */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-8);
  align-items: start;
}

.cart-table {
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius-base);
  overflow: hidden;
}

.cart-table__head {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 40px;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface-3);
  border-bottom: var(--border);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cart-table__row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 40px;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border);
  align-items: center;
}

.cart-table__row:last-child {
  border-bottom: none;
}

.cart-table__product {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cart-table__product-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--color-surface-3);
}

/* Order Summary Box */
.order-summary {
  background: var(--color-white);
  border: var(--border);
  border-radius: var(--radius-base);
  padding: var(--space-5);
  position: sticky;
  top: calc(var(--header-main-h) + var(--header-nav-h) + var(--space-4));
}

.order-summary__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border);
}

.order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.order-summary__row--total {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  padding-top: var(--space-3);
  border-top: var(--border);
  margin-top: var(--space-2);
}

.order-summary__value--discount {
  color: var(--color-success);
}

.order-summary__value--total {
  color: var(--color-gold);
}

.order-summary__promo {
  margin: var(--space-4) 0;
}

.order-summary__promo-row {
  display: flex;
  gap: var(--space-2);
}

/* Checkout Steps */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.checkout-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checkout-step__num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-surface-3);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.checkout-step.is-active .checkout-step__num {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-white);
}

.checkout-step.is-done .checkout-step__num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}

.checkout-step__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

.checkout-step.is-active .checkout-step__label {
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

.checkout-step__line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  margin: 0 var(--space-2);
}

/* Payment Method Selection */
.payment-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: var(--space-3);
}

.payment-option.is-selected {
  border-color: var(--color-gold);
  background: var(--color-gold-bg);
}

.payment-option__icon {
  width: 40px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.payment-option__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

/* Cart drawer (template-parts/header/cart-drawer.php) item-row styling
   lives in assets/css/product.css, not here — the drawer renders on every
   page via the header, but this file only loads on the actual /cart/ page
   (see inc/enqueue.php), so rules placed here would never apply to it. */

/* ══════════════════════════════════════════════════════════════════════════
   CART PAGE (woocommerce/cart/cart.php override)
   Matches cart.html exactly.
   ══════════════════════════════════════════════════════════════════════════ */

.cart-page-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}

.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  padding: 28px 0 56px;
  align-items: start;
}

/* Stock/validation notices (wc_print_notices(), moved inside .container in
   cart.php) still need their own top spacing — same fix as checkout.
   WooCommerce wraps them in .woocommerce-notices-wrapper, a child of
   .container, present even with zero notices — :not(:empty) keeps that
   case from adding blank space. Scoped to the cart page only. */
.woocommerce-cart .container > .woocommerce-notices-wrapper:not(:empty) {
  margin-top: 24px;
}
.woocommerce-cart .container > .woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-cart .container > .woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-cart .container > .woocommerce-notices-wrapper .woocommerce-info {
  margin-bottom: 0;
}

/* Cart Items */
.cart-items-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.cart-items-card__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-items-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-charcoal);
}
.cart-items-card__clear {
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
}
.cart-items-card__clear:hover {
  color: var(--color-error);
}

/* Cart Item Row */
.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item__img,
.cart-item__img img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: block;
}
.cart-item__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 4px;
  text-decoration: none;
  display: block;
}
.cart-item__name:hover {
  color: var(--color-gold);
}
.cart-item__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.cart-item__price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-item__price-current {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-charcoal);
}
.cart-item__price-original {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.cart-item__qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.cart-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.cart-qty__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
}
.cart-qty__btn:hover {
  background: #ece8e0;
}
.cart-qty__input {
  width: 44px;
  height: 32px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--color-border);
  border-right: 1.5px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}
.cart-item__actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.cart-item__action-btn {
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: none;
}
.cart-item__action-btn:hover {
  color: var(--color-gold);
}
.cart-item__remove-btn {
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
}
.cart-item__remove-btn:hover {
  color: var(--color-error);
}
.cart-item__price-col {
  text-align: right;
  min-width: 100px;
}
.cart-item__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-charcoal);
}
.cart-item__original {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.cart-item__saving {
  font-size: 11px;
  color: var(--color-success);
  font-weight: 600;
}

/* Empty Cart */
.cart-empty {
  padding: 64px 32px;
  text-align: center;
}
.cart-empty__icon {
  margin: 0 auto 20px;
  color: #ccc;
  display: block;
}
.cart-empty__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-charcoal);
  margin-bottom: 10px;
}
.cart-empty__subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Order Summary */
.order-summary {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 90px;
}
.order-summary__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
}
.order-summary__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-charcoal);
}
.order-summary__body {
  padding: 18px 22px;
}
.order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 12px;
}
.order-summary__row--total {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-charcoal);
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-top: 6px;
  margin-bottom: 0;
}
.order-summary__discount {
  color: var(--color-success);
  font-weight: 600;
}
.order-summary__savings {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0;
  text-align: center;
}
.order-summary__free-delivery {
  margin: 10px 0 14px;
}
.order-summary__free-delivery-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.order-summary__free-delivery-note strong {
  color: var(--color-gold);
}
.order-summary__free-delivery-note--unlocked {
  color: var(--color-success);
  font-weight: 600;
}
.order-summary__free-delivery-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--color-border);
  overflow: hidden;
}
.order-summary__free-delivery-bar-fill {
  height: 100%;
  background: var(--color-gold);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.order-summary__promo {
  margin: 14px 0;
}
.order-summary__promo-row {
  display: flex;
  gap: 8px;
}
.order-summary__promo-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}
.order-summary__promo-btn {
  padding: 9px 16px;
  border: 1.5px solid var(--color-gold);
  border-radius: 6px;
  background: none;
  color: var(--color-gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.order-summary__promo-btn:hover {
  background: var(--color-gold-bg);
}
.order-summary__checkout-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  margin-top: 4px;
}
.order-summary__continue {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.order-summary__continue:hover {
  color: var(--color-gold);
}
.order-summary__trust {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px 22px;
  border-top: 1px solid var(--color-border);
}
.trust-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

/* Delivery estimate */
.delivery-estimate {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--color-text);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Saved for later */
.saved-section {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.saved-section__header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-charcoal);
}

@media (max-width: 900px) {
  .cart-page-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
}
@media (max-width: 576px) {
  .cart-item { grid-template-columns: 72px 1fr; }
  .cart-item__price-col { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
}

