/* MASTER QUALITY — catalogo. Blanco y negro, mobile-first. */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --gray-050: #fafafa;
  --gray-100: #f4f4f4;
  --gray-200: #e6e6e6;
  --gray-400: #bdbdbd;
  --gray-600: #7a7a7a;
  --border: #e8e8e8;
  --header-h: 58px;
  --subnav-h: 46px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

/* fade-in on load, subtle.
   Solo opacity (sin transform): animar transform en <body> mientras contiene
   un .site-header con position:sticky provoca un bug de renderizado en
   Safari/WebKit (fantasma/duplicado visual cerca de los bordes). */
body { animation: pageIn 0.35s var(--ease); }
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-row a {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand-row img.logo {
  height: 30px;
  width: auto;
  display: block;
}

.subnav {
  display: flex;
  height: var(--subnav-h);
  border-top: 1px solid var(--border);
}

.subnav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-600);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
}

.subnav a:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--border);
}

.subnav a.active,
.subnav a:hover {
  color: var(--fg);
  background: var(--gray-050);
}

/* ---------- Utility bar: back + breadcrumbs ---------- */
.util-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 4px;
  max-width: 1200px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--fg);
  padding: 6px 10px 6px 6px;
  margin-left: -6px;
  border-radius: 999px;
  transition: background 0.2s var(--ease);
  white-space: nowrap;
}
.back-link:hover { background: var(--gray-100); }
.back-link svg { width: 16px; height: 16px; }

.breadcrumbs {
  font-size: 11px;
  color: var(--gray-600);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs a { color: var(--gray-600); transition: color 0.2s var(--ease); }
.breadcrumbs a:hover { color: var(--fg); }
.breadcrumbs .sep { margin: 0 6px; color: var(--gray-400); }
.breadcrumbs .current { color: var(--fg); font-weight: 600; }

/* ---------- Page heading ---------- */
.page-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px 22px;
  text-align: center;
}

.page-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}

.page-head .price-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--gray-600);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 4px;
}

.page-head p.sub {
  font-size: 13px;
  color: var(--gray-600);
  margin: 6px 0 0;
}

/* ---------- Brand wordmark (marcas/<marca>) ---------- */
.page-head-brand {
  padding-top: 22px;
}

.page-head-brand .eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.brand-wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.brand-rule {
  display: block;
  width: 44px;
  height: 2px;
  margin: 0 auto 12px;
  background: var(--fg);
}

.brand-logo-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.brand-logo {
  max-height: 100%;
  max-width: 220px;
  width: auto;
  object-fit: contain;
}

/* ---------- Home hero blocks ---------- */
.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  background: var(--fg);
  padding: 2px;
}

.hero-block {
  position: relative;
  height: 46vh;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: #fff;
}

.hero-block img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transform: scale(1.02);
  transition: transform 0.6s var(--ease);
}

.hero-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 85%);
  z-index: 1;
}

.hero-block:active img,
.hero-block:hover img { transform: scale(1.06); }

.hero-block .hero-label {
  position: relative;
  z-index: 2;
  padding: 28px 24px;
  width: 100%;
}

.hero-block .hero-label .eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 6px;
}

.hero-block .hero-label h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 0;
}

.home-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  text-align: center;
}

.home-intro p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-600);
  letter-spacing: 0.01em;
  margin: 0;
}

/* ---------- Grids ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 16px 48px;
}

/* Tile grid = brand/category previews, larger cards, 2-up even on mobile */
.grid.tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* Marcas index: 1 tarjeta por fila (en vez de 2) hasta el breakpoint de 3 columnas.
   Limitado a max-width para no pisar los breakpoints de 3/4 columnas en desktop. */
@media (max-width: 719px) {
  .grid.tiles.tiles-1up { grid-template-columns: 1fr; }
}

.card {
  display: block;
  position: relative;
}

.card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--gray-100);
  border-radius: 2px;
}

.tiles .card .thumb { aspect-ratio: 1 / 1.15; }

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.card:hover .thumb img,
.card:active .thumb img { transform: scale(1.045); }

.card .caption {
  padding: 8px 2px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.card .name {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
}

.card .price {
  font-size: 11.5px;
  color: var(--gray-600);
  white-space: nowrap;
}

.caption-price-only {
  justify-content: flex-end;
}

.tiles .card .caption {
  justify-content: center;
  padding-top: 10px;
}

.tiles .card .name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card .thumb.thumb-logo-only {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.card .thumb.thumb-logo-only img.tile-logo-big {
  width: auto;
  height: auto;
  max-width: 160px;
  max-height: 100%;
  object-fit: contain;
  transition: none;
}

.card:hover .thumb.thumb-logo-only img.tile-logo-big,
.card:active .thumb.thumb-logo-only img.tile-logo-big {
  transform: none;
}

.tiles .card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.18) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.tiles .card:hover .thumb::after { opacity: 1; }

.count-badge {
  font-size: 10.5px;
  color: var(--gray-600);
  margin-top: 2px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* skeleton shimmer while lazy image loads */
.thumb img[loading="lazy"] {
  background: var(--gray-100);
}

/* ---------- Bottom nav (mobile quick access) ---------- */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-600);
  transition: color 0.2s var(--ease);
}

.bottom-nav a.active { color: var(--fg); }
.bottom-nav a svg { width: 19px; height: 19px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px 20px;
  text-align: center;
  color: var(--gray-600);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-600);
  font-size: 13px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.lightbox.open { display: flex; opacity: 1; }

/* Carrete vertical estilo TikTok: 3 fotogramas apilados (anterior/actual/
   siguiente) que se arrastran y encajan con la marca dedo, en vez de un
   simple cambio de foto con botones. */
.lightbox .lb-reel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  transition: transform 0.32s var(--ease);
}
.lightbox .lb-reel.no-transition { transition: none; }
.lightbox .lb-reel:active { cursor: grabbing; }

.lightbox .lb-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox .lb-slide-prev { transform: translateY(-100%); }
.lightbox .lb-slide-current { transform: translateY(0); }
.lightbox .lb-slide-next { transform: translateY(100%); }

.lightbox .lb-slide img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  -webkit-user-drag: none;
  user-select: none;
}

.lightbox .lb-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  color: #fff;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.lightbox .lb-caption .lb-price { color: rgba(255,255,255,0.6); margin-left: 8px; }

.lightbox .lb-close {
  position: absolute;
  z-index: 3;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease);
}
.lightbox .lb-close:hover { background: rgba(255,255,255,0.2); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-close svg { width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 6px 24px 56px; }
  .grid.tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .home-hero { grid-template-columns: 1fr 1fr; }
  .hero-block { height: 52vh; }
  .grid.tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 860px) {
  .brand-row img.logo { height: 36px; }
  .subnav a { font-size: 12.5px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .page-head h1 { font-size: 32px; }
  .brand-wordmark { font-size: 44px; }
  .brand-logo-wrap { height: 84px; }
  .brand-logo { max-width: 300px; }
  .bottom-nav { display: none; }
}

@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .grid.tiles { grid-template-columns: repeat(4, 1fr); }
}

@media (hover: hover) {
  .card { cursor: pointer; }
}
