/*
Theme Name: AgroTech Theme
Author: AI Assistant
Description: Tema de WordPress para tecnología agrícola, orgánico y sustentable.
Version: 1.0.0
Tags: agricultura, tecnologia, sustentable, blog
*/

/* ==========================================================================
   RESET & SYSTEM CONFIGURATION
   ========================================================================== */
:root {
    /* Color Palette (Tierra y Verde Orgánico) */
    --primary-color: #4C7D4E;       /* Verde hoja vibrante */
    --primary-dark: #325A34;        /* Verde bosque profundo */
    --primary-light: #E9F0E9;       /* Verde muy pálido */
    --accent-color: #C06B3E;        /* Tierra cocida / Terracota */
    --neutral-dark: #3E3B32;        /* Marrón oscuro para texto y fondos */
    --neutral-light: #EBF2E5;       /* Muy suave verde/amarillo simulando campo */
    --neutral-muted: #8E887B;       /* Tierra agrisada para textos secundarios */
    --dark-surface: #4C483F;        /* Superficies secundarias oscuras (mapa, bordes) */
    --dark-border: #5C574C;         /* Bordes en footer */
    --dark-muted-text: #BDB7AA;     /* Texto secundario en footer */
    --white: #FAFCFA;
    
    /* Typography */
    --font-main: 'Plus Jakarta Sans', sans-serif;
    
    /* Layout & Spacing System */
    --max-width: 1200px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 20px -2px rgba(30, 41, 59, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--neutral-light); /* Fallback */
    background-attachment: fixed;
    color: var(--neutral-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Reusable Container Utility */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   BUTTONS & UI COMPONENTS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--neutral-dark);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
}

.btn-primary-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-primary-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* ==========================================================================
   NAVIGATION LAYOUT
   ========================================================================== */
.top-bar {
    background-color: var(--neutral-dark);
    color: var(--white);
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-actions {
    display: flex;
    gap: 20px;
}

.top-bar-item {
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.top-bar-item:hover {
    color: var(--white);
}

.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px); /* Glassmorphism sutil para UI moderna */
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e2e8f0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand-logo {
    text-decoration: none;
    font-size: 1.5rem;
    color: var(--neutral-dark);
}

.brand-logo .logo-text strong {
    color: var(--primary-color);
}

/* 
 * Dimensiones del Logo: 
 * El tema está optimizado para usar un logo de 250px de ancho y 80px de alto. (250x80)
 * Todas las imágenes y el header se adaptarán considerando esta proporción máxima.
 */
.brand-logo img, .custom-logo {
    max-width: 250px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--neutral-muted);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* Elementos adicionales de WordPress */
.nav-menu li.current-menu-item > a {
    color: var(--primary-color);
}

/* ==========================================================================
   HERO SECTOR (GRID 2 COLUMNS)
   ========================================================================== */
.hero-section {
    padding: 80px 0;
    background: radial-gradient(circle at 10% 20%, rgb(233, 245, 235) 0%, rgb(255, 255, 255) 90%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--neutral-dark);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--neutral-muted);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-image-placeholder {
    width: 100%;
    height: 48px;
    min-height: 450px;
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px -15px rgba(5, 150, 105, 0.2);
    display: flex;
    align-items: flex-end;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.hero-image-placeholder::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1592417817098-8f3d6eb19675?auto=format&fit=crop&q=80&w=800') center/cover;
    opacity: 0.85;
    mix-blend-mode: multiply;
}

.image-overlay-text {
    position: relative;
    color: var(--white);
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Hero Carousel Styles */
.hero-swiper {
    width: 100%;
    height: 80vh;
    min-height: 500px;
}

.hero-slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 40px; /* Space for pagination dots */
}

.swiper-button-next, .swiper-button-prev {
    color: var(--white) !important;
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    background: var(--white) !important;
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* ==========================================================================
   SECTIONS GENERAL RULES & ABOUT US
   ========================================================================== */
section {
    padding: var(--section-padding, 80px 0);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px auto;
    padding: 0;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--neutral-dark);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 50%;
    transform: translateX(-50%);
    width: 50px; height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-header .subtitle {
    font-size: 1.1rem;
    color: var(--neutral-muted);
}

.mv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.card {
    background-color: var(--card-bg-color, var(--white));
    border-radius: var(--card-border-radius, var(--radius-md));
    padding: 40px;
    box-shadow: var(--card-shadow, var(--shadow-soft));
    border: var(--card-border, 1px solid #f1f5f9);
    transition: var(--transition-smooth);
    margin-bottom: 40px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(30, 41, 59, 0.1);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.card:hover .card-icon {
    background-color: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

.card-icon .material-symbols-outlined {
    font-size: 32px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 14px;
    color: var(--neutral-dark);
}

.card p, .entry-content p {
    color: var(--neutral-muted);
}

/* Card Layout Variants */
.card-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.card-layout-inline .card-header-row {
    flex-direction: row;
}

.card-layout-inline .card-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.card-layout-inline .card-header-row h3 {
    margin-bottom: 0;
}

.card-layout-stacked .card-header-row {
    flex-direction: column;
    align-items: flex-start;
}

/* ==========================================================================
   PRODUCTS DISPLAY LAYOUT
   ========================================================================== */
.products-section {
    background-color: transparent;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.product-card {
    background-color: var(--card-bg-color, var(--white));
    border-radius: var(--card-border-radius, var(--radius-md));
    overflow: hidden;
    box-shadow: var(--card-shadow, var(--shadow-soft));
    border: var(--card-border, 1px solid #f1f5f9);
    margin-bottom: 40px;
}

.product-img-placeholder {
    height: 300px;
    position: relative;
    background-size: cover;
    background-position: center;
}

/* Fallback con imágenes reales de Unsplash mediante estilos inline simulados */
.tomato-bg {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1595855759920-86582396756a?auto=format&fit=crop&q=80&w=600');
}

.cucumber-bg {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1449300079323-02e209d9d3a6?auto=format&fit=crop&q=80&w=600');
}

.product-card .tag {
    position: absolute;
    top: 20px; left: 20px;
    background-color: var(--white);
    color: var(--neutral-dark);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
}

.product-info {
    padding: 24px;
}

.product-info h3 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.product-info p {
    color: var(--neutral-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   FOOTER LAYER
   ========================================================================== */
.main-footer {
    background-color: var(--neutral-dark);
    color: var(--dark-muted-text);
    padding: 80px 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

.footer-brand h3, .footer-info h4, .footer-map h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-brand h3 {
    font-size: 1.6rem;
}

.footer-info ul {
    list-style: none;
}

.footer-info ul li {
    margin-bottom: 12px;
}

.footer-info a {
    color: var(--dark-muted-text);
    text-decoration: none;
}

.footer-info a:hover {
    color: var(--white);
}

.map-placeholder {
    background-color: var(--dark-surface);
    height: 250px;
    border-radius: var(--radius-sm);
    display: block;
    color: var(--dark-muted-text);
    font-size: 0.9rem;
    border: 1px dashed var(--dark-border);
}

.responsive-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-sm);
}

.footer-bottom {
    border-top: 1px solid var(--dark-surface);
    padding: 24px 0;
    font-size: 0.85rem;
}

.bottom-wrapper {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   NEW SECTIONS: NEWS & CONTACT CTA
   ========================================================================== */
.hero-content-centered {
    max-width: 800px;
    margin: 0 auto;
}

.text-white {
    color: var(--white) !important;
}

.text-white-muted {
    color: #e2e8f0 !important;
    font-size: 1.2rem;
    margin-bottom: 32px;
}

.white-outline {
    border-color: var(--white) !important;
    color: var(--white) !important;
}

.white-outline:hover {
    background-color: var(--white) !important;
    color: var(--neutral-dark) !important;
}

.justify-center {
    justify-content: center;
}

.about-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    font-size: 1.1rem;
    color: var(--neutral-muted);
}

.news-section {
    background-color: transparent;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.news-card {
    background-color: var(--card-bg-color, var(--white));
    border-radius: var(--card-border-radius, var(--radius-md));
    overflow: hidden;
    box-shadow: var(--card-shadow, var(--shadow-soft));
    border: var(--card-border, 1px solid #e2e8f0);
    transition: var(--transition-smooth);
    margin-bottom: 40px;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(30, 41, 59, 0.15);
}

.news-img {
    height: 220px;
    background-size: cover;
    background-position: center;
}

.news-content {
    padding: 24px;
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-content h3 a {
    text-decoration: none;
    color: var(--neutral-dark);
    transition: var(--transition-smooth);
}

.news-content h3 a:hover {
    color: var(--primary-color);
}

.news-content p {
    color: var(--neutral-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.news-read-more {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-cta-section {
    padding: 80px 24px;
}

.cta-wrapper {
    background-color: var(--primary-color);
    border-radius: var(--radius-md);
    padding: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    color: var(--white);
    box-shadow: 0 20px 40px -10px rgba(46, 125, 50, 0.3);
}

.cta-info h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.cta-info p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

.cta-contact-details p {
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.cta-form-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-sm);
    color: var(--neutral-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition-smooth);
    background-image: none !important;
    background-repeat: no-repeat !important;
    cursor: text !important;
}

.custom-form button {
    cursor: pointer !important;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn-block {
    width: 100%;
    font-size: 1.1rem;
    padding: 16px;
}

/* ==========================================================================
   CONTACT PAGE SPECIFIC
   ========================================================================== */
.contact-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -80px; /* Offset to go under transparent header if it becomes transparent, otherwise safe */
}

.contact-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.contact-map-container iframe {
    width: 100% !important;
    height: 300px !important;
    border: none;
    border-radius: 12px;
}

/* ==========================================================================
   CONTACT PAGE NATIVE FORM
   ========================================================================== */
.native-contact-form .form-group {
    position: relative;
    margin-bottom: 20px;
}

.native-contact-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 20px;
}

.native-contact-form.with-icons input, 
.native-contact-form.with-icons textarea {
    padding-left: 48px; /* Room for icon */
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-content h1 { font-size: 2.75rem; }
    .hero-actions { justify-content: center; }
    .hero-image-wrapper { order: -1; } /* Sube la imagen arriba en mobile view */
    
    .mv-grid, .products-grid, .footer-grid, .news-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .cta-wrapper {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }
}

@media (max-width: 576px) {
    .nav-menu { display: none; } /* En desarrollo real aquí integrarías un menú de hamburguesa */
    .top-bar-wrapper { justify-content: center; gap: 8px; text-align: center; }
    .cta-info h2 { font-size: 2rem; }
}

/* ==========================================================================
   ANIMATIONS (JS)
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   WHATSAPP FLOATING BUTTON
   ========================================================================== */
.whatsapp-float {
    position: fixed !important;
    width: 60px;
    height: 60px;
    bottom: 40px !important;
    right: 40px !important;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: #FFF;
    background-color: #1ebe57;
}

.whatsapp-icon {
    margin-top: 2px;
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
}

/* ==========================================================================
   MOBILE MENU & RESPONSIVE NAV
   ========================================================================== */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--neutral-dark);
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
}
.menu-toggle .material-symbols-outlined {
    font-size: 32px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        padding: 20px 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        display: block;
        padding: 15px 20px;
    }
}

/* ==========================================================================
   NEWS MODAL
   ========================================================================== */
.news-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.news-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.news-modal-content {
    background-color: var(--white);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    padding: 40px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.news-modal-overlay.active .news-modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--neutral-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--neutral-dark);
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.news-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.news-modal-body p {
    margin-bottom: 1.5rem;
}

.news-modal-body h2, .news-modal-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}
