/* =========================================================
   CINCO CASAS – Static Site Stylesheet
   Fonts: Montserrat, Open Sans (Google Fonts)
   Colors: #282828 text | #967c47 accent | #0a0a0a footer
   ========================================================= */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  color: #282828;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

/* ── Layout helpers ───────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Scroll-reveal animations ─────────────────────────────── */
.fade-up,
.fade-in-left,
.fade-in-right {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up        { transform: translateY(40px); }
.fade-in-left   { transform: translateX(-50px); }
.fade-in-right  { transform: translateX(50px); }

.fade-up.visible,
.fade-in-left.visible,
.fade-in-right.visible {
  opacity: 1;
  transform: translate(0);
}

/* =========================================================
   NAVIGATION
   ========================================================= */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

#header.scrolled {
  background: rgba(10, 10, 10, 0.95);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
}

.nav-logo img {
  height: 52px;
  width: auto;
}

.nav-menu {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-menu a {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  color: #ffffff;
  text-transform: uppercase;
  transition: color 0.25s;
  cursor: pointer;
}

.nav-menu a:hover { color: #967c47; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: #ffffff;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
@media (max-width: 768px) {
  /* Header siempre con fondo oscuro en móvil → hamburguesa visible desde el primer momento */
  #header {
    background: rgba(10, 10, 10, 0.92);
  }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 1001;
  }

  /* Barras un poco más gruesas para mejor visibilidad */
  .nav-toggle span {
    height: 3px;
    width: 28px;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    z-index: 999;
    background: rgba(10,10,10,0.97);
    flex-direction: column;
    justify-content: center;
    align-items: center;      /* centra los li horizontalmente */
    gap: 32px;
    transition: right 0.35s ease;
    padding: 60px 24px;
    overflow-y: auto;
  }

  .nav-menu.open { right: 0; }

  /* Cada ítem ocupa todo el ancho del menú */
  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-menu a {
    display: block;
    font-size: 14px;
    letter-spacing: 2px;    /* reducido para evitar desbordamientos */
    color: #ffffff;
    text-align: center;
    white-space: normal;    /* permite salto de línea controlado */
    line-height: 1.4;
  }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 500px;
  background-image: url('../images/cinco-casas-web-banner-home.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* YouTube background video container */
.hero-video-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

/* Cover-fit the 16:9 iframe with pure CSS (no JS needed) */
.hero-video-bg iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Always wider than container at 16:9 */
  width: 100vw;
  height: 56.25vw;    /* 100 / 1.7778 */
  min-height: 100%;
  min-width: 177.78vh; /* 100 * 1.7778 */
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: none;
}

/* Hide video on mobile/touch (autoplay blocked; static image shows instead) */
@media (hover: none), (max-width: 767px) {
  .hero-video-bg { display: none; }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.55);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.hero-logo {
  max-width: 320px;
  width: 55vw;
}

.btn-video {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.25s, transform 0.25s;
}

.btn-video:hover { opacity: 1; transform: scale(1.06); }

.btn-video img { max-width: 220px; width: 45vw; }

@media (max-width: 480px) {
  .hero {
    background-image: url('../images/cinco-casas-web-banner-home-mobile.jpg');
  }
}

/* =========================================================
   QUIÉNES SOMOS
   ========================================================= */
.section-somos {
  padding: 80px 0;
}

.somos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.somos-text p {
  font-size: 19px;
  font-weight: 300;
  color: #282828;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .somos-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   SECTION HEADERS (shared)
   ========================================================= */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 10px;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
  /* Compensa el espacio extra que añade letter-spacing tras el último carácter */
  padding-left: 10px;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 50px;
  font-weight: 800;
  letter-spacing: 10px;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
  padding-left: 10px;
}

.section-title.big { font-size: 60px; font-weight: 900; }

.white { color: #ffffff !important; }

/* =========================================================
   NUESTRA PRODUCCIÓN
   ========================================================= */
.section-produccion {
  padding: 60px 0 80px;
}

.product-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.product-row-reverse .product-info { order: 2; }
.product-row-reverse .product-image { order: 1; }

.product-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 50px;
  font-weight: 900;
  letter-spacing: 5px;
  text-align: center;
  color: #282828;
  line-height: 1;
}

.product-variety {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 5px;
  text-align: center;
  color: #282828;
  margin-top: 4px;
}

.separador {
  display: block;
  margin: 20px auto;
  max-width: 320px;
}

.product-desc {
  font-size: 19px;
  font-weight: 300;
  color: #282828;
  text-align: justify;
  margin-top: 16px;
}

.product-image {
  text-align: center;
}

@media (max-width: 768px) {
  .product-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .product-row-reverse .product-info { order: 0; }
  .product-row-reverse .product-image { order: 0; }

  .product-name { font-size: 36px; }
  .product-variety { font-size: 22px; }
  .section-title { font-size: 36px; letter-spacing: 6px; }
  .section-subtitle { font-size: 22px; letter-spacing: 6px; }
}

/* =========================================================
   PARALLAX SECTIONS
   ========================================================= */
.section-parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* iOS / touch devices: fallback to scroll */
@media (hover: none) {
  .section-parallax { background-attachment: scroll; }
}

.parallax-content {
  padding: 140px 24px;
  text-align: center;
}

/* Cultivo Tradicional */
.section-cultivo {
  background-image: url('../images/cinco-casas-web-fondo-cultivo-tradicional.jpg');
}

/* Un Sabor Único */
.section-sabor {
  background-image: url('../images/cinco-casas-web-fondo-un-sabor-unico.jpg');
  padding: 80px 0;
}

.sabor-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
}

.sabor-text { padding: 80px 0; }

.sabor-text .section-subtitle { font-size: 50px; font-weight: 500; }
.sabor-text .section-title.big { font-size: 70px; }

.sabor-image { text-align: center; }
.sabor-image img { max-width: 420px; }

/* Tradición Familiar */
.section-tradicion {
  background-image: url('../images/cinco-casas-web-fondo-tradicion-familiar-parallax.jpg');
}

/* Mejor Fruta */
.section-fruta {
  background-image: url('../images/cinco-casas-web-fondo-seleccionamos-la-mejor-fruta.jpg');
}

.section-fruta .parallax-content {
  padding: 280px 24px 240px;
}

@media (max-width: 768px) {
  .section-sabor {
    background-image: url('../images/cinco-casas-web-fondo-un-sabor-unico.jpg');
    background-attachment: scroll;
  }
  .sabor-grid { grid-template-columns: 1fr; gap: 24px; }
  .sabor-text { padding: 40px 0 0; }
  .sabor-text .section-subtitle { font-size: 32px; }
  .sabor-text .section-title.big { font-size: 50px; }

  .section-fruta {
    background-image: url('../images/cinco-casas-web-fondo-seleccionamos-la-mejor-fruta-mobile.jpg');
    background-attachment: scroll;
  }
  .section-fruta .parallax-content { padding: 200px 24px 180px; }

  .section-cultivo,
  .section-tradicion { background-attachment: scroll; }

  .section-title.big { font-size: 40px; }
}

/* =========================================================
   CALIDAD Y RESPALDO
   ========================================================= */
.section-calidad {
  padding: 60px 0;
}

.calidad-logos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  align-items: center;
  justify-items: center;
  margin-top: 20px;
}

.calidad-logo img {
  max-width: 200px;
  transition: opacity 0.25s, transform 0.25s;
}

.calidad-logo img:hover { opacity: 0.8; transform: scale(1.05); }

.calidad-logo:nth-child(2) { transition-delay: 0.1s; }
.calidad-logo:nth-child(3) { transition-delay: 0.2s; }

@media (max-width: 600px) {
  .calidad-logos { grid-template-columns: 1fr; gap: 30px; }
}

/* =========================================================
   VIDEO BUTTON (outline)
   ========================================================= */
.btn-wrap { margin-top: 24px; }

.btn-outline {
  display: inline-block;
  font-family: 'Open Sans', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: #2d2d2d;
  background: rgba(45,45,45,0.01);
  border: 2px solid #2d2d2d;
  border-radius: 100px;
  padding: 14px 0;
  width: 300px;
  max-width: 90vw;
  text-align: center;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.btn-outline:hover {
  background: #2d2d2d;
  color: #ffffff;
}

/* =========================================================
   PRODUCCIÓN E INSTALACIONES
   ========================================================= */
.section-instalaciones {
  padding: 60px 0 80px;
}

.instalaciones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 20px;
}

.instalacion-item {
  text-align: center;
}

.instalacion-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 20px;
}

.instalacion-item h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #282828;
}

.inst-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 5px;
  color: #282828;
  margin-top: 2px;
  margin-bottom: 16px;
}

.inst-desc {
  font-size: 19px;
  font-weight: 300;
  color: #282828;
}

@media (max-width: 900px) {
  .instalaciones-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer-dark {
  background: #ffffff;
  padding: 60px 0;
  text-align: center;
  border-top: 1px solid #e8e8e8;
}

.footer-logo img {
  max-width: 220px;
  margin: 0 auto 28px;
}

.footer-desc {
  font-size: 14px;
  font-weight: 300;
  color: #282828;
  line-height: 1.8;
  margin-bottom: 40px;
}

.footer-menu-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #282828;
  margin-bottom: 20px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 32px;
}

.footer-nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #282828;
  letter-spacing: 2px;
  transition: color 0.25s;
  cursor: pointer;
}

.footer-nav a:hover { color: #967c47; }

/* Copyright strip */
.footer-copy {
  background: #333333;
  padding: 18px 24px;
  text-align: center;
}

.footer-copy .container-narrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-copy p {
  font-size: 14px;
  font-weight: 400;
  color: #fcfcfc;
  letter-spacing: 1px;
}

.footer-legal {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal a {
  font-size: 14px;
  color: #fcfcfc;
  transition: color 0.25s;
}

.footer-legal a:hover { color: #967c47; }

@media (max-width: 600px) {
  .footer-copy .container-narrow {
    flex-direction: column;
    text-align: center;
  }
  .footer-legal { justify-content: center; }
}

/* =========================================================
   VIDEO MODAL
   ========================================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(900px, 94vw);
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.modal-close:hover { opacity: 1; }

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================================================
   MOBILE MENU OVERLAY
   ========================================================= */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.nav-overlay.open { display: block; }

/* =========================================================
   STAGGERED ANIMATIONS
   ========================================================= */
.instalacion-item:nth-child(2) { transition-delay: 0.12s; }
.instalacion-item:nth-child(3) { transition-delay: 0.24s; }

.product-row .fade-in-left,
.product-row .fade-in-right { transition-duration: 0.8s; }

/* =========================================================
   HERO LOGO ENTRANCE
   ========================================================= */
.hero-content {
  animation: heroEntrance 1.2s ease both;
}

@keyframes heroEntrance {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   MISC UTILITIES
   ========================================================= */
/* Scroll-to-top nudge on very small heights */
@media (max-height: 500px) {
  .hero { min-height: 100vh; }
}

/* Focus outlines for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #967c47;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Selection color */
::selection {
  background: #967c47;
  color: #ffffff;
}
