/* Agritech - sitio público */
:root {
    --brand: #1f7a3d;
    --brand-dark: #155c2d;
    --ink: #1b2520;
    --muted: #5f6b64;
    --bg: #ffffff;
    --bg-alt: #f3f7f4;
    --border: #e3e9e5;
    --maxw: 1140px;
    --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    line-height: 1.65;
    background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* -------- Nav -------- */
.topnav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.logo img { height: 40px; width: auto; }
.logo strong { font-size: 1.3rem; color: var(--brand); }
.menu { display: flex; gap: 26px; }
.menu a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 4px 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--brand); }
.menu a.active { color: var(--brand); border-bottom-color: var(--brand); }
.nav-toggle, .nav-burger { display: none; }

/* Dropdown de categorías */
.has-dropdown { position: relative; }
.has-dropdown > a { display: inline-flex; align-items: center; gap: 4px; }
.caret { font-size: .7em; }
.dropdown {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,.12); padding: 8px; z-index: 50;
}
.has-dropdown:hover .dropdown { display: block; }
.dropdown a {
    display: block; padding: 9px 14px; border-radius: 8px; border: 0;
    font-weight: 600; color: var(--ink); white-space: nowrap;
}
.dropdown a:hover { background: var(--bg-alt); color: var(--brand); }

/* -------- Hero -------- */
.hero {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    padding: 96px 0;
    background-size: cover;
    background-position: center;
}
.hero.hero-img { padding: 130px 0; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 14px; line-height: 1.1; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 640px; margin: 0 0 28px; opacity: .95; }

/* -------- Botones -------- */
.btn {
    display: inline-block; padding: 13px 28px; border-radius: 999px;
    font-weight: 700; text-decoration: none; cursor: pointer;
    border: 2px solid transparent; transition: transform .08s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: var(--brand-dark); }
.hero .btn-primary { background: #fff; color: var(--brand-dark); }
.btn-primary:hover { background: #eef5ef; }

/* -------- Secciones -------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 20px; }
.section h2.center { text-align: center; margin-bottom: 36px; }
.prose { font-size: 1.08rem; color: var(--ink); }

/* -------- Video -------- */
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* -------- Productos -------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.product-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.10); transform: translateY(-3px); }
.product-img {
    aspect-ratio: 4 / 3; background: var(--bg-alt);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-ph { font-size: 3rem; opacity: .5; }
.product-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat {
    align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--brand-dark); background: var(--bg-alt);
    padding: 3px 10px; border-radius: 999px;
}
.product-body h3 { margin: 2px 0 0; font-size: 1.15rem; }
.product-body p { margin: 0; color: var(--muted); font-size: .96rem; flex: 1; }
.product-link { margin-top: 6px; font-weight: 700; text-decoration: none; color: var(--brand); }

.block-img { border-radius: var(--radius); margin: 0 auto; box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* Detalle de producto */
.product-hero { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; padding: 54px 0 46px; }
.product-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 12px 0 12px; }
.product-hero .hero-sub { opacity: .95; max-width: 680px; margin: 0; }
.back-link { color: #d2ecda; text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }
.product-cat.light { color: #fff; background: rgba(255,255,255,.18); }

/* -------- Footer -------- */
.footer { background: var(--ink); color: #d7e0db; padding: 54px 0 30px; margin-top: 10px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.footer p { margin: 4px 0; }
.footer a { color: #9fd5b0; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-logo { height: 38px; background: #fff; padding: 6px 10px; border-radius: 8px; margin-bottom: 12px; }
.footer-brands {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 40px; margin-top: 40px; padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,.12);
}
.footer-brands img { height: 42px; width: auto; opacity: .92; filter: brightness(0) invert(1); }
.footer-copy { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); color: #8b978f; font-size: .9rem; text-align: center; }

/* -------- Responsive -------- */
@media (max-width: 760px) {
    .nav-burger { display: block; font-size: 1.6rem; cursor: pointer; user-select: none; }
    .menu {
        display: none; position: absolute; top: 68px; left: 0; right: 0;
        flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--border);
    }
    .menu a { padding: 14px 22px; border-bottom: 1px solid var(--border); }
    .nav-toggle:checked ~ .menu { display: flex; }
    /* dropdown como lista estática en mobile */
    .has-dropdown { width: 100%; }
    .has-dropdown > a { padding: 14px 22px; border-bottom: 1px solid var(--border); }
    .caret { display: none; }
    .dropdown { display: block; position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0; min-width: 0; }
    .dropdown a { padding-left: 40px; background: var(--bg-alt); }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .section { padding: 52px 0; }
    .hero { padding: 70px 0; }
}

/* ============== FEATURE BLOCK (imagen + texto lado a lado) ============== */
.feature-section { background: #fff; }
.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}
.feature-row.is-reverse { direction: rtl; }
.feature-row.is-reverse > * { direction: ltr; }

.feature-img { width: 100%; }
.feature-img img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0,0,0,.08);
    display: block;
}
.feature-body { max-width: 520px; }
.feature-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 12px;
}
.feature-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 18px;
}
.feature-body .btn { margin-top: 20px; }

@media (max-width: 800px) {
    .feature-row, .feature-row.is-reverse { grid-template-columns: 1fr; direction: ltr; gap: 28px; }
    .feature-body { max-width: 100%; }
}

/* ============== CHIPS DE CATEGORÍAS EN /productos ============== */
.cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 32px;
    max-width: 900px;
}
.cat-filters a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 500;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.cat-filters a:hover { border-color: var(--brand); color: var(--brand); }
.cat-filters a.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
@media (max-width: 600px) {
    .cat-filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 4px 2px 12px; }
    .cat-filters a { white-space: nowrap; }
}

/* ============== VIDEO SLIDER ============== */
.video-slider {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}
.video-slider .vs-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 30px 60px rgba(0,0,0,.18);
}
.video-slider .vs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .6s ease;
    z-index: 1;
}
.video-slider .vs-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
.video-slider .vs-slide iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}
/* Capa transparente arriba del iframe para bloquear hover/tooltips de YouTube */
.video-slider .vs-shield {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    cursor: default;
}
.video-slider .vs-caption {
    position: absolute;
    left: 28px;
    bottom: 24px;
    z-index: 3;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    padding: 8px 14px;
    border-radius: 8px;
    max-width: calc(100% - 56px);
}

/* Flechas */
.video-slider .vs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.92);
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .2s, transform .2s, box-shadow .2s, opacity .2s;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    opacity: 0;
}
.video-slider:hover .vs-nav { opacity: 1; }
.video-slider .vs-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.video-slider .vs-prev { left: 16px; }
.video-slider .vs-next { right: 16px; }

/* Dots */
.video-slider .vs-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}
.video-slider .vs-dot {
    width: 28px;
    height: 4px;
    border-radius: 2px;
    border: 0;
    background: rgba(0,0,0,.18);
    cursor: pointer;
    padding: 0;
    transition: background .25s, width .25s;
}
.video-slider .vs-dot:hover { background: rgba(0,0,0,.4); }
.video-slider .vs-dot.is-active {
    background: var(--brand);
    width: 48px;
}

@media (max-width: 700px) {
    .video-slider .vs-stage { border-radius: 14px; }
    .video-slider .vs-nav {
        width: 40px; height: 40px;
        opacity: 1; /* en mobile siempre visibles */
        background: rgba(255,255,255,.85);
    }
    .video-slider .vs-prev { left: 8px; }
    .video-slider .vs-next { right: 8px; }
    .video-slider .vs-caption {
        left: 12px;
        bottom: 12px;
        font-size: .85rem;
        padding: 6px 10px;
    }
}

/* ============== VIDEO HERO SLIDER (banner con video de fondo) ============== */
.video-hero-slider-section {
    width: 100%;
    background: #000;
}
.video-hero-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    background: #000;
}
.vhs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease;
    z-index: 1;
}
.vhs-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
/* Wrapper que escala el iframe para cubrir el área aunque la proporción no sea 16:9 */
.vhs-video {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.vhs-video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 56.25vw;        /* 16:9 derivado del ancho */
    min-height: 100%;
    min-width: 177.78%;     /* asegura cubrir si la altura manda */
    transform: translate(-50%, -50%);
    border: 0;
    pointer-events: none;
}
.vhs-shield {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    cursor: default;
}
.vhs-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
}
.vhs-content {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    pointer-events: none;
}
.vhs-title {
    color: #fff;
    font-size: clamp(1.8rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 18px rgba(0,0,0,.6);
    max-width: 1100px;
}
.vhs-sub {
    color: rgba(255,255,255,.92);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin: 16px 0 0;
    max-width: 800px;
    text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.vhs-dots {
    position: absolute;
    z-index: 5;
    left: 0; right: 0;
    bottom: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.vhs-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background .25s, border-color .25s, transform .2s;
}
.vhs-dot:hover { background: rgba(255,255,255,.5); }
.vhs-dot.is-active {
    background: var(--brand);
    border-color: var(--brand);
    transform: scale(1.15);
}

@media (max-width: 800px) {
    .video-hero-slider { aspect-ratio: 16 / 10; }
    .vhs-dots { bottom: 14px; }
}
@media (max-width: 500px) {
    .video-hero-slider { aspect-ratio: 4 / 5; }
}
