﻿/* ═══════════════════════════════════════════════════════════
   American Scan eCommerce - Design System
   Branding: Navy #032a56 | Cyan #00d2ff | Silver #f4f7fa
═══════════════════════════════════════════════════════════ */

:root {
  --primary:        #032a56;
  --primary-light:  #0a468d;
  --primary-dark:   #021d3a;
  --accent:         #00d2ff;
  --accent-glow:    rgba(0,210,255,0.25);
  --accent-dark:    #00aacf;
  --bg:             #f0f4f9;
  --bg-card:        #ffffff;
  --text:           #1a2332;
  --text-light:     #5a6a7e;
  --text-muted:     #8fa0b0;
  --border:         #e2eaf4;
  --success:        #00c48c;
  --warning:        #ffb800;
  --danger:         #ff5252;
  --shadow-sm:      0 2px 8px rgba(3,42,86,.06);
  --shadow-md:      0 8px 24px rgba(3,42,86,.10);
  --shadow-lg:      0 20px 60px rgba(3,42,86,.15);
  --shadow-xl:      0 30px 80px rgba(3,42,86,.20);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    999px;
  --transition:     all 0.3s cubic-bezier(0.4,0,0.2,1);
  --header-h:       72px;
}

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ HEADER ════════════════════════════════════════════════ */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
}
.header-logo { flex-shrink: 0; }
.header-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: var(--transition);
}
.header-logo img:hover { opacity: .85; }

/* Search */
.header-search { flex: 1; max-width: 600px; }
.search-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: var(--radius-full);
  padding: .55rem 1.2rem;
  transition: var(--transition);
}
.search-box:focus-within {
  background: rgba(255,255,255,.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon { font-size: 1rem; opacity: .7; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: .95rem;
  outline: none;
}
.search-box input::placeholder { color: rgba(255,255,255,.5); }
.search-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.search-clear:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Header Right */
.header-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header-info { display: flex; flex-direction: column; align-items: flex-end; }
.store-name { color: #fff; font-size: .85rem; font-weight: 700; }
.store-location { color: rgba(255,255,255,.55); font-size: .75rem; }

.cart-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--radius-full);
  padding: .6rem 1.25rem;
  font-weight: 700;
  font-size: .9rem;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,210,255,.35);
}
.cart-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,210,255,.5);
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  animation: badge-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ═══ HERO ════════════════════════════════════════════════════ */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #0d5a96 100%);
  min-height: 260px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 3rem 1.5rem;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,210,255,.18) 0%, transparent 60%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 600px;
  margin: 0 auto 0 0;
  padding-left: calc((100vw - 1440px) / 2 + 1.5rem);
}
@media (max-width: 1440px) { .hero-content { padding-left: 1.5rem; } }

.hero-tag {
  display: inline-block;
  background: rgba(0,210,255,.18);
  border: 1px solid rgba(0,210,255,.35);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .9rem;
  border-radius: var(--radius-full);
  letter-spacing: .5px;
  margin-bottom: 1rem;
  animation: fade-in-up .5s ease;
}
.hero-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 1rem;
  animation: fade-in-up .5s .1s ease both;
}
.hero-highlight {
  background: linear-gradient(90deg, var(--accent), #7ef9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  color: rgba(255,255,255,.7);
  font-size: .95rem;
  margin-bottom: 1.5rem;
  animation: fade-in-up .5s .2s ease both;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  animation: fade-in-up .5s .3s ease both;
}
.hero-badge {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: var(--radius-full);
}

/* Hero visual */
.hero-visual {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.hero-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,210,255,.15), transparent 70%);
}
.hero-circle-1 { width: 400px; height: 400px; right: -80px; top: -100px; }
.hero-circle-2 { width: 280px; height: 280px; right: 80px; bottom: -80px; }
.hero-circle-3 { width: 200px; height: 200px; right: 200px; top: 20px; }
.hero-appliance-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem;
  position: relative; z-index: 1;
}
.floating-icon {
  font-size: 2.2rem;
  animation: float 3s ease-in-out infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.3));
}
@keyframes float {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ SHOP LAYOUT ════════════════════════════════════════════ */
.shop-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 2rem;
  align-items: flex-start;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.shop-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-header {
  padding: .5rem .75rem;
}
.sidebar-title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.category-nav {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  background: none;
  border: none;
  font-size: .9rem;
  color: var(--text-light);
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  text-align: left;
}
.cat-btn:hover {
  background: var(--bg);
  color: var(--primary);
  border-left-color: var(--primary-light);
}
.cat-btn.active {
  background: linear-gradient(90deg, rgba(3,42,86,.06), rgba(3,42,86,.02));
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--accent);
}
.cat-btn .cat-icon { font-size: 1.1rem; }
.cat-btn .cat-count {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .5rem;
  border-radius: var(--radius-full);
}
.cat-btn.active .cat-count {
  background: var(--primary);
  color: #fff;
}

/* Sidebar Promos */
.sidebar-promo {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.promo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: var(--shadow-sm);
}
.promo-icon { font-size: 1.3rem; }
.promo-text { display: flex; flex-direction: column; }
.promo-text strong { font-size: .83rem; color: var(--text); }
.promo-text small { font-size: .72rem; color: var(--text-muted); }

/* ─── Products Main ──────────────────────────────────────── */
.shop-main { flex: 1; min-width: 0; }
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.products-info { display: flex; align-items: baseline; gap: .75rem; }
.products-info h2 { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.products-count {
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: .2rem .7rem;
  border-radius: var(--radius-full);
}
.products-sort select {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .55rem 1rem;
  font-size: .85rem;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.products-sort select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3,42,86,.08);
}

/* ─── Product Grid ───────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* ─── Product Card ───────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  animation: card-in .4s ease both;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,210,255,.3);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-img-wrap {
  position: relative;
  background: linear-gradient(135deg, #f0f4f9, #e8eff8);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  padding: .25rem .65rem;
  border-radius: var(--radius-full);
  letter-spacing: .3px;
  z-index: 1;
}
.product-badge.accent { background: var(--accent); color: var(--primary); }
.product-badge.premium { background: linear-gradient(135deg, #b78e00, #e8b800); color: #fff; }

.product-wishlist {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 32px; height: 32px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  border: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.product-wishlist:hover { transform: scale(1.15); background: #fff; }
.product-wishlist.liked { background: #fee; }

.product-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.product-brand {
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: .3rem;
}
.product-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .6rem;
}
.stars {
  color: var(--warning);
  font-size: .8rem;
  letter-spacing: .5px;
}
.rating-value { font-size: .78rem; font-weight: 700; color: var(--text); }
.rating-count { font-size: .73rem; color: var(--text-muted); }

.product-pricing { margin-bottom: 1rem; }
.price-original {
  font-size: .78rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: .1rem;
}
.price-current {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.price-discount {
  display: inline-block;
  background: #fff0f0;
  color: var(--danger);
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: var(--radius-full);
  margin-top: .3rem;
}

.product-footer { margin-top: auto; display: flex; gap: .5rem; }
.btn-add-cart {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.btn-add-cart:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(3,42,86,.25);
}
.btn-add-cart.added {
  background: var(--success);
  animation: pulse-green .5s ease;
}
@keyframes pulse-green {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
.btn-detail {
  width: 40px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-detail:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: .5rem; color: var(--text); }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .75rem 2rem;
  font-size: .9rem;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-2px); }

/* ═══ CART DRAWER ════════════════════════════════════════════ */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(2px);
  transition: opacity .3s ease;
}
.cart-overlay.visible { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--primary);
}
.cart-title { font-size: 1.1rem; font-weight: 800; color: #fff; }
.cart-close-btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-close-btn:hover { background: rgba(255,255,255,.25); transform: rotate(90deg); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cart-item {
  display: flex;
  gap: .85rem;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: .85rem;
  border: 1px solid var(--border);
  animation: slide-in-right .25s ease;
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cart-item-img {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  object-fit: contain;
  padding: .3rem;
  flex-shrink: 0;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: .83rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .3rem;
}
.cart-item-brand {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.qty-btn {
  width: 28px; height: 28px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--primary);
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-value { font-size: .9rem; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-price {
  font-size: .9rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  align-self: flex-start;
}
.cart-item-remove:hover { color: var(--danger); background: #fff0f0; }

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: .5rem;
  color: var(--text-muted);
  padding: 3rem;
}
.cart-empty-icon { font-size: 3.5rem; opacity: .4; margin-bottom: .5rem; }
.cart-empty p { font-size: .95rem; font-weight: 600; }
.cart-empty small { font-size: .8rem; }

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.cart-summary { margin-bottom: 1rem; }
.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem 0;
  font-size: .88rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--bg);
}
.cart-row:last-child { border-bottom: none; }
.cart-row.cart-total { font-size: 1.05rem; font-weight: 900; color: var(--text); }
.free-shipping { color: var(--success); font-weight: 700; }

.btn-checkout {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .95rem;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: var(--transition);
  margin-bottom: .5rem;
  box-shadow: 0 4px 15px rgba(3,42,86,.25);
}
.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(3,42,86,.35);
}
.btn-arrow { font-size: 1.1rem; }
.btn-clear-cart {
  width: 100%;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: .6rem;
  font-size: .83rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-clear-cart:hover { border-color: var(--danger); color: var(--danger); background: #fff0f0; }

/* ═══ MODALS ══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: .9rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: rotate(90deg); }

/* ─── Product Modal ──────────────────────────────────────── */
.product-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(.94) translateY(10px);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .product-modal { transform: scale(1) translateY(0); }

.product-modal-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 400px;
}
.modal-img-side {
  background: linear-gradient(135deg, #f0f4f9, #e8eff8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.modal-img-side img {
  max-height: 300px;
  object-fit: contain;
  transition: transform .5s ease;
}
.modal-img-side img:hover { transform: scale(1.05) rotate(-1deg); }
.modal-info-side { padding: 2rem; }
.modal-brand { font-size: .75rem; font-weight: 800; color: var(--accent-dark); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .5rem; }
.modal-name { font-size: 1.4rem; font-weight: 900; color: var(--text); margin-bottom: .75rem; line-height: 1.2; }
.modal-rating { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.modal-price-wrap { margin-bottom: 1.25rem; }
.modal-price-orig { font-size: .85rem; color: var(--text-muted); text-decoration: line-through; }
.modal-price { font-size: 2rem; font-weight: 900; color: var(--primary); line-height: 1; }
.modal-discount-tag { display: inline-block; background: #fff0f0; color: var(--danger); font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: var(--radius-full); margin-top: .4rem; }
.modal-desc { font-size: .88rem; color: var(--text-light); line-height: 1.6; margin-bottom: 1.25rem; }
.modal-features { margin-bottom: 1.5rem; }
.modal-features h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin-bottom: .6rem; }
.modal-feature-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.modal-feature-list li { font-size: .85rem; color: var(--text); display: flex; align-items: flex-start; gap: .5rem; }
.modal-feature-list li::before { content: '✓'; color: var(--success); font-weight: 800; flex-shrink: 0; }
.modal-add-cart { width: 100%; padding: .85rem; font-size: 1rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border: none; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; gap: .5rem; transition: var(--transition); box-shadow: 0 4px 15px rgba(3,42,86,.2); }
.modal-add-cart:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(3,42,86,.3); }

/* ─── Checkout Modal ─────────────────────────────────────── */
.checkout-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
  transform: scale(.94) translateY(10px);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .checkout-modal { transform: scale(1) translateY(0); }

/* Checkout Steps Indicator */
.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: .5rem;
}
.step { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.step-dot.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(3,42,86,.1); }
.step-dot.done { background: var(--success); border-color: var(--success); color: #fff; }
.step span { font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.step-line { width: 60px; height: 2px; background: var(--border); margin-bottom: .9rem; border-radius: 1px; transition: var(--transition); }
.step-line.done { background: var(--success); }

/* Checkout Form */
.checkout-title { font-size: 1.3rem; font-weight: 900; color: var(--text); margin-bottom: 1.5rem; }
.checkout-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkout-form .form-group { margin-bottom: 1rem; }
.checkout-form .form-group label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-light); margin-bottom: .4rem; }
.checkout-form input,
.checkout-form select {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
}
.checkout-form input:focus,
.checkout-form select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(3,42,86,.06);
}
.btn-checkout-next {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .9rem;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: var(--transition);
  margin-top: .5rem;
  box-shadow: 0 4px 15px rgba(3,42,86,.2);
}
.btn-checkout-next:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(3,42,86,.3); }
.btn-checkout-back {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-md);
  padding: .75rem 1.5rem;
  font-size: .9rem;
  font-weight: 700;
  transition: var(--transition);
}
.btn-checkout-back:hover { background: var(--border); }
.checkout-nav-btns { display: flex; gap: 1rem; margin-top: 1rem; }
.checkout-nav-btns .btn-checkout-next { flex: 1; margin-top: 0; }

/* Payment Methods */
.payment-methods { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.payment-option input[type="radio"] { display: none; }
.payment-option-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}
.payment-option:has(input:checked) .payment-option-inner {
  background: linear-gradient(90deg, rgba(3,42,86,.06), rgba(3,42,86,.02));
  border-color: var(--primary);
}
.payment-option-inner:hover { border-color: var(--primary-light); }
.payment-icon { font-size: 1.4rem; }
.payment-info { flex: 1; }
.payment-info strong { display: block; font-size: .9rem; color: var(--text); }
.payment-info small { font-size: .77rem; color: var(--text-muted); }
.payment-check {
  width: 24px; height: 24px;
  background: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: transparent;
  transition: var(--transition);
}
.payment-option:has(input:checked) .payment-check {
  background: var(--primary);
  color: #fff;
}

/* Checkout Order Summary */
.checkout-order-summary {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: .5rem;
}
.checkout-order-summary h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin-bottom: .75rem; }
.summary-item { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; font-size: .85rem; border-bottom: 1px solid var(--border); }
.summary-item:last-child { border-bottom: none; }
.summary-item-name { color: var(--text); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-item-price { font-weight: 700; color: var(--primary); }
.order-total-line { display: flex; justify-content: space-between; align-items: center; padding-top: .75rem; margin-top: .25rem; border-top: 2px solid var(--border); font-size: 1rem; }
.order-total-line strong { font-size: 1.2rem; color: var(--primary); }

/* QR */
.qr-container { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center; }
.qr-instructions p { color: var(--text-light); font-size: .9rem; margin-bottom: .75rem; }
.qr-apps { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.qr-app-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: .3rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
}
.qr-box {
  width: 240px; height: 240px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  box-shadow: var(--shadow-md);
}
.qr-box img { border-radius: var(--radius-sm); width: 100%; height: 100%; object-fit: contain; }
.qr-loading { display: flex; flex-direction: column; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .85rem; }
.qr-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-order-info { font-size: .82rem; color: var(--text-muted); }
.qr-order-info strong { color: var(--text); }
.qr-timer-box { background: var(--bg); border-radius: var(--radius-md); padding: .75rem 2rem; }
.qr-timer-box p { font-size: .75rem; color: var(--text-muted); margin-bottom: .2rem; }
.qr-timer { font-size: 1.8rem; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; }
.qr-timer.urgent { color: var(--danger); animation: pulse .5s ease infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: .6; } }
.btn-simulate-payment {
  background: linear-gradient(135deg, var(--success), #00a878);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .85rem 2rem;
  font-size: .95rem;
  font-weight: 800;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,196,140,.3);
}
.btn-simulate-payment:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,196,140,.4); }

/* ─── Success Modal ──────────────────────────────────────── */
.success-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  transform: scale(.7);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .success-modal { transform: scale(1); }
.success-animation { margin-bottom: 1.5rem; }
.success-circle {
  width: 90px; height: 90px;
  background: linear-gradient(135deg, var(--success), #00a878);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: circle-pop .6s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 8px 30px rgba(0,196,140,.35);
}
@keyframes circle-pop {
  from { transform: scale(0) rotate(-45deg); }
  to   { transform: scale(1) rotate(0); }
}
.success-check { font-size: 2.5rem; color: #fff; }
.success-title { font-size: 1.8rem; font-weight: 900; color: var(--text); margin-bottom: .5rem; }
.success-sub { color: var(--text-muted); margin-bottom: 1.5rem; }
.success-order-info {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}
.success-order-id { font-size: 1rem; font-weight: 800; color: var(--primary); }
.success-amount { font-size: 1.5rem; font-weight: 900; color: var(--text); margin-top: .25rem; }
.success-details { margin-bottom: 1.5rem; }
.success-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 0;
  font-size: .85rem;
  border-bottom: 1px solid var(--bg);
}
.success-row:last-child { border-bottom: none; }
.success-row span { color: var(--text-muted); }
.success-row strong { color: var(--text); }
.btn-success-close {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: .9rem;
  font-size: 1rem;
  font-weight: 800;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(3,42,86,.2);
}
.btn-success-close:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(3,42,86,.3); }

/* ═══ TOAST ═══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius-md);
  padding: .85rem 1.25rem;
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
  pointer-events: all;
}
.toast.success { background: #1a4a38; border-left: 3px solid var(--success); }
.toast.error   { background: #4a1a1a; border-left: 3px solid var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ FOOTER ═════════════════════════════════════════════════ */
.shop-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.7);
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
}
.footer-logo {
  height: 40px;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}
.footer-brand p { font-size: .85rem; line-height: 1.6; }
.footer-links h4, .footer-contact h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #fff;
  margin-bottom: .75rem;
}
.footer-links a {
  display: block;
  font-size: .83rem;
  padding: .25rem 0;
  transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-contact p { font-size: .83rem; padding: .2rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ═══ RESPONSIVE ══════════════════════════════════════════════

   Breakpoints:
   > 1100px   -> desktop completo
   901-1100px -> desktop compacto
   641-900px  -> TABLET (landscape + portrait)
   <= 640px   -> MOBILE

═══════════════════════════════════════════════════════════ */

/* Desktop compacto (901-1100px) */
@media (max-width: 1100px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .shop-sidebar { width: 210px; }
}

/* TABLET (641px - 900px) */
@media (min-width: 641px) and (max-width: 900px) {
  :root { --header-h: 64px; }

  .header-inner { padding: 0 1.25rem; gap: 1rem; }
  .header-logo img { height: 38px; }
  .header-info { display: none; }
  .cart-btn { padding: .55rem 1rem; font-size: .85rem; }

  .hero-banner { min-height: 200px; padding: 2rem 1.25rem; }
  .hero-visual { display: none; }
  .hero-title { font-size: clamp(1.6rem, 4vw, 2.2rem); }
  .hero-sub { font-size: .88rem; }
  .hero-badge { font-size: .72rem; padding: .25rem .65rem; }

  .shop-layout { flex-direction: column; padding: 1rem 1.25rem; gap: 1rem; }

  /* Sidebar -> barra horizontal scrollable */
  .shop-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: .75rem;
    align-items: flex-start;
  }
  .sidebar-header { display: none; }

  .category-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .category-nav::-webkit-scrollbar { display: none; }

  .cat-btn {
    flex-shrink: 0;
    width: auto;
    padding: .65rem 1.1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: .82rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .cat-btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); padding-left: 1.25rem; }
  .cat-btn:last-child  { border-radius: 0 var(--radius-full) var(--radius-full) 0; padding-right: 1.25rem; }
  .cat-btn:hover  { background: rgba(3,42,86,.05); border-left: none; border-bottom-color: var(--primary-light); }
  .cat-btn.active { background: rgba(3,42,86,.06); border-left: none; border-bottom-color: var(--accent); }
  .cat-btn .cat-count { display: none; }

  .sidebar-promo { flex-direction: row; flex-shrink: 0; gap: .5rem; }
  .promo-card { flex-direction: column; align-items: center; text-align: center; padding: .6rem .75rem; gap: .3rem; min-width: 90px; }
  .promo-icon { font-size: 1.1rem; }
  .promo-text strong { font-size: .72rem; }
  .promo-text small  { display: none; }

  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .product-img-wrap { height: 180px; }
  .btn-add-cart { padding: .7rem; font-size: .82rem; }
  .btn-detail   { width: 42px; }

  .cart-drawer { width: min(420px, 75vw); }
  .qty-btn { width: 34px; height: 34px; font-size: 1rem; }

  .product-modal { max-width: 680px; max-height: 88vh; }
  .checkout-modal { max-width: 580px; padding: 1.5rem; max-height: 90vh; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* TABLET portrait estrecho (641-768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar-promo .promo-card:nth-child(3) { display: none; }
  .product-modal-inner { grid-template-columns: 1fr; }
  .modal-img-side { height: 200px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .checkout-form .form-row { grid-template-columns: 1fr; }
  .cart-drawer { width: min(380px, 85vw); }
}

/* MOBILE (<=640px) */
@media (max-width: 640px) {
  :root { --header-h: 60px; }

  .header-inner { padding: 0 .875rem; gap: .6rem; }
  .header-logo img { height: 34px; }
  .header-info { display: none; }
  .cart-btn { padding: .5rem .875rem; font-size: .82rem; }
  .search-box input { font-size: .88rem; }

  .hero-banner { min-height: 160px; padding: 1.5rem .875rem; }
  .hero-visual { display: none; }
  .hero-content { padding-left: 0; }
  .hero-title  { font-size: 1.6rem; }
  .hero-sub    { font-size: .82rem; margin-bottom: 1rem; }
  .hero-badges { display: none; }

  .shop-layout { flex-direction: column; padding: .875rem; gap: .875rem; }

  .shop-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: column;
    gap: .5rem;
  }
  .sidebar-header { display: none; }
  .category-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: var(--radius-full);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    background: var(--bg-card);
    border: 1px solid var(--border);
  }
  .category-nav::-webkit-scrollbar { display: none; }
  .cat-btn {
    flex-shrink: 0;
    width: auto;
    padding: .6rem .9rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: .78rem;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .cat-btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
  .cat-btn:last-child  { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
  .cat-btn:hover  { background: rgba(3,42,86,.05); border-left: none; border-bottom-color: var(--primary-light); }
  .cat-btn.active { background: rgba(3,42,86,.06); border-left: none; border-bottom-color: var(--accent); }
  .cat-btn .cat-count { display: none; }
  .sidebar-promo { display: none; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .product-img-wrap { height: 150px; }
  .product-body  { padding: .75rem; }
  .product-name  { font-size: .82rem; }
  .price-current { font-size: 1.1rem; }
  .products-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .products-info h2 { font-size: 1.1rem; }

  .cart-drawer { width: 100vw; }
  .qty-btn { width: 36px; height: 36px; }
  .btn-add-cart { padding: .65rem .5rem; font-size: .78rem; }
  .btn-detail   { width: 38px; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .product-modal { max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; }
  .product-modal-inner { grid-template-columns: 1fr; }
  .modal-img-side { height: 200px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-info-side { padding: 1.25rem; }
  .modal-name  { font-size: 1.15rem; }
  .modal-price { font-size: 1.5rem; }

  .checkout-modal { max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 1.25rem; max-height: 95vh; }
  .checkout-form .form-row { grid-template-columns: 1fr; }
  .checkout-title { font-size: 1.1rem; }
  .success-modal { padding: 2rem 1.25rem; }

  .footer-inner  { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem .875rem; }
  .footer-bottom { flex-direction: column; text-align: center; padding: 1rem .875rem; }
}

/* Touch devices: feedback tactil */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover      { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
  .btn-add-cart:hover      { transform: none; box-shadow: none; }
  .btn-checkout:hover      { transform: none; box-shadow: 0 4px 15px rgba(3,42,86,.25); }
  .btn-checkout-next:hover { transform: none; box-shadow: 0 4px 15px rgba(3,42,86,.2); }

  .product-card:active      { transform: scale(.98); opacity: .95; }
  .btn-add-cart:active      { transform: scale(.97); background: var(--primary-light); }
  .btn-checkout:active      { transform: scale(.98); }
  .btn-checkout-next:active { transform: scale(.98); }
  .cat-btn:active           { background: rgba(3,42,86,.1); }
  .cart-btn:active          { transform: scale(.97); }

  .btn-add-cart      { min-height: 44px; }
  .btn-checkout      { min-height: 50px; }
  .btn-checkout-next { min-height: 50px; }
  .qty-btn           { min-width: 40px; min-height: 40px; }
  .cat-btn           { min-height: 44px; }
}

/* Landscape muy pequeño (movil rotado) */
@media (max-height: 500px) and (max-width: 900px) {
  .hero-banner { min-height: 120px; padding: .75rem 1rem; }
  .hero-title  { font-size: 1.3rem; }
  .checkout-modal { max-height: 98vh; }
  .modal-overlay { align-items: center; padding: .5rem; }
  .product-modal { max-height: 96vh; }
}

/* =========================================================
   MOBILE/TABLET EMERGENCY FIXES - v2
   Sobreescribe reglas anteriores que causan overflow
   ========================================================= */

/* Prevenir overflow global en móvil */
html, body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Asegurar que las imágenes no rompan el layout */
img { max-width: 100%; height: auto; }

/* ─── FIXES TABLET + MOBILE (max 900px) ───────────────── */
@media (max-width: 900px) {

  /* Layout base */
  .shop-layout {
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 1rem !important;
  }

  /* Sidebar horizontal */
  .shop-sidebar {
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: .5rem !important;
  }
  .sidebar-header { display: none !important; }

  .category-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 999px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  .category-nav::-webkit-scrollbar { display: none !important; }

  .cat-btn {
    flex-shrink: 0 !important;
    width: auto !important;
    padding: .6rem 1rem !important;
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    font-size: .82rem !important;
    white-space: nowrap !important;
  }
  .cat-btn.active {
    border-left: none !important;
    border-bottom-color: var(--accent) !important;
    background: rgba(3,42,86,.06) !important;
  }
  .cat-btn:hover {
    border-left: none !important;
    border-bottom-color: var(--primary-light) !important;
  }

  /* Hero */
  .hero-visual { display: none !important; }
  .hero-banner { min-height: unset !important; padding: 1.75rem 1rem !important; }
  .hero-title  { font-size: clamp(1.4rem, 5vw, 2rem) !important; }

  /* Product grid: 2 columnas */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .75rem !important;
  }
  .product-img-wrap { height: 160px !important; }

  /* Modal: bottom-sheet, columna única */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .product-modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
  .product-modal-inner {
    display: block !important;    /* evita grid overflow */
    overflow: hidden !important;
  }
  .modal-img-side {
    height: 200px !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .modal-info-side {
    padding: 1.25rem !important;
    min-width: 0 !important;
    overflow: hidden !important;
    word-break: break-word !important;
  }
  .modal-name { font-size: 1.1rem !important; }
  .modal-price { font-size: 1.5rem !important; }
  .modal-desc { font-size: .85rem !important; }

  /* Checkout modal: bottom-sheet */
  .checkout-modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    padding: 1.25rem !important;
  }
  .checkout-form .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Cart drawer */
  .cart-drawer { width: 85vw !important; max-width: 420px !important; }

  /* Botones touch */
  .btn-add-cart { min-height: 44px !important; font-size: .82rem !important; }
  .qty-btn      { min-width: 38px !important; min-height: 38px !important; }
}

/* ─── FIXES SOLO MÓVIL (max 640px) ───────────────────── */
@media (max-width: 640px) {

  /* Header */
  .header-inner { padding: 0 .875rem !important; gap: .5rem !important; }
  .header-info  { display: none !important; }
  .cart-btn     { padding: .5rem .75rem !important; font-size: .8rem !important; }

  /* Ocultar promos */
  .sidebar-promo { display: none !important; }

  /* Cart: pantalla completa */
  .cart-drawer { width: 100vw !important; max-width: 100vw !important; }

  /* Footer */
  .footer-inner  { grid-template-columns: 1fr !important; }
  .footer-bottom { flex-direction: column !important; text-align: center !important; }

  /* Producto card más compacto */
  .product-body  { padding: .75rem !important; }
  .product-name  { font-size: .82rem !important; }
  .price-current { font-size: 1.05rem !important; }
}

/* ─── Touch: deshabilitar hover, activar :active ───── */
@media (hover: none) {
  .product-card:hover  { transform: none !important; box-shadow: var(--shadow-sm) !important; }
  .product-card:active { transform: scale(.98) !important; }
  .btn-add-cart:hover  { transform: none !important; }
  .btn-add-cart:active { transform: scale(.97) !important; }
}
