/* ============================================================
   HUEJOTZINGO ONEPAGE 2025–2028
   Estilos finales con compatibilidad Safari + modo oscuro
   ============================================================ */

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== VARIABLES ===== */
:root {
  --vino: #8B1E25;
  --vino-2: #A12A32;
  --dorado: #D4AF37;
  --gris: #F7F7F7;
  --texto: #333;
  --blanco: #fff;
}

/* ===== MODO OSCURO AUTOMÁTICO ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --vino: #C4494D;
    --vino-2: #E85C60;
    --dorado: #E2C76A;
    --gris: #1B1B1B;
    --texto: #EEE;
    --blanco: #111;
  }
  body { background: var(--gris); color: var(--texto); }
  .navbar { background: rgba(30,30,30,0.9); border-bottom: 1px solid rgba(255,255,255,0.08); }
  .section { background: var(--gris); color: var(--texto); }
  .valor-card, .mv-card, .eje-card, .modal-content { background: #1E1E1E; color: #EEE; }
  .footer { background: #000; color: #CCC; }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 999;
  transition: box-shadow .3s ease;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  height: 42px;
  width: auto;
  transition: transform .3s ease;
}
.nav-logo:hover { transform: scale(1.05); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--vino);
  transition: color .3s;
}
.nav-links a:hover, .nav-links a.active { color: #111; }
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--vino);
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 70px;
    right: 0;
    width: min(300px, 85vw);
    height: calc(100vh - 70px);
    background: var(--blanco);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform .35s ease;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  }
  .nav-links.open { transform: translateX(0); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  height: calc(100vh - 30px);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.55)), url('../img/hero.jpg') center/cover no-repeat;
  animation: heroZoom 20s ease-in-out infinite alternate;
  -webkit-animation: heroZoom 20s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { background-size: 100%; }
  to { background-size: 110%; }
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInHero 2.5s ease forwards;
  -webkit-animation: fadeInHero 2.5s ease forwards;
}
@keyframes fadeInHero {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  width: 300px;
  max-width: 85%;
  margin-bottom: 1.2rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInLogo 2s ease forwards;
}
@keyframes fadeInLogo {
  to { opacity: 1; transform: translateY(0); }
}
.shine-effect::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  animation: shine 6s linear infinite;
}
@keyframes shine { 0% { left: -80%; } 100% { left: 120%; } }

.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin-bottom: .5rem;
  letter-spacing: 1px;
}
.hero p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ============================================================
   BOTONES
   ============================================================ */
.cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  padding: .9rem 1.4rem;
  font-weight: 700;
  border-radius: 8px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary {
  background: var(--vino);
  color: #fff;
  box-shadow: 0 6px 14px rgba(139,30,37,.25);
}
.btn-primary:hover { background: var(--vino-2); }
.btn-ghost {
  border: 2px solid var(--dorado);
  color: var(--dorado);
}
.btn-ghost:hover { background: rgba(212,175,55,0.1); }

/* ============================================================
   SECCIONES GENERALES
   ============================================================ */
.section {
  padding: 5rem 1rem;
  background: var(--blanco);
  text-align: center;
}
.section.alt { background: var(--gris); }
.section h2 {
  font-family: 'Poppins', sans-serif;
  color: var(--vino);
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ============================================================
   SECCIÓN VALORES (ajuste Safari)
   ============================================================ */
#valores {
  position: relative;
  background-color: #f9f9f9;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  text-align: center;
  padding: 5rem 1rem;
}
#valores::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 0;
}
#valores > * { position: relative; z-index: 1; }

/* ============================================================
   EJES ESTRATÉGICOS
   ============================================================ */
.eje-card {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: all .3s ease;
  cursor: pointer;
}
.eje-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}
.eje-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
}
.eje-content { padding: 1.2rem; background: #fff; text-align: center; }

/* ============================================================
   FLIPBOOK FLOWPAPER
   ============================================================ */
.flipbook-wrapper {
  max-width: 1100px;
  margin: 3rem auto;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 2px solid rgba(139,30,37,0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  height: 90vh;
}
.fp-embed { width: 100%; height: 100%; display: block; }
@media (max-width: 768px) {
  .flipbook-wrapper { height: 75vh; }
}

/* ============================================================
   BOTÓN FLOTANTE
   ============================================================ */
#btnSubir {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background-color: var(--vino);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  cursor: pointer;
  display: none;
  z-index: 2000;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}
#btnSubir:hover {
  background-color: var(--vino-2);
  transform: translateY(-4px);
}
#btnSubir.show { display: flex; opacity: 1; animation: fadeInUp 0.4s ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

