/* ============================================================
   Gisgari Gourmet — styles.css
   Mobile-first. Warm earthy palette evoking coconut, caramel, cocoa.
   ============================================================ */

:root {
  --bg: #FAF3E7;
  --surface: #FFFFFF;
  --ink: #2B1B0E;
  --accent: #B8541A;
  --accent-dark: #7A3410;
  --muted: #8C7259;
  --leaf: #25D366;          /* WhatsApp green */
  --line: rgba(43, 27, 14, 0.12);

  /* Panama patria colors (visible only when html.patria is set, in November) */
  --pa-red:   #C8102E;
  --pa-blue:  #0B2F62;
  --patria-bar-h: 46px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 40px;
  --s-6: 64px;
  --s-7: 96px;

  --display: "Playfair Display", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --header-h: 72px;
  --radius: 8px;
  --shadow-sm: 0 2px 8px rgba(43, 27, 14, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 27, 14, 0.10);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-dark); }
ul { padding-left: 1.2em; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.center { text-align: center; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--ink); margin: 0 0 var(--s-3); line-height: 1.2; }
h1 { font-size: clamp(2.25rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 var(--s-3); }

.eyebrow {
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-3);
}

.section-title { margin-bottom: var(--s-3); }
.section-sub { color: var(--muted); max-width: 640px; margin: 0 auto var(--s-5); }
.lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(250, 243, 231, 0);
  backdrop-filter: blur(0);
  transition: background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), box-shadow 0.3s var(--ease);
  z-index: 100;
}
.site-header.scrolled {
  background: rgba(250, 243, 231, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand { display: flex; align-items: center; color: var(--ink); }
.brand-logo {
  height: 52px;
  width: 52px;
  border-radius: 50%;
  display: block;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header:not(.scrolled) .brand-logo {
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.brand:hover .brand-logo { transform: scale(1.06); }

.nav { display: none; gap: var(--s-5); }
.nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--s-2) 0;
  position: relative;
}
.site-header:not(.scrolled) .nav a { color: var(--surface); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--s-3); }

.lang-toggle {
  background: transparent;
  border: 1.5px solid currentColor;
  color: var(--ink);
  font: 600 0.8rem/1 var(--body);
  letter-spacing: 0.1em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.site-header:not(.scrolled) .lang-toggle { color: var(--surface); }
.lang-toggle:hover { background: var(--accent); color: var(--surface); border-color: var(--accent); }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 28px; height: 22px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.site-header:not(.scrolled) .hamburger span { background: var(--surface); }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu open state */
.nav.open {
  display: flex;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  flex-direction: column;
  gap: 0;
  padding: var(--s-4) 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.nav.open a { padding: var(--s-3) var(--s-4); color: var(--ink) !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--surface);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('../img/hero/rack-dulces-variado-1.jpg');
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  to { transform: scale(1.15); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(43,27,14,0.5) 0%, rgba(43,27,14,0.65) 60%, rgba(43,27,14,0.85) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--s-7) var(--s-4);
  max-width: 900px;
}
.hero-eyebrow {
  font-family: var(--body);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin: 0 0 var(--s-3);
}
.hero-title {
  color: var(--surface);
  margin: 0 0 var(--s-4);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: rgba(255,255,255,0.92);
  margin: 0 0 var(--s-5);
}
.hero-scroll {
  position: absolute;
  bottom: var(--s-4);
  left: 50%; transform: translateX(-50%);
  z-index: 2;
}
.hero-scroll span {
  display: block;
  width: 20px; height: 32px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  position: relative;
}
.hero-scroll span::after {
  content: "";
  position: absolute;
  left: 50%; top: 6px;
  width: 4px; height: 8px;
  border-radius: 2px;
  background: rgba(255,255,255,0.9);
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%   { opacity: 1; top: 6px; }
  100% { opacity: 0; top: 18px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
  border: 0;
}
.btn-primary {
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 4px 14px rgba(184, 84, 26, 0.4);
}
.btn-primary:hover { background: var(--accent-dark); color: var(--surface); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(184, 84, 26, 0.5); }
.btn-whatsapp {
  background: var(--leaf);
  color: var(--surface);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:hover { background: #1FBA5A; color: var(--surface); transform: translateY(-2px); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.link-arrow:hover { gap: 10px; }

/* ---------- Sections ---------- */
section { padding: var(--s-6) 0; }
@media (min-width: 960px) { section { padding: var(--s-7) 0; } }

.intro-grid, .about-grid {
  display: grid;
  gap: var(--s-5);
  align-items: center;
}
.intro-image img, .about-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.bullets { list-style: none; padding: 0; margin: 0; }
.bullets li {
  position: relative;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}
.bullets li:last-child { border-bottom: 0; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 18px;
  width: 18px; height: 2px;
  background: var(--accent);
}

/* ---------- Products grid ---------- */
.products { background: var(--surface); }
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
.card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card:hover .card-img img { transform: scale(1.05); }
.card h3 { margin: var(--s-3) var(--s-4) var(--s-2); font-size: 1.2rem; }
.card p { margin: 0 var(--s-4) var(--s-4); color: var(--muted); font-size: 0.9rem; }

/* ---------- Novedades (weekly updates strip) ---------- */
.novedades { background: var(--bg); position: relative; }
.novedades-strip {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  padding: var(--s-3) var(--s-4) var(--s-4);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}
.novedades-strip::-webkit-scrollbar { height: 6px; }
.novedades-strip::-webkit-scrollbar-track { background: var(--bg); border-radius: 3px; }
.novedades-strip::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.novedad-card {
  flex: 0 0 240px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.novedad-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.novedad-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}
.novedad-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.novedad-card:hover .novedad-img img { transform: scale(1.06); }
.novedad-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: var(--surface);
  font: 700 0.65rem/1 var(--body);
  letter-spacing: 0.14em;
  padding: 5px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.novedad-body { padding: var(--s-3) var(--s-3) var(--s-3); }
.novedad-title {
  font: 600 0.95rem/1.3 var(--body);
  color: var(--ink);
  margin: 0 0 var(--s-1);
}
.novedad-date {
  font: 500 0.75rem/1 var(--body);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.novedades-empty {
  padding: var(--s-4) var(--s-4) var(--s-5);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
@media (min-width: 960px) {
  .novedades-strip {
    padding-left: max(var(--s-4), calc((100vw - 1200px + var(--s-4) * 2) / 2));
    padding-right: max(var(--s-4), calc((100vw - 1200px + var(--s-4) * 2) / 2));
  }
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.gallery-grid figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4/3;
}
.gallery-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gallery-grid figure:hover img { transform: scale(1.08); }

/* ---------- Contact ---------- */
.contact { background: var(--surface); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.contact-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  border: 1px solid var(--line);
}
.contact-icon { font-size: 1.75rem; margin-bottom: var(--s-2); }
.contact-card h3 { margin-bottom: var(--s-2); font-size: 1.05rem; }
.contact-card p { margin: 0; color: var(--muted); }
.contact-card a { color: var(--ink); font-weight: 500; }
.contact-card a:hover { color: var(--accent); }

.contact-cta { text-align: center; }

/* ---------- Footer (minimalista en una línea) ---------- */
.site-footer {
  background: #1a0f06;
  color: rgba(255,255,255,0.85);
  padding: var(--s-4) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-logo {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}
.footer-copy {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.footer-social {
  display: flex;
  gap: 10px;
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--surface);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.social-icon:hover { background: var(--accent); color: var(--surface); transform: translateY(-3px); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Mes de la Patria (noviembre) — toggled by html.patria class
   See <head> inline script in index.html for activation.
   ============================================================ */

/* Everything patria is hidden by default */
.patria-bar,
.patria-cockade,
.patria-divider,
.patria-scatter { display: none; }

/* ----- Announcement bar ----- */
html.patria .patria-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
  height: var(--patria-bar-h);
  background: var(--pa-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: 0 var(--s-4);
  text-align: center;
  border-bottom: 3px solid var(--pa-red);
  font-size: 0.85rem;
  line-height: 1.2;
}
html.patria .patria-bar strong { font-weight: 700; letter-spacing: 0.08em; }
html.patria .patria-bar-text { max-width: 100%; }

/* Shift fixed header + body padding to make room for the bar */
html.patria body { padding-top: var(--patria-bar-h); }
html.patria .site-header { top: var(--patria-bar-h); }
html.patria .nav.open { top: calc(var(--header-h) + var(--patria-bar-h)); }

/* Waving flag SVG on each side of the bar */
html.patria .patria-wave {
  display: inline-block;
  width: 42px; height: 24px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 32'><defs><clipPath id='w'><path d='M 0 3 Q 15 -1 30 3 T 60 3 L 60 27 Q 45 31 30 27 T 0 27 Z'/></clipPath></defs><g clip-path='url(%23w)'><rect x='0' y='3' width='30' height='12' fill='%23fff'/><rect x='30' y='3' width='30' height='12' fill='%23D21034'/><rect x='0' y='15' width='30' height='12' fill='%23005AA7'/><rect x='30' y='15' width='30' height='12' fill='%23fff'/><polygon transform='translate(15 9) scale(0.065)' fill='%23005AA7' points='0,-75 18,-24 71,-23 29,9 44,61 0,30 -44,61 -29,9 -71,-23 -18,-24'/><polygon transform='translate(45 21) scale(0.065)' fill='%23D21034' points='0,-75 18,-24 71,-23 29,9 44,61 0,30 -44,61 -29,9 -71,-23 -18,-24'/></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: paWave 2.6s ease-in-out infinite;
  transform-origin: left center;
}
@keyframes paWave {
  0%, 100% { transform: skewY(0deg)  scaleX(1)    rotate(0deg); }
  25%      { transform: skewY(3deg)  scaleX(0.97) rotate(-1deg); }
  50%      { transform: skewY(0deg)  scaleX(0.95) rotate(0deg); }
  75%      { transform: skewY(-3deg) scaleX(0.97) rotate(1deg); }
}

/* ----- Mini flag cockade next to brand logo ----- */
html.patria .patria-cockade {
  display: inline-block;
  width: 21px; height: 14px;
  margin-left: 10px;
  vertical-align: middle;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400'><rect width='300' height='200' fill='%23fff'/><rect x='300' width='300' height='200' fill='%23D21034'/><rect y='200' width='300' height='200' fill='%23005AA7'/><rect x='300' y='200' width='300' height='200' fill='%23fff'/><polygon transform='translate(150 100)' fill='%23005AA7' points='0,-75 18,-24 71,-23 29,9 44,61 0,30 -44,61 -29,9 -71,-23 -18,-24'/><polygon transform='translate(450 300)' fill='%23D21034' points='0,-75 18,-24 71,-23 29,9 44,61 0,30 -44,61 -29,9 -71,-23 -18,-24'/></svg>");
  background-size: cover;
  background-repeat: no-repeat;
  border: 0.5px solid rgba(0,0,0,0.15);
  border-radius: 1px;
}

/* ----- Tricolor divider under hero ----- */
html.patria .patria-divider {
  display: block;
  height: 6px;
  background: linear-gradient(to right,
    var(--pa-blue) 0 33%, #fff 33% 66%, var(--pa-red) 66% 100%);
}

/* ----- Flag underline under Novedades eyebrow ----- */
html.patria #novedades .eyebrow::after {
  content: "";
  display: block;
  margin: 8px auto 0;
  width: 48px; height: 3px;
  background: linear-gradient(to right,
    var(--pa-blue) 0 33%, #fff 33% 66%, var(--pa-red) 66% 100%);
  border-radius: 2px;
}

/* ----- Scatter of stars + confetti in Novedades section ----- */
html.patria .patria-scatter {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.patria-star {
  position: absolute;
  display: block;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  pointer-events: none;
}
.patria-sq {
  position: absolute;
  border-radius: 2px;
  pointer-events: none;
}
html.patria #novedades .container,
html.patria #novedades .novedades-strip { position: relative; z-index: 1; }

/* ----- Patria badge in Novedades cards (set by novedades.js) ----- */
.novedad-badge.patria {
  background: var(--pa-red);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pa-blue);
}

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

@media (min-width: 960px) {
  .nav { display: flex; }
  .hamburger { display: none; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid  { grid-template-columns: repeat(3, 1fr); }
  .intro-grid    { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .about-grid    { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
}

@media (min-width: 1280px) {
  .container { padding: 0 var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
