/* =========================================================
   D.O. Cariñena — Estilos base optimizados
   ========================================================= */

/* ======= Variables y ajustes globales ======= */
:root {
  --verde: #02714A;
  --beige: #f4f2ec;
  --negro: #222;
  --blanco: #fff;
}

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

body {
  margin: 0;
  font-family: 'Playfair Display', serif;
  color: var(--negro);
  line-height: 1.6;
  background: var(--blanco);
}

h1, h2, h3, p, a {
  font-family: 'Playfair Display', serif;
}

p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ======= Header y navegación ======= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--blanco);
  border-bottom: 1px solid #ddd;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo {
  height: 120px;
  width: auto;
  transition: transform 0.2s ease;
}

.logo:hover { transform: scale(1.05); }

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  display: none;
  color: var(--verde);
}

.site-nav {
  display: flex;
  gap: 1.2rem;
  padding-top: 50px;
}

.site-nav a {
  font-weight: 500;
  color: var(--negro);
  text-decoration: none;
  letter-spacing: 0.2px;
  font-size: 1.05rem;
}

.site-nav a:hover { color: var(--verde); }

/* ======= Hero unificado ======= */
.hero {
  position: relative;
  height: 90vh;            /* 🔹 más alto, ocupa casi toda la ventana */
  min-height: 600px;       /* 🔹 asegura buena proporción en escritorio */
  margin-top: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  max-width: 1920px;
  object-fit: cover;
}

.hero .overlay {
  position: absolute;
  top: 50%;                      /* 🔹 centrado vertical */
  left: 8%;                      /* 🔹 margen izquierdo coherente con el diseño */
  transform: translateY(-50%);   /* 🔹 centra verticalmente solo */
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-align: left;              /* 🔹 texto alineado a la izquierda */
  width: fit-content;
  max-width: 600px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0 0 0.3rem 0;
  line-height: 1.2;
}

.tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0;
}

/* ======= Versión responsive ======= */
@media (max-width: 900px) {
  .hero {
    height: 70vh;
    min-height: 400px;
  }

  .hero .overlay {
    left: 5%;
    right: 5%;
    width: auto;
    text-align: center;
    transform: translateY(-50%);
  }
}


.tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0;
}

/* ======= Band intro ======= */
.band {
  background: var(--verde);
  color: var(--blanco);
}

.band-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 10%;
  text-align: center;
}

/* ======= Secciones de texto e imagen ======= */
.text-image {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 4rem 10%;
  max-width: 1300px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(40px);
  transition: all .8s ease-out;
}

.text-image.visible {
  opacity: 1;
  transform: translateY(0);
}

.text-image img {
  width: 50%;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0,0,0,.1);
  object-fit: cover;
}

h2 {
  color: var(--verde);
  margin-top: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  margin-bottom: .3rem;
}

/* ======= Grid general ======= */
.grid-section {
  text-align: center;
  padding: 4rem 5%;
  background: var(--blanco);
}

.grid-section h2 {
  color: var(--negro);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 2rem;
}

/* ======= Grid de tarjetas ======= */
.grid-cards,
.grid-cards-alt {
  display: grid;
  gap: 1.5rem;
  margin: 0 auto;
}

.grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  max-width: 1100px;
}

.grid-cards-alt {
  grid-template-columns: repeat(4, 1fr);
  max-width: 1280px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  text-decoration: none;
  color: var(--negro);
  transition: transform .2s ease, box-shadow .2s ease;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card.square { aspect-ratio: 1 / 1; }
.card.vertical { aspect-ratio: 3 / 4; pointer-events: none; }

/* ====== Texto de las tarjetas del grid ====== */
.card p {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92); /* leve transparencia para elegancia */
  margin: 0;
  padding: 0.8rem 1rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 1.8vw, 1.35rem); /* 🔹 más grande y fluido */
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  color: var(--negro);
  border-radius: 0 0 6px 6px;
}


.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ======= Footer ======= */
.footer-green {
  background: var(--verde);
  color: var(--blanco);
  padding: 2rem 5%;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  height: 170px;
  width: auto;
}

.footer-green p {
  margin: 0;
  font-size: 0.9rem;
}

/* ======= Botón volver arriba ======= */
#toTop {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  transition: all .3s ease;
}

#toTop.show { display: block; opacity: 0.9; }
#toTop:hover { opacity: 1; }

/* ======= Responsive ======= */
@media (max-width: 900px) {
  .menu-toggle { display: block; }

  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--blanco);
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1rem;
    display: none;
    border-bottom: 1px solid #ddd;
  }

  .site-nav.open { display: flex; }

  .text-image,
  .text-image.reverse {
    flex-direction: column;
    text-align: center;
  }

  .text-image img,
  .text-image .text {
    width: 100%;
  }

  .logo { height: 90px; }

  .grid-cards-alt {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-cards-alt {
    grid-template-columns: 1fr;
  }
}

/* ====== Banda verde introductoria con franja blanca ====== */
.intro.band {
  background: var(--verde);
  color: var(--blanco);
  padding: 3rem 8%;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  position: relative;
}

/* Franja blanca de separación con el hero */
.intro.band::before {
  content: "";
  display: block;
  height: 0rem;              /* altura de la franja */
  background: var(--blanco);
  position: absolute;
  top: 0rem;                /* coloca la franja justo antes del bloque verde */
  left: 0;
  right: 0;
  z-index: 2;
}


/* ====== ESTRUCTURA DE PÁGINAS INTERNAS (como origen.html) ====== */

/* Ajuste general del cuerpo */
main, section {
  width: 100%;
}

/* Evita que se recorte la franja blanca */
.intro.band {
  overflow: visible;
}

/* Bloques de texto e imagen */
.text-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 4rem 10%;
  max-width: 1100px;
  margin: 0 auto;
}

.text-image img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.text-image h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--verde);
  margin-bottom: 1rem;
  text-align: center;
}

/* ====== Ajuste de ancho para páginas internas tipo origen ====== */
.text-image .text {
  width: 75%;          /* 🔹 ancho equilibrado para texto */
  max-width: 950px;   /* límite superior por si la pantalla es muy grande */
  margin: 0 auto;
  text-align: left;
}

/* Ajuste de ancho y alineación de texto en secciones internas */
.text-image p {
  text-align: left;              /* 🔹 texto alineado a la izquierda */
  max-width: 950px;              /* 🔹 más ancho que los 800px anteriores */
  margin: 0 auto 1rem auto;
  line-height: 1.8;
  font-size: 1.1rem;
}

/* ====== Estado activo del menú ====== */
.site-nav a.active {
  color: var(--verde);
  position: relative;
  font-weight: 600;
}

/* Inversión opcional (para secciones alternas en otras páginas) */
.text-image.reverse {
  flex-direction: column;
}

/* ===== Footer ===== */
.footer-green {
  background: var(--verde);
  color: var(--blanco);
  text-align: center;
  padding: 3em 1.5em 2em;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin-bottom: 1.5em;
}

.footer-logos img {
  height: 60px;
  width: auto;
  transition: opacity 0.3s ease;
}

.footer-logos a:hover img {
  opacity: 0.7;
}

.footer-copy {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsivo */
@media (max-width: 600px) {
  .footer-logos {
    gap: 2rem;
  }
  .footer-logos img {
    height: 45px;
  }
}


/* ====== Imágenes interiores a ancho completo ====== */
.text-image img {
  position: relative;
  left: 50%;
  width: 100vw;
  max-width: 100vw;
  transform: translateX(-50%);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  height: auto;
  object-fit: cover;
}

/* Quita el padding lateral del contenedor para que no lo limite */
.text-image {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}
/* === Listado de bodegas en 2 columnas === */
.bodegas-list {
  list-style: none;
  padding: 0;
  margin: 1.5em 0;
  columns: 2; /* divide en dos columnas */
  column-gap: 3rem; /* espacio entre columnas */
}

.bodegas-list li {
  margin-bottom: 0.4em;
  break-inside: avoid; /* evita cortar nombres largos entre columnas */
}

/* Responsivo: una columna en pantallas pequeñas */
@media (max-width: 768px) {
  .bodegas-list {
    columns: 1;
  }
}

/* ===== Sección bodegas ===== */
.bodegas-section {
  background: var(--blanco);
  padding: 4em 0;
}

.bodegas-section .band-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5em;
}

.bodegas-section h2 {
  text-align: center;
  color: var(--verde);
  font-weight: 700;
  margin-bottom: 1.5em;
  font-size: 1.8rem;
}

/* === Listado de bodegas en 2 columnas === */
.bodegas-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  columns: 2;
  column-gap: 3rem;
  text-align: left;
}

.bodegas-list li {
  margin-bottom: 0.4em;
  break-inside: avoid;
}

/* Responsivo: una columna en pantallas pequeñas */
@media (max-width: 768px) {
  .bodegas-list {
    columns: 1;
  }
}

/* Igualar el ancho del listado al del texto superior */
.bodegas-section .band-inner {
  max-width: 950px;   /* mismo ancho que .text-image p */
  margin: 0 auto;
  padding: 0;         /* sin padding lateral para que alinee al milímetro */
}

/* (opcional) si los nombres son enlaces, que no se vean azules/subrayados */
.bodegas-list a {
  color: inherit;
  text-decoration: none;
}
.bodegas-list a:hover { text-decoration: underline; }

/* ===== Enlaces dentro de bloques con fondo verde ===== */
.band a {
  color: var(--blanco);              /* blanco sobre fondo verde */
  text-decoration: underline;        /* mantiene legibilidad */
  text-underline-offset: 3px;        /* separa un poco la línea */
  transition: color 0.3s ease;
}

.band a:hover {
  color: #ffd700; /* dorado suave al pasar el ratón */
}
