/* ─── TOKENS ───────────────────────────────────────────────────── */
:root {
  --white:      #ffffff;
  --gold:       #f2be3a;
  --gold-pale:  #fff8e7;
  --gold-muted: #fdf3d0;
  --aqua:       #94f7f4;
  --aqua-dark:  #5de8e4;
  --brown:      #2c1a0e;
  --brown-mid:  #4a2f18;
  --cream:      #fdf8f0;
  --font-script: 'Dancing Script', cursive;
  --font-serif:  'Playfair Display', serif;
  --font-body:   'Cabin', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow:    0 8px 32px rgba(44,26,14,.12);
  --shadow-lg: 0 20px 60px rgba(44,26,14,.18);
}

/* ─── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--brown); background: var(--white); overflow-x: hidden; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ─── GRAIN TEXTURE ────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: .038;
  pointer-events: none;
  z-index: 9000;
}

/* ─── SCROLL ANIMATIONS ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(8px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
}
.reveal.delay-1 { transition-delay: .1s; }
.reveal.delay-2 { transition-delay: .2s; }
.reveal.delay-3 { transition-delay: .3s; }
.reveal.visible  { opacity: 1; transform: none; filter: blur(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ─── NAV ──────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 2rem;
  background: rgba(255,248,231,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(242,190,58,.18);
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled { background: rgba(255,248,231,.97); box-shadow: 0 2px 20px rgba(44,26,14,.08); }
.nav-brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-script); font-size: 1.45rem; font-weight: 700; color: var(--brown); }
.nav-logo   { height: 34px; width: auto; display: block; }
.nav-links  { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .6; transition: opacity .2s; }
.nav-links a:hover, .nav-links a[aria-current] { opacity: 1; }
.nav-btn {
  background: var(--gold); color: var(--brown); border: none;
  padding: .45rem 1.2rem; border-radius: 2rem;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .2s;
}
.nav-btn:hover { background: var(--aqua); transform: translateY(-1px); }
/* ─── MENU MOVIL ───────────────────────────────────────────────── */
.nav-toggle { display: none; }          /* solo aparece por debajo de 768px */
.nav-links-cta { display: none; }       /* el CTA del panel solo en movil */

@media (max-width: 768px) {
  .nav { padding: .75rem 1.25rem; }
  .nav-btn { display: none; }           /* pasa a ser un item del panel */

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px;          /* area tactil minima recomendada */
    padding: 0; border: none; background: none; cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 22px; height: 2px; margin-inline: auto;
    border-radius: 2px; background: var(--brown);
    transition: transform .3s var(--ease), opacity .2s;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* El panel cuelga de la barra, que ya es position:fixed */
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: 0 1.25rem .5rem;
    background: rgba(255,248,231,.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(242,190,58,.18);
    box-shadow: 0 12px 28px rgba(44,26,14,.10);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links li { border-top: 1px solid rgba(242,190,58,.20); }
  .nav-links a  { display: block; padding: 1rem .25rem; font-size: .85rem; opacity: .85; }
  .nav-links a:hover, .nav-links a[aria-current] { opacity: 1; }
  .nav-links-cta { display: block; }
  .nav-links-cta a { color: var(--gold); }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .nav-links, .nav-toggle span { transition: none; }
}

/* ─── SECTION HELPERS ──────────────────────────────────────────── */
.section-label  { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; opacity: .5; margin-bottom: .75rem; }
.title-script   { font-family: var(--font-script); font-size: clamp(2rem,5vw,3.5rem); font-weight: 700; line-height: 1.1; }
.section-center { text-align: center; padding: 0 1.5rem; margin-bottom: 3rem; }

/* ─── BUTTONS ──────────────────────────────────────────────────── */
.btn-aqua {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--aqua); color: var(--brown);
  border: none; padding: .5rem 1.2rem; border-radius: 2rem;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn-aqua:hover { background: var(--aqua-dark); transform: translateY(-1px); }

.btn-primary {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--gold); color: var(--brown); border: 2px solid var(--brown);
  padding: .8rem 2rem; border-radius: 2rem;
  font-size: .88rem; font-weight: 700; cursor: pointer;
  transition: all .25s var(--ease);
}
.btn-primary:hover { background: var(--brown); color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-outline {
  display: inline-flex; align-items: center; gap: .45rem;
  background: transparent; color: var(--brown); border: 2px solid var(--aqua);
  padding: .8rem 2rem; border-radius: 2rem;
  font-size: .88rem; font-weight: 700; cursor: pointer;
  transition: all .25s var(--ease);
}
.btn-outline:hover { background: var(--aqua); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(148,247,244,.35); }


/* ─── PRODUCT CARDS ────────────────────────────────────────────── */
.product-card {
  background: var(--white); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; position: relative;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.product-card.reveal:not(.visible) {
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
}

.product-img { width: 100%; height: 200px; display: block; object-fit: cover; }

.product-info  { padding: 1.2rem 1.2rem 1.4rem; }
.product-name  { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; margin-bottom: .3rem; }
.product-desc  { font-size: .835rem; line-height: 1.55; opacity: .62; margin-bottom: .8rem; }
.product-price { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--brown-mid); margin: .3rem 0 .85rem; letter-spacing: .02em; }

/* product badge */
.product-badge {
  position: absolute; top: 1rem; left: 1rem; z-index: 2;
  padding: .28rem .72rem; border-radius: 100px;
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  pointer-events: none;
}
.badge-season { background: var(--gold);  color: var(--brown); }
.badge-new    { background: var(--aqua);  color: var(--brown); }

/* featured asymmetric grid */
.featured-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 1.5rem;
  /* align-items default = stretch → hero fills full combined height of both rows */
}
.product-card--hero {
  grid-row: span 2;
  min-height: 420px;
}

/* hero: imagen a sangre total, info superpuesta al fondo */
.product-card--hero .product-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card--hero .product-info {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 1.75rem 1.5rem 1.5rem;
  background: linear-gradient(to top,
    rgba(44,26,14,.92) 0%,
    rgba(44,26,14,.6)  45%,
    transparent       100%);
}
.product-card--hero .product-name  { color: var(--white); font-size: 1.25rem; }
.product-card--hero .product-desc  { color: rgba(255,255,255,.68); margin-bottom: .9rem; }
.product-card--hero .product-price { color: var(--gold); margin-bottom: 1rem; }

.product-card--small .product-img { height: 200px; }

@media (max-width: 768px) {
  .featured-grid { grid-template-columns: 1fr; }
  .product-card--hero {
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 4/3;
  }
  /* revert hero to normal card on mobile */
  .product-card--hero .product-img {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }
  .product-card--hero .product-info {
    position: static;
    background: none;
    padding: 1.2rem 1.2rem 1.4rem;
  }
  .product-card--hero .product-name  { color: var(--brown); font-size: 1.1rem; }
  .product-card--hero .product-desc  { color: inherit; opacity: .62; }
  .product-card--hero .product-price { color: var(--brown-mid); }
  .product-card--small .product-img  { height: 200px; }
}

/* ─── FOOTER ───────────────────────────────────────────────────── */
footer {
  background: var(--brown); padding: 4.5rem 2rem 2.25rem;
  border-top: 3px solid var(--gold);
  position: relative; overflow: hidden;
}
footer::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(242,190,58,.06) 0%, transparent 60%);
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem;
  position: relative; z-index: 1;
}
.footer-logo    { height: 54px; width: auto; display: block; margin-bottom: .5rem; }
.footer-brand   { font-family: var(--font-script); font-size: 1.75rem; font-weight: 700; color: var(--gold); margin-bottom: .65rem; }
.footer-tagline { font-size: .86rem; color: rgba(255,255,255,.48); line-height: 1.65; margin-bottom: 1.5rem; }
.social-row { display: flex; gap: .65rem; }
.social-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55); cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.social-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(242,190,58,.1); }
.footer-heading { font-family: var(--font-serif); font-size: .95rem; font-weight: 700; color: var(--gold); padding-bottom: .5rem; border-bottom: 1px solid rgba(242,190,58,.2); margin-bottom: 1.2rem; }
.contact-line { display: flex; align-items: flex-start; gap: .5rem; font-size: .855rem; color: rgba(255,255,255,.58); line-height: 1.65; }
.contact-line + .contact-line { margin-top: .55rem; }
.ci { flex-shrink: 0; margin-top: 3px; color: var(--aqua); opacity: .75; }
.map-embed { border-radius: 14px; overflow: hidden; margin-bottom: .85rem; border: 2px solid rgba(148,247,244,.25); }
.map-embed iframe { display: block; width: 100%; height: 210px; border: 0; filter: grayscale(20%) contrast(1.05); }
.map-addr { font-family: var(--font-serif); font-size: .9rem; color: rgba(255,255,255,.58); line-height: 1.55; }
.map-link { font-size: .78rem; font-weight: 700; color: var(--aqua); text-decoration: underline; text-underline-offset: 3px; opacity: .8; }
.map-link:hover { opacity: 1; }
.footer-copy {
  max-width: 1080px; margin: 3rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center; font-size: .78rem; color: rgba(255,255,255,.27); font-style: italic;
  position: relative; z-index: 1;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr; gap: 2rem; } }

/* ─── UTILS ────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* ─── POP TILE ANIMATION ───────────────────────────────────────── */
@keyframes pop-tile {
  0%   { transform: scale(1)    translateY(0);    box-shadow: var(--shadow); }
  18%  { transform: scale(1.08) translateY(-7px); box-shadow: 0 28px 64px rgba(44,26,14,.28); }
  82%  { transform: scale(1.08) translateY(-7px); box-shadow: 0 28px 64px rgba(44,26,14,.28); }
  100% { transform: scale(1)    translateY(0);    box-shadow: var(--shadow); }
}
.cat-tile.popping { animation: pop-tile 2s cubic-bezier(.34,1.56,.64,1) both; }

/* ─── CATÁLOGO DE CATEGORÍA ────────────────────────────────────── */

/* Cabecera compacta de subpágina (NO 100vh) */
.cat-page-header {
  padding: 5.5rem 2rem 3rem;
  background: var(--cream);
  text-align: center;
  position: relative;
}
.cat-page-header::before {
  content: ''; position: absolute; top: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.cat-page-header-inner {
  max-width: 680px; margin: 0 auto;
}
.cat-page-header .title-script {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  margin-bottom: .75rem;
}

/* Breadcrumb: Inicio / Surtido / [Categoría] */
.breadcrumb {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  flex-wrap: wrap; margin-bottom: 1.25rem;
  font-family: var(--font-body); font-size: .75rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(44,26,14,.5);
}
.breadcrumb a { color: rgba(44,26,14,.6); transition: color .2s; }
.breadcrumb a:hover { color: var(--brown); }
.breadcrumb-sep { opacity: .35; font-weight: 400; letter-spacing: 0; }

/* Intro y volver */
.cat-intro {
  font-size: .96rem; line-height: 1.72; opacity: .64;
  max-width: 480px; margin: 0 auto 1.75rem;
}
.cat-back {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-body); font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; color: var(--brown); opacity: .52;
  transition: opacity .2s;
}
.cat-back:hover { opacity: 1; }

/* Sección del grid */
.catalog-section {
  background: var(--white);
  padding: 4rem 2rem 6rem;
}
.catalog-section-inner {
  max-width: 1200px; margin: 0 auto;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
/* Tarjetas de escaparate: efecto hover sin ser clicables */
.catalog-grid .product-card {
  cursor: default;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
  transition:
    opacity   .7s ease-out,
    filter    .7s ease-out,
    transform .7s ease-out;
}
.catalog-grid .product-card.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}
.catalog-grid .product-card.delay-1 { transition-delay: .1s; }
.catalog-grid .product-card.delay-2 { transition-delay: .2s; }
.catalog-grid .product-card.delay-3 { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .catalog-grid .product-card {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
}

/* Imágenes con contain sobre fondo claro (ecológicos) */
.product-img--contain {
  object-fit: contain;
  background: #f5efe3;
  padding: .75rem;
}

@media (max-width: 600px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 380px) {
  .catalog-grid { grid-template-columns: 1fr; }
}

/* Placeholder para productos sin foto */
.product-no-photo {
  height: 200px;
  background: linear-gradient(135deg, #f5f0e8 0%, #ede4d3 100%);
  display: flex; align-items: center; justify-content: center;
}
.product-no-photo::after {
  content: '';
  width: 48px; height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23c4a882' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .45;
}

/* Trio de precios para tartas Rafa */
.product-prices-trio {
  display: flex; gap: .4rem; margin: .3rem 0 .85rem;
}
.product-prices-trio span {
  flex: 1; text-align: center;
  background: var(--cream); border-radius: 8px;
  padding: .45rem .3rem .5rem;
  font-family: var(--font-serif);
}
.product-prices-trio em {
  display: block; font-style: normal;
  font-size: .65rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: rgba(44,26,14,.45); margin-bottom: .2rem;
}
.product-prices-trio span > :not(em) {
  font-size: .9rem; font-weight: 700; color: var(--brown-mid);
}
/* el texto de precio dentro del span va a inline, no hay wrapper — lo controlamos con font */
.product-prices-trio span { font-size: .9rem; font-weight: 700; color: var(--brown-mid); }
