/* ==========================================================================
   DAZZLE BY OT — CART PAGE CSS (pages/cart.css)
   ========================================================================== */

.cart-page-main {
  padding-top: var(--space-8);
  padding-bottom: var(--space-20);
}

@media (min-width: 768px) {
  .cart-page-main {
    padding-top: var(--space-12);
  }
}

.cart-header-block {
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-4);
}

.cart-headline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--text-1);
  margin-bottom: var(--space-1);
}

.cart-subline {
  font-size: var(--text-sm);
  color: var(--text-3);
}

.cart-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .cart-grid-layout {
    grid-template-columns: 1.55fr 1fr;
    gap: var(--space-12);
    align-items: start;
  }
}

/* --------------------------------------------------------------------------
   CART TABLE & ITEMS
   -------------------------------------------------------------------------- */
.cart-table-header {
  display: none;
}

@media (min-width: 768px) {
  .cart-table-header {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr 40px;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
  }
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Mobile Default (<768px): Luxury Card Layout */
.cart-item-row {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  row-gap: 12px;
  column-gap: 12px;
  transition: max-height 300ms var(--ease), opacity 300ms var(--ease), transform 300ms var(--ease);
}

.cart-item-row.removing {
  opacity: 0;
  transform: scale(0.95);
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border-color: transparent;
}

.cart-item-info {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-right: 32px; /* Avoid overlapping delete button */
}

.cart-item-thumb {
  width: 68px;
  height: 68px;
  background-color: #161616;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-thumb img, 
.cart-item-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-brand {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cart-item-name {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.3;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.cart-item-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.cart-item-row .quantity-stepper {
  grid-column: 1 / 2;
  width: fit-content;
}

.cart-item-price {
  display: none; /* Hide unit price on mobile to prevent clutter */
}

.cart-item-total {
  grid-column: 2 / 3;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  text-align: right;
}

.cart-item-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--text-3);
  background: transparent;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.cart-item-remove:hover {
  color: var(--danger);
  background-color: rgba(139, 58, 58, 0.15);
}

/* Desktop Flat Row (>=768px) */
@media (min-width: 768px) {
  .cart-items-list {
    gap: 0;
  }

  .cart-item-row {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: var(--space-4) 0;
    border-bottom: 1px solid rgba(42, 42, 42, 0.6);
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr 40px;
    align-items: center;
  }

  .cart-item-info {
    grid-column: auto;
    padding-right: 0;
  }

  .cart-item-row .quantity-stepper {
    grid-column: auto;
  }

  .cart-item-price {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-2);
  }

  .cart-item-total {
    grid-column: auto;
    text-align: left;
    font-size: var(--text-sm);
  }

  .cart-item-remove {
    position: static;
  }
}

.cart-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.btn-clear-cart {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: underline;
  background: transparent;
  transition: color var(--transition-fast);
}

.btn-clear-cart:hover {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   ORDER SUMMARY PANEL
   -------------------------------------------------------------------------- */
.order-summary-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6);
}

@media (min-width: 768px) {
  .order-summary-card {
    padding: var(--space-8);
  }
}

.summary-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--text-2xl);
  color: var(--text-1);
  margin-bottom: var(--space-6);
}

.summary-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.summary-val {
  color: var(--text-1);
}

.shipping-calc-note {
  font-size: 12px;
  color: var(--text-3);
}

.summary-divider {
  height: 1px;
  background-color: var(--border);
  margin: var(--space-4) 0;
}

.total-row {
  font-size: var(--text-base);
  color: var(--text-1);
  font-weight: 500;
  margin-bottom: var(--space-6);
}

.total-row .total-val {
  color: var(--gold);
  font-size: var(--text-xl);
  font-weight: bold;
}

.btn-checkout {
  width: 100%;
  height: 52px;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
  letter-spacing: 0.1em;
}

.summary-trust-badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.trust-badge-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-2);
}

.trust-icon {
  color: var(--gold);
  flex-shrink: 0;
}

/* Empty State */
.cart-empty-state {
  text-align: center;
  padding: var(--space-16) 0;
  max-width: 480px;
  margin: 0 auto;
}

.empty-state-art {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-6) auto;
  opacity: 0.8;
}

.empty-state-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--text-1);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  color: var(--text-3);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}
