/* ==========================================================================
   UltraCare — División Alimentos — styles.css
   ========================================================================== */

:root{
  --bg: #14100c;
  --bg-alt: #1b1712;
  --bg-alt2: #201a14;
  --ink: #f4ede1;
  --muted: #b8ab99;
  --muted-2: #8a7d6d;

  --green: #7fa640;
  --green-dark: #5c7a2c;
  --orange: #e0812c;
  --red: #c23b2d;
  --blue: #3d7fac;
  --cream: #efe6d6;

  --wa: #25d366;
  --wa-dark: #1ea952;

  --font-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --container: 1180px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }
h1,h2,h3{ font-family: var(--font-display); line-height: 1.05; margin: 0 0 .5em; letter-spacing: .01em; }
p{ margin: 0 0 1em; text-align: justify; text-align-last: left; }
.container{ width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* subtle grain overlay for premium texture */
.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 2000;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================== BUTTONS ============================== */
.btn{
  display: inline-flex; align-items: center; gap: .55em;
  padding: .9em 1.5em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), background .25s ease, border-color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ background: var(--cream); color: #17130f; }
.btn-primary:hover{ background: #fff; box-shadow: 0 10px 24px rgba(239,230,214,.18); }
.btn-ghost{ border-color: rgba(244,237,225,.35); color: var(--ink); }
.btn-ghost:hover{ border-color: var(--ink); background: rgba(244,237,225,.06); }
.btn-whatsapp{ background: var(--wa); color: #08210f; }
.btn-whatsapp:hover{ background: #2fe273; box-shadow: 0 10px 26px rgba(37,211,102,.28); }
.btn-lg{ padding: 1.05em 2em; font-size: 1.05rem; }
.btn-sm{ padding: .6em 1.15em; font-size: .85rem; }
.btn-block{ width: 100%; justify-content: center; }

/* ============================== HEADER ============================== */
.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  padding: 18px 0;
  transition: padding .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled{
  padding: 10px 0;
  background: rgba(20,16,12,.86);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(244,237,225,.08);
}
.site-header .container{ display:flex; align-items:center; justify-content: space-between; gap: 20px; }
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{ flex-shrink: 0; }
.brand-mark img{ display:block; width: 92px; height: 92px; object-fit: contain; }
.footer-brand .brand-mark img{ width: 64px; height: 64px; }
.brand-word{ display:flex; flex-direction:column; line-height:1.15; }
.brand-word strong{ font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.brand-word span{ font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.main-nav{ display:flex; align-items:center; gap: 28px; }
.main-nav a{ font-size: .92rem; font-weight: 600; color: var(--muted); transition: color .2s ease; position: relative; }
.main-nav a:hover{ color: var(--ink); }
.main-nav a::after{
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--red), var(--blue));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.main-nav a:hover::after{ transform: scaleX(1); }

.header-actions{ display:flex; align-items:center; gap: 12px; }
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(244,237,225,.06); border: 1px solid rgba(244,237,225,.14);
  color: var(--ink); transition: background .2s ease, transform .2s ease;
}
.icon-btn:hover{ background: var(--wa); color:#08210f; transform: translateY(-2px); }

.nav-toggle{
  display:none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(244,237,225,.16); background: transparent;
  position: relative; cursor: pointer; color: var(--ink);
  align-items:center; justify-content:center;
}
.nav-toggle-icon{
  position: absolute; width: 18px; height: 18px;
  transition: opacity .25s ease, transform .25s ease;
}
.nav-toggle .icon-close{ opacity: 0; transform: scale(.6) rotate(-45deg); }
.nav-toggle[aria-expanded="true"] .icon-menu{ opacity: 0; transform: scale(.6) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .icon-close{ opacity: 1; transform: scale(1) rotate(0deg); }

/* ============================== MOBILE DRAWER ============================== */
.mobile-drawer{
  position: fixed; inset: 0; z-index: 950;
  background: rgba(14,11,8,.98);
  display:flex; flex-direction:column; justify-content:center; gap: 36px;
  padding: 32px;
  transform: translateY(-100%);
  transition: transform .4s var(--ease);
}
.mobile-drawer.is-open{ transform: translateY(0); }
.mobile-drawer nav{ display:flex; flex-direction:column; gap: 18px; }
.mobile-drawer nav a{ font-family: var(--font-display); font-size: 1.7rem; }
.drawer-actions{ display:flex; flex-direction:column; gap: 12px; }

/* ============================== HERO ============================== */
.hero{
  position: relative;
  min-height: 100svh;
  display:flex; flex-direction:column; justify-content:center;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero-bg{
  position:absolute; inset: -10%;
  background:
    radial-gradient(48% 55% at 82% 18%, rgba(127,166,64,.20), transparent 60%),
    radial-gradient(42% 46% at 8% 82%, rgba(194,59,45,.18), transparent 60%),
    radial-gradient(38% 42% at 92% 88%, rgba(61,127,172,.15), transparent 60%),
    linear-gradient(180deg, #171310, #100d0a 70%);
  z-index: -1;
}
.hero-inner{ display:grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items:center; }
.eyebrow{
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700;
  color: var(--green); margin-bottom: .9em;
}
.hero h1{ font-size: clamp(2.5rem, 5.4vw, 4.4rem); color: var(--ink); }
.hero h1 em{ font-style: normal; background: linear-gradient(90deg, var(--green), var(--orange) 40%, var(--red) 70%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub{ font-size: 1.08rem; color: var(--muted); max-width: 46ch; }
.hero-tags{ display:flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 30px; }
.hero-tags span{
  padding: .5em 1em; border-radius: 999px; font-size: .8rem; font-weight: 600;
  border: 1px solid rgba(244,237,225,.18); color: var(--muted);
}
.hero-actions{ display:flex; flex-wrap: wrap; gap: 14px; }

.hero-visual{ position: relative; display:flex; align-items:center; justify-content:center; min-height: 380px; }
.hero-logo{
  width: min(92%, 460px); height: auto;
  opacity: .45; filter: saturate(1.15) drop-shadow(0 30px 60px rgba(0,0,0,.5));
  animation: heroLogoSpin 70s linear infinite;
}
@keyframes heroLogoSpin{ from{ transform: rotate(0deg) } to{ transform: rotate(360deg) } }

.hero-scroll{
  position:absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display:flex; align-items:center; gap: 8px; font-size: .72rem; letter-spacing:.14em; text-transform:uppercase; color: var(--muted-2);
}
.hero-scroll span{ width: 1px; height: 26px; background: linear-gradient(180deg, var(--muted-2), transparent); animation: scrollLine 1.8s ease-in-out infinite; }
@keyframes scrollLine{ 0%,100%{ opacity:.2 } 50%{ opacity:1 } }

/* ============================== SECTIONS ============================== */
.section{ padding: 100px 0; }
.section-alt{ background: var(--bg-alt); }
.section-head{ max-width: 640px; margin-bottom: 52px; }
.section-head h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--ink); }
.section-sub{ color: var(--muted); font-size: 1.02rem; margin-top: .3em; }

/* ---- nosotros ---- */
.about-grid{ display:grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items:center; }
.about-col .eyebrow{ margin-bottom: .9em; }
.about-col h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--ink); }
.about-lead{ font-size: 1.25rem; color: var(--cream); line-height: 1.6; margin: 0; }
.about-stats{ display:grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stat{ padding: 20px; border-radius: var(--radius); border: 1px solid rgba(244,237,225,.1); background: rgba(244,237,225,.03); }
.stat-num{ display:block; font-family: var(--font-display); font-size: 1.9rem; color: var(--green); }
.stat-label{ display:block; font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* ---- líneas grid ---- */
.line-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c);
}
.line-icon svg{ width: 22px; height: 22px; }

/* ---- líneas de producto: archivero de tarjetas ---- */
.lines-deck{ max-width: 560px; margin: 0 auto; display:flex; flex-direction:column; align-items:center; }
.deck-cards{ position: relative; width: 100%; height: 280px; margin: 0 0 28px; }
.deck-card{
  --c: var(--green);
  display:block; padding: 34px; border-radius: var(--radius);
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--c) 20%, var(--bg-alt2)), var(--bg-alt2) 65%);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 20px 44px color-mix(in srgb, var(--c) 22%, transparent);
}
.deck-card .line-icon{ width: 56px; height: 56px; margin-bottom: 20px; }
.deck-card .line-icon svg{ width: 26px; height: 26px; }
.deck-card h3{ font-size: 1.35rem; color: var(--ink); margin-bottom: .35em; transition: opacity .35s ease; }
.deck-card p{ font-size: 1rem; color: var(--muted); margin: 0; text-align: left; transition: opacity .35s ease; }

/* fallback stacking (no JS): plain vertical list, still fully readable */
.deck-cards:not(.is-ready) .deck-card + .deck-card{ margin-top: 14px; }

.deck-cards.is-ready .deck-card{
  position: absolute; top: 0; left: 50%; right: auto; bottom: auto;
  width: 100%; box-sizing: border-box; cursor: pointer;
  transition: transform .6s var(--ease), opacity .6s var(--ease);
}
.deck-cards.is-ready .deck-card[data-depth="0"]{ transform: translateX(-50%); opacity: 1; z-index: 4; cursor: default; }
.deck-cards.is-ready .deck-card[data-depth="1"]{ transform: translateX(-50%) translate(30px,16px) rotate(3deg) scale(.94); opacity: .85; z-index: 3; }
.deck-cards.is-ready .deck-card[data-depth="2"]{ transform: translateX(-50%) translate(-34px,30px) rotate(-4deg) scale(.9); opacity: .7; z-index: 2; }
.deck-cards.is-ready .deck-card[data-depth="hidden"]{ transform: translateX(-50%) translateY(44px) scale(.86); opacity: 0; z-index: 1; pointer-events: none; }

/* only the front card shows its title/text — behind layers stay as a color/icon hint so text never overlaps */
.deck-cards.is-ready .deck-card:not([data-depth="0"]) h3,
.deck-cards.is-ready .deck-card:not([data-depth="0"]) p{ opacity: 0; }

.deck-controls{ display:flex; align-items:center; justify-content:center; gap: 16px; }
.deck-nav{
  width: 38px; height: 38px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: transparent; color: var(--ink);
  border: 1px solid rgba(244,237,225,.18); cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.deck-nav:hover{ background: rgba(244,237,225,.08); border-color: rgba(244,237,225,.32); }
.deck-counter{ font-size: .85rem; color: var(--muted); letter-spacing: .04em; min-width: 44px; text-align: center; }

/* ---- desinfectantes ---- */
.formula-tabs{ display:flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.formula-tab{
  --c: var(--green);
  padding: .7em 1.3em; border-radius: 999px; font-weight: 700; font-size: .88rem;
  background: transparent; color: var(--muted); border: 1px solid rgba(244,237,225,.16);
  cursor: pointer; transition: all .25s ease;
}
.formula-tab.is-active, .formula-tab:hover{ color: var(--bg); background: var(--c); border-color: var(--c); }
.formula-set{ display:none; }
.formula-set.is-active{ display:block; }
/* ---- product carousel (pasarela) ---- */
.carousel-track{
  display:flex; align-items:flex-end; justify-content: flex-start;
  gap: 18px; padding: 26px 4px 20px;
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(244,237,225,.22) transparent;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
}
@media (min-width: 860px){ .carousel-track{ justify-content: center; } }
.carousel-track::-webkit-scrollbar{ height: 5px; }
.carousel-track::-webkit-scrollbar-track{ background: transparent; }
.carousel-track::-webkit-scrollbar-thumb{ background: rgba(244,237,225,.22); border-radius: 999px; }
.carousel-track::-webkit-scrollbar-thumb:hover{ background: rgba(244,237,225,.4); }
.carousel-track:focus{ outline: none; }
.carousel-slide:focus-visible{ outline: 2px solid rgba(244,237,225,.45); outline-offset: 3px; }
.carousel-slide{
  flex: 0 0 auto; width: 116px;
  padding: 14px 10px 12px; border-radius: 14px;
  background: rgba(244,237,225,.03); border: 1px solid rgba(244,237,225,.1);
  opacity: .55; filter: saturate(.7);
  transform: scale(.86) translateY(6px);
  transition: transform .7s var(--ease), opacity .7s var(--ease), filter .7s var(--ease), border-color .5s ease, box-shadow .5s ease;
  scroll-snap-align: center;
  cursor: pointer;
}
.carousel-slide img{ width: 100%; height: auto; display:block; border-radius: 8px; }
.carousel-slide.is-active{
  opacity: 1; filter: saturate(1.1);
  transform: scale(1.16) translateY(-12px);
  z-index: 2;
  box-shadow: 0 20px 44px rgba(127,166,64,.28);
  border-color: rgba(127,166,64,.5);
}
.carousel-slide:nth-child(4n+2).is-active{ box-shadow: 0 20px 44px rgba(224,129,44,.28); border-color: rgba(224,129,44,.5); }
.carousel-slide:nth-child(4n+3).is-active{ box-shadow: 0 20px 44px rgba(194,59,45,.28); border-color: rgba(194,59,45,.5); }
.carousel-slide:nth-child(4n+4).is-active{ box-shadow: 0 20px 44px rgba(61,127,172,.28); border-color: rgba(61,127,172,.5); }

.carousel-dots{ display:flex; flex-wrap: wrap; justify-content:center; gap: 8px; margin-top: 10px; }
.carousel-dot{
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(244,237,225,.22); cursor: pointer; transition: all .35s var(--ease);
}
.carousel-dot.is-active{ background: var(--green); width: 24px; border-radius: 999px; }
.formula-note{ margin-top: 18px; font-size: .82rem; color: var(--muted-2); }

/* ---- sazonadores ---- */
.flavor-footnote{ margin-top: 24px; font-size: .85rem; color: var(--muted-2); }

/* ---- granel ---- */
.granel{
  background: linear-gradient(135deg, rgba(127,166,64,.14), rgba(61,127,172,.1));
  border-top: 1px solid rgba(244,237,225,.08);
  border-bottom: 1px solid rgba(244,237,225,.08);
}
.granel-inner{ display:flex; flex-wrap: wrap; align-items:center; justify-content: space-between; gap: 28px; }
.granel h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.granel .section-sub{ max-width: 52ch; }

/* ---- contacto ---- */
.contact-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.contact-card{
  display:flex; flex-direction:column; gap: 10px;
  padding: 24px; border-radius: var(--radius);
  background: rgba(244,237,225,.03); border: 1px solid rgba(244,237,225,.09);
  transition: transform .3s var(--ease), border-color .3s ease;
}
.contact-card:hover{ transform: translateY(-4px); border-color: rgba(244,237,225,.26); }
.contact-icon{ color: var(--green); }
.contact-label{ font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.contact-value{ font-weight: 700; color: var(--ink); font-size: .98rem; word-break: break-word; }

/* ============================== FOOTER ============================== */
.site-footer{ padding: 40px 0; border-top: 1px solid rgba(244,237,225,.08); }
.footer-inner{ display:flex; flex-wrap: wrap; align-items:center; justify-content: space-between; gap: 20px; }
.footer-brand{ display:flex; align-items:center; gap: 12px; }
.footer-brand p{ margin:0; font-size: .85rem; color: var(--muted); }
.footer-nav{ display:flex; gap: 20px; }
.footer-nav a{ font-size: .88rem; color: var(--muted); }
.footer-nav a:hover{ color: var(--ink); }
.footer-note{ margin:0; font-size: .78rem; color: var(--muted-2); }

/* ============================== FLOATING WHATSAPP ============================== */
.wa-float{
  position: fixed; right: 22px; bottom: 22px; z-index: 800;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--wa); color: #08210f;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 10px 30px rgba(37,211,102,.35);
  transition: transform .3s var(--ease);
}
.wa-float:hover{ transform: scale(1.08); }
.wa-ping{
  position:absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--wa); opacity: .6;
  animation: waPing 2.2s ease-out infinite;
}
@keyframes waPing{ 0%{ transform: scale(.9); opacity:.6 } 100%{ transform: scale(1.5); opacity: 0 } }

.back-to-top{
  position: fixed; right: 22px; bottom: 94px; z-index: 800;
  width: 44px; height: 44px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: rgba(20,16,12,.85); color: var(--ink);
  border: 1px solid rgba(244,237,225,.18);
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s ease;
}
.back-to-top.is-visible{ opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover{ background: rgba(244,237,225,.12); }

/* ============================== REVEAL ANIMATION ============================== */
.reveal{ opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.d1{ transition-delay: .08s; }
.reveal.d2{ transition-delay: .16s; }
.reveal.d3{ transition-delay: .24s; }
.reveal.d4{ transition-delay: .32s; }
.reveal.is-visible{ opacity: 1; transform: none; }
/* defensive: never let a reveal element stay invisible if JS/split logic fails */
.reveal[data-split]{ opacity: 1; transform: none; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 980px){
  .main-nav{ display:none; }
  .nav-toggle{ display:flex; }
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ order: -1; max-width: 380px; }
  .about-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px){
  .section{ padding: 72px 0; }
  .hero{ padding-top: 132px; }
  .lines-deck{ max-width: none; width: 100%; }
  .deck-cards{ height: 280px; width: 84%; margin-left: auto; margin-right: auto; }
  .deck-card{ padding: 22px; }
  .deck-card h3{ font-size: 1.15rem; }
  .deck-cards.is-ready .deck-card[data-depth="1"]{ transform: translateX(-50%) translate(16px,12px) rotate(2.4deg) scale(.94); }
  .deck-cards.is-ready .deck-card[data-depth="2"]{ transform: translateX(-50%) translate(-18px,22px) rotate(-3.2deg) scale(.9); }
  .about-stats{ grid-template-columns: 1fr 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
  .granel-inner{ flex-direction: column; align-items: flex-start; }
  .wa-float{ right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .back-to-top{ right: 16px; bottom: 78px; width: 40px; height: 40px; }
}
@media (max-width: 480px){
  .site-header .container{ gap: 10px; }
  .brand{ gap: 8px; min-width: 0; }
  .brand-mark img{ width: 66px; height: 66px; }
  .brand-word{ min-width: 0; }
  .brand-word strong{ font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-word span{ display: none; }
  .header-actions{ gap: 6px; }
  .btn-sm{ padding: .5em .75em; font-size: .78rem; }
  .icon-btn{ width: 34px; height: 34px; }
  .nav-toggle{ width: 34px; height: 34px; }
}
