:root {
    --primary-color: #d81e05;
    /* MAPFRE Red */
    --primary-dark: #b01804;
    --secondary-color: #737373;
    /* MAPFRE Gray */
    --accent-color: #101921;
    /* MAPFRE Black */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-dark: #101921;
    --text-light: #ffffff;
    --bg-light: #ffffff;
    --bg-off-white: #f8f9fa;
    --font-main: 'Montserrat', sans-serif;
    --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -2px;
}

h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    color: var(--accent-color);
    letter-spacing: -1px;
}

h3 {
    font-size: 1.75rem;
    color: var(--accent-color);
}

p {
    font-size: 1.1rem;
    color: #444;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--primary-color);
    transition: var(--transition-fast);
}

header.scrolled {
    height: 70px;
    box-shadow: var(--shadow-strong);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
    transition: var(--transition-fast);
}

header.scrolled .navbar {
    height: 70px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.integral-icon {
    height: 70px;
    width: auto;
    flex-shrink: 0;
    display: block;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4b5563;
    /* Elegant slate gray */
    padding: 8px 15px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: #fef2f2;
    /* Soft pill background from image */
    color: #991b1b;
    /* Refined crimson red */
}

/* Remove old underline effect */
.nav-links a::after {
    display: none !important;
}

.dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 12px;
    list-style: none;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
}

.nav-links li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown li {
    margin: 4px 0;
}

.dropdown a {
    padding: 10px 16px;
    display: block;
    text-transform: none;
    font-size: 0.9rem;
    color: #4b5563 !important;
    border-radius: 8px;
    font-weight: 500;
}

.dropdown a:hover {
    background: #f9fafb;
    color: #991b1b !important;
}

/* Specific theme colors for Agroseguro levels */
.dropdown-agro a:hover {
    color: #27ae60 !important;
}

.dropdown-pecuaria a:hover {
    color: #8b4513 !important;
}

/* Anagan-style Grid & Category Styling */
.category-layout {
    display: flex;
    gap: 50px;
    margin-top: 50px;
}

.category-sidebar {
    flex: 0 0 280px;
    position: sticky;
    top: 120px;
    height: fit-content;
}

.category-menu {
    list-style: none;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #eee;
}

.category-menu li {
    margin-bottom: 10px;
}

.category-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    color: var(--secondary-color);
}

.category-menu a.active-agrario {
    background: #f0fdf4;
    color: #27ae60;
}

.category-menu a.active-pecuaria {
    background: #fdf8f4;
    color: #8b4513;
}

.category-menu a:hover {
    background: var(--bg-off-white);
}

.grid-anagan {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.card-anagan {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: var(--transition-slow);
}

.card-anagan:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

.card-img-small {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.card-body-small {
    padding: 25px;
}

.card-body-small h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.card-body-small p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .category-layout {
        flex-direction: column;
    }

    .category-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .category-menu {
        display: flex;
        overflow-x: auto;
        gap: 10px;
    }

    .category-menu li {
        margin: 0;
        white-space: nowrap;
    }
}

/* Agro & Pecuaria Overlay Grid (Image-based) */
.agro-overlay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.agro-overlay-card {
    position: relative;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: var(--transition-slow);
}

.agro-overlay-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
    transition: var(--transition-fast);
}

.agro-overlay-card:hover::before {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
}

.agro-overlay-card:hover {
    transform: scale(1.02);
}

.agro-overlay-card h4 {
    color: white;
    z-index: 2;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
}

.agro-plus {
    width: 40px;
    height: 40px;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    z-index: 2;
    transition: var(--transition-fast);
}

.agro-overlay-card:hover .agro-plus {
    background: white;
    color: var(--primary-color);
}

/* Specific theme colors for Agroseguro levels */
.section-agrario {
    border-left: 8px solid #27ae60;
    padding-left: 30px;
    margin-bottom: 60px;
}

.section-pecuario {
    border-left: 8px solid #8b4513;
    padding-left: 30px;
    margin-bottom: 60px;
}


/* Underline removed in favor of pill design above */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 36px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    transition: var(--transition-slow);
    cursor: pointer;
    border: none;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(216, 30, 5, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
    padding-top: 90px;
    background-color: #101921;
}

.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(16, 25, 33, 0.9) 0%, rgba(16, 25, 33, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    max-width: 900px;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
}

.hero-content.active {
    opacity: 1;
    transform: translateY(0);
}

.hero h1 {
    margin-bottom: 2rem;
}

.hero p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 700px;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

/* Marquee / Partners */
.partners-section {
    padding: 60px 0;
    background: var(--bg-off-white);
}

.partners-title {
    text-align: center;
    margin-bottom: 40px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--secondary-color);
}

.marquee {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 20px 0;
}

.marquee-content {
    display: inline-flex;
    gap: 100px;
    animation: marquee 30s linear infinite;
}

.partner-logo {
    font-size: 2rem;
    font-weight: 900;
    color: #ccc;
    filter: grayscale(1);
    opacity: 0.6;
    transition: var(--transition-fast);
}

.partner-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    color: var(--secondary-color);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Products Section */
.section-padding {
    padding: 120px 0;
}

.section-tag {
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: block;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #eee;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: var(--transition-slow);
    transform-origin: bottom;
}

.product-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-strong);
    border-color: transparent;
}

.product-card:hover::before {
    transform: scaleY(1);
}

.product-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.product-card h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.product-card p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1rem;
}

.learn-more {
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

/* Stats Section */
.stats {
    background: var(--accent-color);
    color: white;
    padding: 100px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 50px;
    text-align: center;
}

.stat-item h2 {
    color: white;
    font-size: 4rem;
    margin-bottom: 10px;
}

.stat-item p {
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* Multimedia */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.video-card-premium {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 300px;
    cursor: pointer;
}

.video-thumb {
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
    transition: var(--transition-slow);
}

.video-card-premium:hover .video-thumb {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 30px rgba(216, 30, 5, 0.5);
    transition: var(--transition-fast);
}

.video-card-premium:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: white;
    color: var(--primary-color);
}

/* Footer */
footer {
    background: #0a0f14;
    color: white;
    padding: 100px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

.footer-logo {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-col h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #555;
    font-size: 0.9rem;
}

/* Consulting Section */
.consulting-section {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 100px 0;
}

.consulting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.consulting-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.consulting-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.consulting-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: block;
}

.consulting-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

.consulting-item p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* Related Content SEO Section */
.related-content {
    background-color: var(--bg-off-white);
    padding: 60px 0;
    border-top: 1px solid #eee;
}

.related-content h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.related-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-links li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.related-links li a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.related-search {
    margin-top: 40px;
    max-width: 400px;
    position: relative;
}

.related-search input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-family: var(--font-main);
}

.related-search i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        height: 70px;
    }

    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* PDF Download Button Hover Effect */
a[href$=".pdf"]:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3) !important;
}

/* WhatsApp Floating Widget - Subtle Version */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.whatsapp-btn {
    width: 65px;
    height: 65px;
    background: rgba(37, 211, 102, 0.1);
    /* Prácticamente transparente */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(37, 211, 102, 0.2);
    /* Icono muy clarito */
    font-size: 2.2rem;
    box-shadow: none;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid rgba(37, 211, 102, 0.05);
}

.whatsapp-btn:hover {
    background: #25d366;
    /* Color original al pasar el cursor */
    color: white;
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
    border-color: transparent;
}

.whatsapp-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #25d366;
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: all 0.5s ease;
}

.whatsapp-btn:hover::after {
    animation: whatsapp-pulse 2s infinite;
    opacity: 1;
}

@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.whatsapp-tooltip {
    position: absolute;
    right: 80px;
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-strong);
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-widget:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Visitor Counter Tag - Subtle Version */
.visitor-counter {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.05);
    /* Prácticamente invisible */
    backdrop-filter: blur(2px);
    padding: 8px 15px;
    border-radius: 50px;
    color: rgba(0, 0, 0, 0.15);
    /* Texto muy clarito */
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    cursor: default;
    user-select: none;
}

.visitor-counter:hover {
    background: rgba(16, 25, 33, 0.9);
    /* Se enciende al pasar el cursor */
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
    border-color: rgba(255, 255, 255, 0.1);
}

.visitor-dot {
    width: 6px;
    height: 6px;
    background: rgba(39, 174, 96, 0.2);
    /* Punto muy suave */
    border-radius: 50%;
    transition: all 0.4s ease;
}

.visitor-counter:hover .visitor-dot {
    background: #27ae60;
    /* Punto brilla al pasar el cursor */
    box-shadow: 0 0 10px #27ae60;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}