/* =========================================================
   EMILETA REPOSTERÍA — stylesheet
   Tokens derived from BRANDBOOK_EMILETA (Identidad Visual)
   ========================================================= */

:root {
  /* Brand colors — exact HEX from brandbook */
  --ladrillo: #8F342D;      /* Color Ladrillo — secundario: acentos, detalles */
  --ladrillo-600: #722A24;
  --terracota: #9A543A;     /* Color Terracota — acento fino (eyebrows, énfasis) */
  --terracota-600: #7C4330;
  --vainilla: #DFD6AB;      /* Color Vainilla — neutro, fondos suaves */
  --mantequilla: #F6E58D;   /* Color Mantequilla — neutro, detalles */
  --indigo: #23446B;        /* Color Azul Índigo — PRINCIPAL de marca */
  --indigo-600: #1C3655;

  /* Semantic roles (brandbook: Azul Índigo = uso principal) */
  --color-primary: var(--indigo);
  --color-primary-600: var(--indigo-600);
  --color-secondary: var(--ladrillo);
  --color-secondary-600: var(--ladrillo-600);
  --color-accent: var(--terracota);

  /* Derived neutrals, kept in the brand's warm family */
  --cream-50: #FBF7EC;
  --cream-white: #FFFDF9;
  --ink: #2E2118;
  --muted: #7C6B57;
  --line: rgba(46, 33, 24, 0.10);

  /* Type */
  --font-display: 'Cormorant', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1180px;
  --radius-s: 10px;
  --radius-m: 20px;
  --shadow-soft: 0 20px 45px -25px rgba(46, 33, 24, 0.35);
  --shadow-card: 0 14px 30px -18px rgba(46, 33, 24, 0.28);

  --ease: cubic-bezier(.25,.8,.25,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream-white);
  -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; }
h1, h2, h3, h4, h5, dt, dd, p, blockquote, figure { margin: 0; }
button { font: inherit; cursor: pointer; }
svg { display: block; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-primary); color: var(--cream-white);
  padding: 0.8em 1.2em; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2.5px solid var(--indigo);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: 96px 0; }
.section-alt { background: var(--cream-50); }

@media (max-width: 720px) {
  .section { padding: 64px 0; }
}

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 14px;
}
.eyebrow-center { text-align: center; }

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.1;
  color: var(--color-primary);
  max-width: 34ch;
}
.section-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--color-secondary);
}
.section-title.center { max-width: 26ch; margin-inline: auto; text-align: center; }

.section-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 58ch;
  margin-top: 18px;
}
.section-text.center { margin-inline: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  transition: transform .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--color-primary); color: var(--cream-white); }
.btn-primary:hover { background: var(--color-primary-600); }

.btn-ghost { border-color: var(--color-secondary); color: var(--color-secondary); }
.btn-ghost:hover { background: var(--color-secondary); color: var(--cream-white); }

.btn-outline { border-color: var(--line); color: var(--color-primary); }
.btn-outline:hover { border-color: var(--color-primary); }

.btn-cream { background: var(--cream-white); color: var(--color-secondary); }
.btn-cream:hover { background: var(--mantequilla); }

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  background: var(--mantequilla);
  color: var(--ladrillo-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}
.tag-inverse { background: rgba(255,253,249,0.9); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled {
  border-color: var(--line);
  box-shadow: 0 8px 24px -18px rgba(46,33,24,0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; flex-shrink: 0; color: var(--color-primary); }
.brand-mark svg { width: 100%; height: auto; display: block; }
.brand-mark img { width: 100%; height: auto; display: block; }
.brand-wordmark { width: auto; height: 34px; display: block; }

.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--terracota);
  transition: right .25s var(--ease);
}
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-cta { padding: 10px 20px; font-size: 0.88rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none;
  padding: 0;
}
.nav-toggle span {
  display: block; height: 2px; width: 22px;
  background: var(--color-primary); margin-inline: auto;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.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); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--cream-50) 0%, #F3ECD9 100%);
  padding-top: 64px;
  padding-bottom: 90px;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 2rem + 2.6vw, 4.4rem);
  line-height: 1.05;
  color: var(--color-primary);
  max-width: 13ch;
}
.hero-title em {
  font-style: italic;
  color: var(--color-secondary);
  font-weight: 500;
}
.hero-text {
  margin-top: 22px;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 34px; }
.hero-hours {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 22px;
  position: relative;
}
.hero-hours::before {
  content: "";
  position: absolute; left: 0; top: 50%; translate: 0 -50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mantequilla);
  box-shadow: 0 0 0 3px rgba(246,229,141,0.4);
}

.hero-visual { position: relative; }
.arch-frame {
  overflow: hidden;
  border-radius: 50% 50% 12px 12px / 22% 22% 12px 12px;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 3 / 4;
  border: 6px solid var(--cream-white);
}
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.arch-frame-sm { aspect-ratio: 4 / 5; }

.hero-badge {
  position: absolute;
  z-index: 2;
  left: -18px;
  bottom: 34px;
  background: var(--color-secondary);
  color: var(--cream-white);
  padding: 16px 22px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 210px;
}
.hero-badge-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
}
.hero-badge-sub { font-size: 0.75rem; color: var(--vainilla); }

.hero-divider {
  position: absolute; bottom: -1px; left: 0; width: 100%; height: 44px;
}

/* ---------- Product grid ---------- */
.product-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.product-card {
  background: var(--cream-white);
  border-radius: var(--radius-m);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.product-card:hover { transform: translateY(-6px); }
.product-media {
  position: relative;
  border-radius: 50% 50% 8px 8px / 20% 20% 8px 8px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  margin-bottom: 18px;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .tag { position: absolute; left: 12px; bottom: 12px; }
.product-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-primary);
  padding-inline: 4px;
}
.product-card p {
  margin-top: 8px;
  padding-inline: 4px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.callout-band {
  margin-top: 44px;
  background: var(--color-secondary);
  background-image: radial-gradient(circle at 85% 20%, rgba(246,229,141,0.18), transparent 55%);
  color: var(--cream-white);
  border-radius: var(--radius-m);
  padding: 44px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.callout-text h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.8rem;
  margin-top: 14px;
}
.callout-text p {
  margin-top: 10px;
  color: var(--vainilla);
  max-width: 48ch;
  line-height: 1.6;
}

/* ---------- Favoritos rail ---------- */
.rail-wrap {
  position: relative;
  margin-top: 48px;
  /* Shrinks to the rail's natural width and centers it once that width
     is narrower than the viewport (large screens); on smaller screens
     the natural width still exceeds 100%, so it simply fills the
     available space and scrolls exactly as before. */
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 24px 20px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 auto;
  width: min(78vw, 300px);
  scroll-snap-align: start;
  background: var(--cream-white);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.rail-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.rail-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-primary);
  padding: 16px 18px 0;
}
.rail-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  padding: 8px 18px 18px;
}
.rail-arrow {
  position: absolute;
  top: 42%;
  translate: 0 -50%;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--cream-white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: 1.4rem;
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: background-color .2s var(--ease);
}
.rail-arrow:hover { background: var(--mantequilla); }
.rail-arrow-left { left: 4px; }
.rail-arrow-right { right: 4px; }
@media (max-width: 720px) { .rail-arrow { display: none; } }

/* ---------- Historia ---------- */
.historia-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
}
.historia-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem);
  color: var(--terracota);
  line-height: 1.5;
  margin-top: 22px;
  padding-left: 24px;
  border-left: 3px solid var(--mantequilla);
}

/* ---------- Reviews ---------- */
.review-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.review-card {
  background: var(--cream-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 30px 28px;
}
.stars { color: var(--mantequilla); letter-spacing: 3px; font-size: 1rem; filter: drop-shadow(0 1px 0 rgba(46,33,24,0.25)); }
.review-card blockquote {
  margin-top: 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink);
}
.review-card figcaption {
  margin-top: 18px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Visítanos + mapa ---------- */
.visitanos-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding-bottom: 84px;
}
.visit-details { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.visit-details dt {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--terracota);
}
.visit-details dd { margin: 4px 0 0; font-size: 1.02rem; color: var(--ink); }
.visitanos-map {
  border-radius: 50% 50% 12px 12px / 12% 12% 12px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 6px solid var(--cream-white);
}
.visitanos-map iframe { width: 100%; height: 420px; border: 0; display: block; }

.ways-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  color: var(--color-primary);
  margin-bottom: 40px;
}
.ways-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.way-card {
  background: var(--cream-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 30px 26px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.way-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.way-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--vainilla);
  color: var(--color-primary);
  margin-bottom: 18px;
}
.way-icon svg { width: 24px; height: 24px; }
.way-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-primary);
}
.way-card p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary); color: var(--cream-white); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  grid-template-areas: "brand direccion horario contacto";
  gap: 40px;
  padding-block: 72px 48px;
}
.footer-brand { grid-area: brand; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-logo { width: 168px; height: auto; }
.footer-brand p { font-size: 0.88rem; color: var(--vainilla); max-width: 30ch; line-height: 1.5; }

.footer-col-direccion { grid-area: direccion; }
.footer-col-horario { grid-area: horario; }
.footer-col-contacto { grid-area: contacto; }

.footer-col h5 {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mantequilla); margin-bottom: 14px; font-weight: 700;
}
.footer-col p { font-size: 0.9rem; color: var(--vainilla); line-height: 1.7; margin-bottom: 6px; }
.footer-col a:hover { color: var(--mantequilla); }

.footer-phone { font-size: 0.98rem; font-weight: 600; }
.footer-phone a:hover { color: var(--mantequilla); }

.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(246, 229, 141, 0.14);
  color: var(--mantequilla);
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.footer-icon svg { width: 18px; height: 18px; }
.footer-icon:hover { background: var(--mantequilla); color: var(--color-primary); transform: translateY(-2px); }

.footer-bottom { border-top: 1px solid rgba(255,253,249,0.15); }
.footer-bottom-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-block: 22px;
  font-size: 0.8rem;
  color: var(--vainilla);
}
.footer-signature { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 420px; margin-inline: auto; }
  .hero-copy { text-align: left; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .historia-inner { grid-template-columns: 1fr; }
  .historia-visual { max-width: 380px; margin-inline: auto; }
  .review-grid { grid-template-columns: 1fr; }
  .visitanos-inner { grid-template-columns: 1fr; }
  .ways-grid { grid-template-columns: 1fr; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "direccion horario"
      "contacto contacto";
    gap: 32px 28px;
    padding-block: 56px 40px;
  }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: var(--cream-white);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 20px 24px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { width: 100%; padding-block: 10px; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "direccion horario"
      "contacto contacto";
    gap: 26px 20px;
    padding-block: 40px 26px;
  }
  .footer-logo { width: 140px; }
  .callout-band { flex-direction: column; align-items: flex-start; padding: 34px 28px; }
  .hero-badge {
    position: relative;
    left: auto;
    margin-top: -30px;
    margin-inline: 18px;
  }
}
