/* ============================================================
   TAMY STORE — Estilos del Catálogo
   ============================================================ */

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(249,250,244,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--n200);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: var(--g800);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--g800);
  letter-spacing: -.01em;
}

.logo-slogan {
  font-size: .68rem;
  color: var(--n500);
  font-weight: 500;
  letter-spacing: .03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--white);
  border: 1.5px solid var(--n200);
  color: var(--g800);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font-body);
}

.btn-cart:hover { background: var(--n50); border-color: var(--g800); }

.btn-cart .badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(155deg, #051207 0%, #163f1d 40%, #264f2b 70%, #3e6841 100%);
  color: var(--white);
  padding: 72px 20px 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -60px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -140px; left: -40px;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: rgba(255,255,255,.02);
  pointer-events: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-sub {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--g200);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.hero-title em {
  font-style: italic;
  color: var(--g100);
}

.hero-desc {
  font-size: .925rem;
  color: rgba(255,255,255,.6);
  max-width: 480px;
  font-weight: 400;
  line-height: 1.65;
}

/* ── Filters ────────────────────────────────────────────────── */
.filters-section {
  background: rgba(249,250,244,.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--n200);
  padding: 14px 20px;
  position: sticky;
  top: 68px;
  z-index: 90;
}

.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--n400);
  pointer-events: none;
  display: flex;
}

.search-box input {
  width: 100%;
  padding: 12px 42px;
  border: 1.5px solid var(--n200);
  border-radius: var(--r-full);
  font-size: .875rem;
  font-family: var(--font-body);
  background: var(--white);
  outline: none;
  color: var(--n950);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}

.search-box input:focus {
  border-color: var(--g800);
  box-shadow: 0 0 0 3px rgba(22,63,29,.08);
}

.search-box input::placeholder { color: var(--n400); }

.btn-clear-search {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--n400);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color var(--t-fast), background var(--t-fast);
}
.btn-clear-search:hover { color: var(--n700); background: var(--n100); }

.categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.categories::-webkit-scrollbar { display: none; }

.category-btn {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: var(--r-full);
  font-size: .8rem;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1.5px solid var(--n200);
  background: var(--white);
  color: var(--n500);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  min-height: 36px;
}
.category-btn:hover  { border-color: var(--g800); color: var(--g800); background: var(--g50); }
.category-btn.active { background: var(--g800); color: var(--white); border-color: var(--g800); }

/* ── Catalog ────────────────────────────────────────────────── */
.catalog-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.catalog-header {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.products-count {
  font-size: .8rem;
  color: var(--n500);
  font-weight: 500;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── Product Card ───────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: none;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow var(--t-base), transform var(--t-base);
  animation: cardIn .35s ease both;
  box-shadow: var(--shadow-xs);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--n100);
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.product-card:hover .product-image-wrap img { transform: scale(1.06); }

.product-category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(96,94,89,.85);
  color: var(--white);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--r-full);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 9px;
  border-radius: var(--r-full);
}

.badge-agotado { background: rgba(47,49,45,.75); color: var(--white); }
.badge-oferta  { background: #ba1a1a;           color: var(--white); }

.product-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--n950);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: .75rem;
  color: var(--n500);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-prices {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  flex-wrap: wrap;
}

.price-normal {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--g800);
}

.price-rebaja {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ba1a1a;
}

.price-tachado {
  font-size: .77rem;
  color: var(--n400);
  text-decoration: line-through;
}

.product-stock-row { margin-top: 3px; }

.card-savings {
  display: inline-block;
  background: #e6f5e4;
  color: #264f2b;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* Color dots on cards */
.card-color-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.card-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--n200);
  border: 1.5px solid var(--white);
  box-shadow: 0 0 0 1px var(--n200);
  flex-shrink: 0;
}

.card-color-more {
  font-size: .6rem;
  color: var(--n400);
  font-weight: 600;
  margin-left: 2px;
}

.stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .69rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.stock-chip.disponible { background: #e6f5e4; color: #264f2b; }
.stock-chip.agotado    { background: var(--danger-light); color: var(--danger); }

.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px 14px;
  background: #f9faf4;
  color: var(--g800);
  font-weight: 600;
  font-size: .82rem;
  font-family: var(--font-body);
  border: none;
  border-top: 1px solid var(--n100);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 46px;
}

.btn-add-cart:hover:not(.disabled) { background: var(--g800); color: var(--white); }
.btn-add-cart.added                { background: var(--g800); color: var(--white); }
.btn-add-cart.disabled             { background: var(--n100); color: var(--n400); cursor: not-allowed; }

/* ── Skeleton ───────────────────────────────────────────────── */
.skeleton-card {
  border-radius: var(--r-lg);
  aspect-ratio: .8;
  background: linear-gradient(90deg, var(--n100) 25%, var(--n200) 50%, var(--n100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Product Modal ──────────────────────────────────────────── */
.modal-product {
  max-width: 1100px;
  padding: 0;
  overflow: hidden;
  position: relative;
  border-radius: var(--r-xl);
}

.modal-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--n200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--n700);
  transition: background var(--t-fast), color var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.modal-close-x:hover { background: var(--white); color: var(--n900); }

.modal-product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-product-img-wrap {
  position: relative;
  background: var(--n100);
  aspect-ratio: 1;
}

.modal-product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-agotado-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.52);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: .1em;
}

/* Gallery */
.modal-gallery {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.modal-gallery-main {
  flex: 1;
  position: relative;
  background: var(--n100);
  min-height: 0;
}

.modal-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--n200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--n700);
  transition: background var(--t-fast), color var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.modal-gallery-nav:hover { background: var(--white); color: var(--n900); }
.modal-gallery-nav.prev { left: 10px; }
.modal-gallery-nav.next { right: 10px; }

.modal-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--white);
  border-top: 1px solid var(--n100);
}

.modal-gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--n200);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}
.modal-gallery-dot.active {
  background: var(--g800);
  transform: scale(1.3);
}
.modal-gallery-dot:hover { background: var(--n400); }

.modal-product-info {
  padding: 28px 28px 24px;
  overflow-y: auto;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-cat-tag {
  display: inline-block;
  background: var(--g50);
  color: var(--g800);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--g200);
}

.modal-product-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--n900);
  line-height: 1.2;
  font-weight: 600;
}

.modal-price-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-price-new {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--g800);
}

.modal-price-old {
  font-size: .9rem;
  color: var(--n400);
  text-decoration: line-through;
}

.modal-discount-chip {
  background: var(--danger-light);
  color: var(--danger);
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--danger-border);
}

.modal-stock-info { }

.modal-desc {
  font-size: .875rem;
  color: var(--n500);
  line-height: 1.7;
}

/* Qty discount table */
.qty-discount-table {
  background: var(--n50);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--n200);
}

.qty-discount-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--n700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-discount-rows { display: flex; flex-direction: column; gap: 5px; }

.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--n500);
  padding: 7px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}

.qty-row span   { flex: 1; }
.qty-row strong { color: var(--g700); font-weight: 700; }
.qty-row em     { font-style: normal; color: var(--n700); font-weight: 600; }

.qty-row.active {
  background: var(--g800);
  color: rgba(255,255,255,.9);
}
.qty-row.active strong,
.qty-row.active em { color: var(--white); }

/* Qty selector */
.modal-qty-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--n200);
}

.modal-qty-ctrl { display: flex; align-items: center; gap: 12px; }

.modal-qty-total { font-size: .85rem; color: var(--n500); }
.modal-qty-total strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--g800);
  margin-left: 6px;
}

.btn-add-cart-modal {
  width: 100%;
  padding: 14px;
  background: var(--g800);
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
}
.btn-add-cart-modal:hover { background: var(--g700); }

/* ── Cart Drawer ────────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  z-index: var(--z-drawer);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--white);
  z-index: calc(var(--z-drawer) + 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.12);
  transform: translateX(100%);
  transition: transform var(--t-slow);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--n200);
  flex-shrink: 0;
}

.cart-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--n900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-header h2 svg { color: var(--g800); }

.btn-close-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--n500);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-close-cart:hover { background: var(--n100); color: var(--n900); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--n100);
  animation: fadeIn .2s ease;
}

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

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--n100);
  flex-shrink: 0;
  border: 1px solid var(--n200);
}

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

.cart-item-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--n900);
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-color {
  font-weight: 400;
  color: var(--n500);
  font-size: .78rem;
}

.cart-item-price {
  font-size: .9rem;
  color: var(--g800);
  font-weight: 700;
  margin-bottom: 2px;
}

.cart-item-unit {
  font-size: .7rem;
  font-weight: 400;
  color: var(--n500);
  margin-left: 4px;
}

.cart-discount-label {
  display: inline-block;
  background: var(--danger-light);
  color: var(--danger);
  font-size: .67rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-full);
  margin-bottom: 5px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--n200);
  background: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--n700);
  font-family: var(--font-body);
}
.qty-btn:hover   { border-color: var(--g800); color: var(--g800); }
.qty-btn:disabled{ opacity: .35; cursor: not-allowed; }

.qty-value {
  font-weight: 700;
  font-size: .9rem;
  min-width: 22px;
  text-align: center;
  color: var(--n900);
}

.btn-remove-item {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--n400);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.btn-remove-item:hover { color: var(--danger); background: var(--danger-light); }

/* Cart footer */
.cart-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--n200);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--n50);
  flex-shrink: 0;
}

.discount-tip-text {
  display: block;
  font-size: .75rem;
  color: var(--g700);
  font-weight: 600;
  background: var(--g50);
  border: 1px solid var(--g200);
  padding: 8px 12px;
  border-radius: var(--r-sm);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  color: var(--n700);
}
.cart-total strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--n900);
}

.btn-whatsapp {
  background: #22c55e;
  color: var(--white);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 14px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.btn-whatsapp:hover { background: #16a34a; transform: translateY(-1px); }

.btn-sm {
  padding: 9px 16px;
  font-size: .8rem;
  text-align: center;
}

/* ── Checkout Modal ─────────────────────────────────────────── */
.modal-checkout {
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
}

.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.delivery-option { cursor: pointer; }
.delivery-option input { display: none; }

.delivery-option-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 12px;
  border: 1.5px solid var(--n200);
  border-radius: var(--r-md);
  font-size: .84rem;
  font-weight: 600;
  color: var(--n500);
  transition: all var(--t-fast);
  text-align: center;
}

.delivery-option-box .opt-icon { color: var(--n400); }

.delivery-option input:checked + .delivery-option-box {
  border-color: var(--g800);
  background: var(--g50);
  color: var(--g800);
}

.delivery-option input:checked + .delivery-option-box .opt-icon { color: var(--g800); }

.delivery-option-box:hover { border-color: var(--g200); }

.checkout-summary {
  background: var(--n50);
  border-radius: var(--r-md);
  padding: 16px;
  margin-top: 8px;
  border: 1px solid var(--n200);
}

.checkout-product-list { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.checkout-product-row  { display: flex; justify-content: space-between; font-size: .84rem; color: var(--n500); }
.checkout-totals       { border-top: 1px solid var(--n200); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.checkout-total-row    { display: flex; justify-content: space-between; font-size: .875rem; color: var(--n700); }
.checkout-total-row.final {
  font-size: 1rem;
  color: var(--n900);
  padding-top: 8px;
  border-top: 1px solid var(--n200);
}
.checkout-total-row.final strong {
  font-family: var(--font-display);
  color: var(--g800);
  font-size: 1.2rem;
}

/* ── Free Shipping Bar ──────────────────────────────────────── */
.free-shipping-bar {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--n50);
  border: 1px solid var(--n200);
  text-align: center;
}
.free-shipping-text {
  font-size: .78rem;
  font-weight: 600;
  color: var(--n700);
  margin-bottom: 8px;
}
.free-shipping-track {
  height: 6px;
  background: var(--n200);
  border-radius: var(--r-full);
  overflow: hidden;
}
.free-shipping-fill {
  height: 100%;
  background: var(--g800);
  border-radius: var(--r-full);
  /* Sin `transition: width` a propósito. cartUI.render() recrea este nodo
     con innerHTML en cada cambio del carrito, así que un elemento recién
     insertado no tiene un ancho previo desde el que transicionar: la
     animación no llegaba a ejecutarse nunca (comprobado con
     `transitionrun`: 0 disparos en 3 re-renders).
     Si algún día se quiere animar de verdad, hay que actualizar el nodo
     existente en vez de reconstruirlo, y animar `transform` en lugar de
     `width` para no forzar layout en cada frame. */
}
.free-shipping-achieved {
  background: #dcfce7;
  border-color: #bbf7d0;
}
.free-shipping-achieved .free-shipping-text {
  color: #16a34a;
  margin-bottom: 0;
}


/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--n900);
  color: rgba(255,255,255,.42);
  text-align: center;
  padding: 24px 20px;
  font-size: .78rem;
}
.site-footer strong { color: rgba(255,255,255,.7); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1024px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
  .hero { padding: 40px 20px 36px; }
  .filters-section { top: 64px; }
  .modal-product-layout { grid-template-columns: 1fr; }
  .modal-product-img-wrap { max-height: 280px; aspect-ratio: auto; }
  .modal-product-info { max-height: none; padding: 20px; }
  .modal-gallery-main { min-height: 280px; }

  /* ── Ergonomía táctil y legibilidad en móvil ───────────────
     Auditoría móvil: los filtros de categoría medían 36px de alto y
     el logo 38px; el eslogan y el antetítulo del hero bajaban de
     12px. Sólo se toca el relleno y el tamaño mínimo de fuente —
     nada de esto sale de este bloque, así que el escritorio no se
     entera. */
  .category-btn {
    min-height: 44px;
    padding: 10px 18px;
  }

  .logo-slogan { font-size: .75rem; }   /* .68rem = 10.88px */
  .hero-sub { font-size: .75rem; }      /* .72rem = 11.52px */

  /* La marca sigue midiendo 38px; sólo crece la caja táctil del
     enlace, que cabe en los 68px de la cabecera.

     El eslogan a 12px, en cambio, ensancha el bloque del logo unos
     12px y a 320px eso desbordaba la cabecera: aparecía scroll
     horizontal en toda la página. Se recupera el hueco con menos
     relleno lateral y menos separación, y el logo pasa a poder
     encogerse con recorte por puntos suspensivos como red de
     seguridad por si la fuente midiera más de lo previsto. */
  .header-inner { padding: 0 16px; gap: 10px; }
  .btn-cart { padding: 0 10px; }
  .logo {
    min-height: 44px;
    min-width: 0;
    flex-shrink: 1;
  }
  .logo-text { min-width: 0; overflow: hidden; }
  .logo-name,
  .logo-slogan {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Segunda oleada de la auditoría móvil ─────────────────────
   El corte es 480px y no los 768px del bloque de arriba a
   propósito: el encargo de esta tanda fija que por encima de 480px
   nada puede moverse ni un píxel respecto a lo que ya había. Todo
   lo de aquí abajo, por tanto, sólo lo ven los teléfonos —los tres
   de la auditoría miden 320, 390 y 393. */
@media (max-width: 480px) {
  /* ── El cajón del carrito ───────────────────────────────────
     Aquí es donde el cliente confirma la compra y era la peor zona
     de la tienda a dedo: «−» y «+» medían 30px, la papelera 27 y la
     equis de cerrar 36. Los tres pasan a 44.

     Caben: el cajón mide `min(400px, 100vw)`, o sea 320px en el
     móvil más estrecho; con el relleno lateral de 14px que se fija
     más abajo quedan 292px útiles. La miniatura (64) + los dos
     huecos de 12 + la papelera (44) dejan 160px para el bloque de
     detalles, y la fila de cantidad ocupa 44 + 8 + 22 + 8 + 44 =
     126. */
  .btn-close-cart { width: 44px; height: 44px; }
  .qty-btn        { width: 44px; height: 44px; }
  .btn-remove-item {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  /* .btn-sm sólo lo lleva #btnClearCart («Vaciar carrito»), que en
     el pie del cajón medía 32.8px de alto. */
  .btn-sm { min-height: 44px; }

  /* La papelera pasó de 27 a 44px y esos 17px salían del bloque de
     detalles: a 320px el precio unitario se partía en dos líneas y
     cada artículo crecía a lo alto justo donde menos sitio hay. Se
     recuperan afinando el relleno lateral del cajón de 22 a 14px —
     mismo truco que en la cabecera en la oleada anterior. Las tres
     zonas se tocan a la vez para que sigan alineadas entre sí. */
  .cart-header,
  .cart-body,
  .cart-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* ── Textos por debajo de 12px ──────────────────────────────
     Ninguno crece la caja de la página: los chips viven dentro de
     .product-card, que es overflow:hidden, y todos son cajas de
     ajuste al contenido que parten línea si no caben. */
  .stock-chip          { font-size: .75rem; }   /* .69rem = 11.04px */
  .card-savings        { font-size: .75rem; }   /* .68rem = 10.88px */
  .product-badge       { font-size: .75rem; }   /* .67rem = 10.72px */
  .cart-item-unit      { font-size: .75rem; }   /* .70rem = 11.20px */
  .cart-discount-label { font-size: .75rem; }   /* .67rem = 10.72px */

  /* La etiqueta de categoría sobre la foto era el texto más pequeño
     de la tienda (10.24px). Sube a 12px y además se baja al pie de
     la foto: arriba comparte línea con .product-badge («Sin stock»,
     «-20%») y en una tarjeta de 133px —dos columnas a 320px— ya se
     pisaban antes de tocar nada. A 12px se solaparían del todo, y no
     se pueden reordenar sin tocar el HTML que las inyecta. Abajo a la
     izquierda no compiten con nadie. */
  .product-category-tag {
    font-size: .75rem;   /* .64rem = 10.24px */
    top: auto;
    bottom: 10px;
  }

  .modal-product {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-width: 100%;
    margin: 0;
  }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .delivery-options { grid-template-columns: 1fr 1fr; }
}

/* ── Índice de productos del pie ─────────────────────────────
   Lo sirve el servidor (backend/lib/seo.js). Existe porque el
   catálogo lo pinta el navegador y el HTML no tenía ni un enlace
   a una ficha: sin enlaces internos Google no reparte autoridad
   hacia los productos.
   Visible a propósito. Un bloque de enlaces oculto sólo para el
   robot es encubrimiento y Google lo castiga; un índice al pie es
   un patrón normal de tienda y le sirve a quien quiere ver todo. */
.indice-productos { border-top: 1px solid var(--n200); background: var(--n50); padding: 36px 0; }
.indice-inner     { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.indice-titulo    { font-size: 1rem; font-weight: 700; letter-spacing: .02em;
                    text-transform: uppercase; color: var(--n900); margin-bottom: 14px; }
.indice-lista     { list-style: none; padding: 0; margin: 0;
                    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 24px; }
.indice-lista a   { color: var(--n700); text-decoration: none; font-size: .9rem; line-height: 1.7; }
.indice-lista a:hover { color: var(--g800); text-decoration: underline; }

@media (max-width: 720px) {
  .indice-lista { grid-template-columns: 1fr 1fr; }
}
