/* Loaded AFTER each page's inline <style>, so these responsive rules win over the
   inline desktop grids (about, cart, contact, brands). */
.cart-page-items-col, .cart-page-summary-col, .values-grid > *, .contact-grid > * { min-width: 0; }

@media (max-width: 1024px) {
  .cart-page-grid, .contact-grid { grid-template-columns: 1fr; }
  .order-summary-card { position: static; width: 100%; }
}

@media (max-width: 900px) {
  .values-grid { grid-template-columns: 1fr; gap: 1rem; margin: 2.5rem 0; }
  .value-card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 768px) {
  /* Cart: stacked product row, qty + total side by side, summary full width */
  .cart-table-header { display: none; }
  .cart-table-row { grid-template-columns: 1fr auto; gap: 0.9rem 1rem; padding: 1.25rem 0; }
  .cart-row-product { grid-column: 1 / -1; gap: 1rem; align-items: flex-start; }
  .cart-row-qty { justify-self: start; }
  .cart-row-total { text-align: right; justify-self: end; }
  .cart-page-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .cart-page-actions .btn { width: 100%; }
  .order-summary-card { padding: 1.25rem; }
  .summary-line { gap: 0.75rem; }
  .summary-line > span:first-child { min-width: 0; }

  /* Brands */
  .brand-hero-row { grid-template-columns: auto 1fr; gap: 1rem; margin-bottom: 1.5rem; }
  .brand-hero-row > :last-child { grid-column: 1 / -1; }
  .brand-hero-row > :last-child .btn { width: 100%; }
}

/* ---- Cart drawer on phones: use the real visible height (address bar aware) ---- */
@media (max-width: 768px) {
  /* pin to top AND bottom of the visible screen (no height math, so no strip of page below) */
  .cart-drawer { top: 0; bottom: 0; height: auto; max-width: 100%; overscroll-behavior: contain; }
  .cart-drawer-overlay { touch-action: none; }
  .cart-drawer-items-list { min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .cart-drawer-footer { padding-top: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .cart-totals-summary { margin-bottom: 0.9rem; }
  /* toast must never cover drawer buttons: show it at the top instead */
  .amico-toast { bottom: auto; top: calc(0.75rem + env(safe-area-inset-top, 0px)); left: 1rem; right: 1rem; }
}

/* ---- Cart page quantity control: proper tappable +/- buttons ---- */
.cart-row-qty .quantity-control {
  display: inline-flex; align-items: center;
  border: 1px solid var(--color-border-light); border-radius: var(--border-radius);
}
.cart-row-qty .quantity-control button {
  width: 40px; height: 40px; background: none; border: 0; color: var(--text-primary);
  font-size: 1.1rem; cursor: pointer; touch-action: manipulation;
}
.cart-row-qty .quantity-control span { min-width: 32px; text-align: center; font-weight: 600; }
