/* Ruta: assets/css/site.css
   ============================================================
   SISTEMA DE DISEÑO — Fase 1 Frontend Público
   ============================================================
   Identidad: empresa olivícola real. Paleta tomada del mundo del
   olivo (hoja, aceituna, aceite, tierra) — no cream+terracota
   genérico. Tipografía serif con carácter para titulares (evoca
   etiqueta de aceite artesanal) + sans-serif limpia para el cuerpo.

   Firma visual: esquinas "hoja de olivo" (radio asimétrico, no
   redondeado uniforme) en tarjetas, botones e imágenes, + un
   divisor de línea con hojas de olivo dibujado a mano (SVG),
   reutilizado entre secciones.
   ============================================================ */

:root {
    /* ---- Color: paleta con nombre, del mundo del olivo ---- */
    --ink:        #262B1D; /* texto principal, casi negro con base oliva */
    --paper:      #EDE8D4; /* fondo general — piedra caliza, no crema genérico */
    --cream-card: #FBF7EC; /* superficie de tarjetas, más clara que el fondo */
    --grove:      #45532B; /* verde oliva profundo — marca, header/footer */
    --leaf:       #7C8F4E; /* verde hoja — acentos, hover, etiquetas */
    --oil-gold:   #BE8A2E; /* dorado aceite — botones principales, CTAs */
    --clay:       #9C5F3C; /* terracota tierra — uso puntual (badges) */
    --line:       rgba(38, 43, 29, 0.14);

    /* ---- Tipografía ---- */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, system-ui, sans-serif;

    /* ---- Firma: radio "hoja de olivo" (asimétrico) ---- */
    --leaf-radius: 28px 6px 28px 6px;
    --leaf-radius-sm: 14px 3px 14px 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 .5em;
    color: var(--grove);
}

h1 { font-size: clamp(2rem, 5vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw + 1rem, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: inherit; }

em, .accent-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }

/* Etiqueta pequeña tipo "eyebrow" — mayúsculas, tracking amplio */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--oil-gold);
    margin-bottom: .6em;
}

:focus-visible {
    outline: 3px solid var(--oil-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* ============================================================
   REVELADO AL HACER SCROLL — micro-interacción aplicada por JS
   (ver layout.php) a las secciones principales de cada página
   ============================================================ */
.reveal-target {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}
.reveal-target.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   DIVISOR — rama de olivo (firma visual reutilizada)
   ============================================================ */
.olive-divider {
    display: flex;
    justify-content: center;
    margin: 8px 0;
    color: var(--leaf);
    opacity: .8;
}
.olive-divider svg { width: 140px; height: 20px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 24px;
    background: var(--grove);
    position: relative;
    z-index: 50;
}

.site-header__brand {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--cream-card);
    text-decoration: none;
    font-size: 1.3rem;
    letter-spacing: .01em;
}

.site-header__right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-header__nav {
    display: flex;
    gap: 4px 18px;
}

.site-header__nav a {
    color: var(--paper);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease, color .15s ease;
}
.site-header__nav a:hover,
.site-header__nav a:focus-visible {
    color: var(--oil-gold);
    border-color: var(--oil-gold);
}

.site-header__login {
    color: var(--paper);
    opacity: .6;
    display: inline-flex;
    margin-left: 10px;
    transition: opacity .15s ease, color .15s ease;
}
.site-header__login:hover { opacity: 1; color: var(--oil-gold); }

.site-header__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--paper);
    cursor: pointer;
    padding: 4px;
    margin-left: 6px;
}

@media (max-width: 760px) {
    .site-header__toggle { display: flex; }

    .site-header__nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 2px;
        background: var(--grove);
        padding: 10px 24px 20px;
        box-shadow: 0 12px 24px rgba(38,43,29,.25);
    }
    .site-header__nav.is-open { display: flex; }
    .site-header__nav a {
        padding: 10px 4px;
        border-bottom: 1px solid rgba(237,232,212,.12);
    }
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: var(--leaf-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: transform .15s cubic-bezier(.22,.61,.36,1), box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

.btn--primary { background: var(--oil-gold); color: var(--ink); }
.btn--primary:hover { box-shadow: 0 6px 18px rgba(190, 138, 46, .35); }

.btn--outline {
    background: transparent;
    color: var(--cream-card);
    border: 1.5px solid var(--cream-card);
}

.btn--whatsapp { background: #2f7a4f; color: #fff; }
.btn--whatsapp:hover { box-shadow: 0 6px 18px rgba(47, 122, 79, .35); }

/* ============================================================
   HERO (Inicio)
   ============================================================ */
.hero {
    position: relative;
    padding: 90px 24px 70px;
    text-align: center;
    background: var(--grove);
    color: var(--cream-card);
    overflow: hidden;
}

.hero__foto {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero__foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero::before {
    /* velo para legibilidad cuando hay foto de fondo cargada */
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(38,43,29,.55), rgba(38,43,29,.75));
    z-index: 1;
}

.hero > *:not(.hero__foto) { position: relative; z-index: 2; }

.hero__logo {
    max-height: 210px;
    width: auto;
    display: block;
    margin: 0 auto 14px;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.4));
}

.hero .eyebrow {
    color: var(--oil-gold);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-shadow: 0 2px 10px rgba(0,0,0,.5);
}

.hero h1 {
    color: #fff;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 3px 20px rgba(0,0,0,.4);
}

.hero p.hero__lead {
    max-width: 520px;
    margin: 0 auto 28px;
    color: var(--paper);
    font-size: 1.05rem;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.hero__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}
.hero__actions .btn { width: 100%; }

@media (min-width: 560px) {
    .hero__actions { flex-direction: row; justify-content: center; max-width: none; }
    .hero__actions .btn { width: auto; min-width: 180px; }
}

/* ============================================================
   SECCIONES GENERALES
   ============================================================ */
.section {
    padding: 60px 24px;
    max-width: 1080px;
    margin: 0 auto;
}

.section__head { text-align: center; max-width: 620px; margin: 0 auto 36px; }

.section--tinted { background: var(--cream-card); }

/* ---- ¿Por qué elegirnos? ---- */
.ventajas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.ventaja-card {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 26px 22px;
}
.ventaja-card h3 { margin-bottom: 8px; color: var(--grove); }
.ventaja-card p { color: #4b5240; font-size: .92rem; margin: 0; }
.ventaja-card__icono {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--paper);
    border-radius: 50%;
    margin-bottom: 14px;
    color: var(--oil-gold);
}

/* ---- Sobre nosotros (teaser en Inicio) ---- */
.sobre-nosotros {
    display: grid;
    gap: 28px;
    align-items: center;
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 32px 28px;
}
.sobre-nosotros__texto { }
.sobre-nosotros__imagen img,
.sobre-nosotros__imagen .img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--leaf-radius);
}
@media (min-width: 768px) {
    .sobre-nosotros { grid-template-columns: 1fr 1fr; }
}

.img-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--line);
    color: var(--ink);
    font-size: .8rem;
    border-radius: var(--leaf-radius);
}

/* ============================================================
   PRODUCTOS
   ============================================================ */
.productos-listado, .producto-detalle, .productos-relacionados {
    padding: 50px 24px;
    max-width: 1080px;
    margin: 0 auto;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.producto-card {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .15s ease, box-shadow .15s ease;
}
.producto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(38,43,29,.12);
}

.producto-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.producto-card__sin-foto {
    width: 100%; aspect-ratio: 4/3; background: var(--line);
    display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: .8rem;
}
.producto-card__info { padding: 18px; }
.producto-card__info h2 { font-size: 1.05rem; margin: 0 0 6px; font-family: var(--font-display); }
.producto-card__info p { font-size: .87rem; color: #4b5240; margin: 0 0 10px; }
.producto-card__link { font-size: .78rem; color: var(--oil-gold); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.producto-detalle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
}
.producto-detalle__principal { width: 100%; border-radius: var(--leaf-radius); }
.producto-detalle__miniaturas { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.producto-detalle__miniaturas img { width: 66px; height: 66px; object-fit: cover; border-radius: var(--leaf-radius-sm); }
.producto-detalle__info h3 { margin-top: 22px; font-size: 1rem; color: var(--grove); }

@media (min-width: 768px) {
    .producto-detalle { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   INSTITUCIONAL (Empresa / Planta)
   ============================================================ */
.institucional {
    padding: 50px 24px;
    max-width: 780px;
    margin: 0 auto;
}
.institucional__contenido {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 36px 32px;
}
.institucional h2 { margin-top: 32px; font-size: 1.2rem; }
.institucional__galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 26px;
}
.institucional__galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--leaf-radius-sm); }

/* ============================================================
   CONTACTO
   ============================================================ */
.contacto { padding: 50px 24px; max-width: 960px; margin: 0 auto; }
.contacto__grid { display: grid; grid-template-columns: 1fr; gap: 34px; margin-top: 24px; }

.contacto__form {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 28px;
}
.contacto__form label { display: block; margin-bottom: 16px; font-size: .85rem; color: #4b5240; }
.contacto__form input, .contacto__form textarea {
    width: 100%;
    padding: 11px 13px;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius-sm);
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
}
.contacto__form input:focus, .contacto__form textarea:focus {
    outline: none;
    border-color: var(--oil-gold);
}

.contacto__datos {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 28px;
}
.contacto__datos p { margin: 8px 0; font-size: .92rem; }
.contacto__datos strong { color: var(--grove); }
.contacto__mapa { margin-top: 18px; }
.contacto__mapa iframe { width: 100%; border: 0; border-radius: var(--leaf-radius); min-height: 250px; }

.form-success {
    background: #e7f0dd;
    color: #3a4d24;
    padding: 14px 18px;
    border-radius: var(--leaf-radius-sm);
    margin-bottom: 18px;
}
.form-error {
    background: #f6e6de;
    color: #7a3a1f;
    padding: 14px 18px;
    border-radius: var(--leaf-radius-sm);
    margin-bottom: 18px;
    font-size: .9rem;
}

@media (min-width: 768px) {
    .contacto__grid { grid-template-columns: 3fr 2fr; }
}

/* ============================================================
   FAQ
   ============================================================ */
.faq { padding: 50px 24px; max-width: 720px; margin: 0 auto; }
.faq__item {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
}
.faq__item summary {
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-display);
    color: var(--grove);
}
.faq__item p { margin: 12px 0 0; color: #4b5240; }

/* ============================================================
   PÁGINA GENÉRICA / 404 / placeholder
   ============================================================ */
.page-placeholder {
    padding: 70px 24px;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}
.page-placeholder h1 { margin-bottom: 14px; }
.page-placeholder p { color: #4b5240; margin-bottom: 22px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--grove);
    color: var(--paper);
    padding: 36px 24px 28px;
}
.site-footer__grid {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}
.site-footer__brand {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 8px;
}
.site-footer h4 {
    font-family: var(--font-body);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--oil-gold);
    margin: 0 0 10px;
}
.site-footer p, .site-footer a {
    font-size: .88rem;
    color: var(--paper);
    text-decoration: none;
    margin: 0 0 6px;
}
.site-footer a:hover { color: var(--oil-gold); }
.site-footer__bottom {
    max-width: 1080px;
    margin: 24px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(237,232,212,.15);
    font-size: .78rem;
    color: rgba(237,232,212,.7);
    text-align: center;
}
@media (min-width: 700px) {
    .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2f7a4f;
    color: #fff;
    width: 58px;
    height: 58px;
    border-radius: var(--leaf-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: .62rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(38,43,29,.28);
    z-index: 40;
}

/* ============================================================
   AJUSTE "PREMIUM" — refinamientos sobre la v2
   ============================================================ */

/* Más aire entre secciones y títulos más dramáticos */
.section { padding: 84px 24px; }
h1 { letter-spacing: -0.01em; }

/* Hero: más alto, gradado más sutil, línea dorada bajo el eyebrow */
.hero { padding: 130px 24px 100px; }
.hero::before {
    background: linear-gradient(180deg, rgba(38,43,29,.4) 0%, rgba(38,43,29,.5) 55%, rgba(38,43,29,.68) 100%);
}
.hero .eyebrow {
    position: relative;
    padding-bottom: 16px;
}
.hero .eyebrow::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 46px; height: 1px;
    background: var(--oil-gold);
}

/* Header: un poco más de aire y tracking en el nombre de marca */
.site-header { padding: 20px 28px; }
.site-header__brand { letter-spacing: .01em; }

/* Tarjetas "¿Por qué elegirnos?": menos caja, más editorial —
   hairline dorada arriba en vez de borde parejo, ícono de línea
   en círculo abierto en vez de emoji sobre fondo sólido */
.ventaja-card {
    background: transparent;
    border: none;
    border-top: 1px solid var(--oil-gold);
    border-radius: 0;
    padding: 30px 4px 0;
}
.ventaja-card__icono {
    width: 46px; height: 46px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--oil-gold);
    padding: 10px;
}
.ventaja-card__icono svg { width: 100%; height: 100%; }

/* Tarjetas de producto: borde más fino, sombra más sutil, sin
   fondo plano — se siente más "vitrina", menos "caja" */
.producto-card {
    border: 1px solid var(--line);
    box-shadow: none;
}
.producto-card:hover {
    box-shadow: 0 14px 30px rgba(38,43,29,.14);
    border-color: var(--oil-gold);
}

/* Botones: transición más suave en el outline */
.btn--outline { transition: background .2s ease, color .2s ease, transform .15s ease; }
.btn--outline:hover { background: var(--cream-card); color: var(--grove); }

/* Sobre Nosotros: imagen con marco fino dorado en vez de placeholder gris plano */
.img-placeholder {
    background: var(--grove);
    color: var(--paper);
    border: 1px solid var(--oil-gold);
    font-style: italic;
    font-family: var(--font-display);
}

/* Botón flotante de WhatsApp: menos "app genérica", más integrado */
.whatsapp-float { border: 2px solid rgba(255,255,255,.25); }

/* ============================================================
   AGREGADOS — cierre de Fase 1
   ============================================================ */

/* Logo en el header */
.site-header__logo { max-height: 54px; display: block; }

/* Botón secundario (para "Llamar", "Cómo llegar") */
.btn--secondary {
    background: transparent;
    color: var(--grove);
    border: 1.5px solid var(--grove);
}
.btn--secondary:hover { background: var(--grove); color: #fff; }

.contacto__acciones { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }

/* Migas de pan */
.breadcrumb {
    max-width: 1080px;
    margin: 18px auto 0;
    padding: 0 24px;
    font-size: .82rem;
    color: #6b7260;
}
.breadcrumb a { color: #6b7260; text-decoration: none; }
.breadcrumb a:hover { color: var(--oil-gold); }
.breadcrumb span { color: var(--grove); font-weight: 600; }

/* Buscador y filtros del catálogo */
.productos-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 8px;
    align-items: center;
}
.productos-filtros input[type="text"],
.productos-filtros select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius-sm);
    font-size: .9rem;
    font-family: inherit;
    background: #fff;
}
.productos-filtros input[type="text"] { flex: 1; min-width: 180px; }
.productos-filtros__limpiar {
    font-size: .85rem;
    color: #6b7260;
    text-decoration: underline;
}

#resultadosProductos { transition: opacity .2s ease; }

/* ============================================================
   MENÚ FIJO
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
}

/* ============================================================
   ZOOM EN FOTOS (lightbox simple)
   ============================================================ */
.zoomable { cursor: zoom-in; }

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,20,15,.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 28px;
    cursor: zoom-out;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--leaf-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

/* ============================================================
   TESTIMONIOS
   ============================================================ */
.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.testimonio-card {
    background: var(--cream-card);
    border: 1px solid var(--line);
    border-radius: var(--leaf-radius);
    padding: 26px 24px;
}
.testimonio-card__estrellas { color: var(--oil-gold); font-size: 1rem; margin-bottom: 10px; }
.testimonio-card__texto { font-style: italic; color: #4b5240; margin-bottom: 14px; }
.testimonio-card__nombre { font-weight: 600; color: var(--grove); font-size: .9rem; }

/* ============================================================
   PROCESO DE PRODUCCIÓN / FAQ TEASER / CTA FINAL
   ============================================================ */
.proceso-resumen {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    color: #4b5240;
}

.faq-teaser {
    max-width: 700px;
    margin: 24px auto 0;
}

.cta-final {
    text-align: center;
    background: var(--grove);
    color: var(--paper);
    padding: 70px 24px;
}
.cta-final h2 { color: #fff; }
.cta-final p { color: var(--paper); max-width: 480px; margin: 0 auto 24px; }
