/* ═══════════════════════════════════════════════════════════════
   TSC AGROINDUSTRIALES — main.css
   Variables CSS, reset, tipografía, layout global, navbar, footer
════════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
    /* Colores oficiales TSC */
    --color-green:        #5da032;
    --color-green-hover:  #4a8228;
    --color-green-light:  #EBF5E1;
    --color-navy:         #01315c;
    --color-navy-dark:    #011F3D;
    --color-gray:         #646764;
    --color-gray-light:   #B0B2B0;
    --color-sky:          #38B6FF;
    --color-white:        #FFFFFF;
    --color-bg:           #FFFFFF;
    --color-bg-light:     #F5F6F7;
    --color-border:       #E8E9EA;

    /* Tipografía */
    --font:               'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --fw-light:           300;
    --fw-regular:         400;
    --fw-medium:          500;
    --fw-semibold:        600;
    --fw-bold:            700;
    --fw-extrabold:       800;

    /* Escala tipográfica */
    --text-xs:    0.75rem;   /* 12px */
    --text-sm:    0.875rem;  /* 14px */
    --text-base:  1rem;      /* 16px */
    --text-lg:    1.125rem;  /* 18px */
    --text-xl:    1.25rem;   /* 20px */
    --text-2xl:   1.5rem;    /* 24px */
    --text-3xl:   1.875rem;  /* 30px */
    --text-4xl:   2.25rem;   /* 36px */
    --text-5xl:   3rem;      /* 48px */
    --text-6xl:   3.75rem;   /* 60px */

    /* Espaciado */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --container-max:  1240px;
    --container-pad:  1.5rem;
    --radius-sm:      4px;
    --radius:         6px;
    --radius-lg:      12px;

    /* Navbar */
    --navbar-h:       72px;

    /* Sombras */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:     0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);

    /* Transiciones */
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    color: var(--color-gray);
    background-color: var(--color-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-green);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-navy); }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: var(--fw-bold);
    color: var(--color-navy);
    line-height: 1.25;
}

p { margin-bottom: 0; }

/* ─── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ─── LAYOUT HELPERS ─────────────────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

.section--alt {
    background-color: var(--color-bg-light);
}

.section--dark {
    background-color: var(--color-navy);
    color: var(--color-white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 {
    color: var(--color-white);
}

/* ─── ACCESIBILIDAD ──────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── TIPOGRAFÍA SEMÁNTICA ───────────────────────────────────── */
.eyebrow {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-green);
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: var(--fw-bold);
    color: var(--color-navy);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.section-sub {
    font-size: var(--text-lg);
    color: var(--color-gray);
    max-width: 600px;
    line-height: 1.65;
}

.section-header {
    margin-bottom: var(--space-12);
}

.section-header--center {
    text-align: center;
}
.section-header--center .section-sub {
    margin-left: auto;
    margin-right: auto;
}

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--color-white);
    height: var(--navbar-h);
    transition: box-shadow var(--transition);
    border-bottom: 1px solid var(--color-border);
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.10);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-h);
    gap: var(--space-6);
}

.navbar__logo img {
    height: 60px;
    width: auto;
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.navbar__link {
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    color: var(--color-navy);
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.navbar__link:hover,
.navbar__link.active {
    color: var(--color-navy);
    border-bottom-color: var(--color-green);
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Selector de idioma */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-gray-light);
}
.lang-btn {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-gray);
    letter-spacing: 0.05em;
}
.lang-btn:hover,
.lang-btn--active {
    color: var(--color-navy);
}

/* Hamburger */
.navbar__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.navbar__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-navy);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.navbar__mobile {
    display: none;
    background-color: var(--color-white);
    padding: var(--space-6);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.navbar__mobile.open { display: block; }
.navbar__mobile ul { margin-bottom: var(--space-6); }
.navbar__mobile li { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.navbar__mobile a {
    color: var(--color-navy);
    font-size: var(--text-base);
    font-weight: var(--fw-medium);
}
.navbar__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.navbar-spacer {
    height: var(--navbar-h);
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
    background-color: var(--color-navy);
    color: rgba(255,255,255,0.75);
    padding-top: var(--space-16);
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-10);
    padding-bottom: var(--space-16);
}

.footer__brand img { margin-bottom: var(--space-4); }

.footer__tagline {
    font-size: var(--text-sm);
    line-height: 1.65;
    color: rgba(255,255,255,0.6);
    max-width: 260px;
}

.footer__heading {
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
}

.footer__col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer__col a {
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.65);
    transition: color var(--transition);
}
.footer__col a:hover { color: var(--color-white); }

.footer__contact { display: flex; flex-direction: column; gap: var(--space-3); }
.footer__wa-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: #25D366 !important;
}
.footer__wa-link:hover { color: #1da851 !important; }

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: var(--space-5) 0;
}
.footer__bottom p {
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* ─── WHATSAPP FLOTANTE ──────────────────────────────────────── */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    z-index: 90;
    transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37,211,102,0.5);
}

/* ─── ANIMACIONES DE ENTRADA ─────────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .navbar__links { display: none; }
    .navbar__cta   { display: none; }
    .navbar__hamburger { display: flex; }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }
    .footer__brand { grid-column: 1 / -1; }

    .section-title { font-size: var(--text-3xl); }
}

@media (max-width: 767px) {
    :root {
        --container-pad: 1rem;
        --navbar-h: 64px;
    }

    .section { padding-top: var(--space-16); padding-bottom: var(--space-16); }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .section-title { font-size: var(--text-2xl); }
    .section-sub   { font-size: var(--text-base); }

    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
}
