:root {
    --primary-color: #2D5A27;
    /* Deep Olive Green */
    --secondary-color: #6D4C41;
    /* Earthy Brown */
    --accent-color: #D4AF37;
    /* Gold/Wheat */
    --text-dark: #1A1A1A;
    --text-light: #F5F5F5;
    --bg-cream: #FCFAF7;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background: linear-gradient(135deg, #FCFAF7 0%, #F0F4EF 100%);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    z-index: 1000;
    transition: var(--transition);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 50px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-color);
}

nav.scrolled .nav-links a:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    min-height: 80vh;
    background: url('Vacuno de lidia.jpeg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 0 10%;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #58181F;
    /* Purple Pecuario */
    opacity: 0;
    /* Initially transparent (showing photo) */
    transition: opacity 0.5s ease;
    z-index: 1;
}

.hero:hover::before {
    opacity: 1;
    /* On hover, become solid purple via opacity */
}

/* Ensure content is above the overlay */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1.2s ease-out;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.vertical-bar {
    width: 4px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.hero-text-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: -5px;
    font-family: 'Montserrat', sans-serif;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem) !important;
    font-weight: 800 !important;
    margin: 0 !important;
    text-shadow: none !important;
    line-height: 1;
    color: white !important;
    text-transform: none;
}

.hero p {
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 35px;
    opacity: 0.9;
    text-shadow: none;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.cta-button:hover {
    background-color: transparent;
    border-color: white;
    transform: translateY(-5px);
}

/* --- Sections --- */
section {
    padding: 100px 10%;
}

/* Fix navbar button hover on white background */
nav .cta-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* --- Species Cards --- */

/* Category Selection Section */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.cat-card {
    height: 220px;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.cat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.cat-agricola {
    background: url('ganaderia.jpg') no-repeat center center/cover;
    position: relative;
}

/* Green overlay for Agricola card on hover */
.cat-agricola::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    /* Green */
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.cat-agricola:hover::before {
    opacity: 1;
}

.cat-pecuario {
    background: url('fondo.jpg') no-repeat center center/cover;
    position: relative;
}

/* Purple overlay for Pecuario card on hover */
.cat-pecuario::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #58181F;
    /* Deep Wine/Purple */
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.cat-pecuario:hover::before {
    opacity: 1;
}

/* Decorative Icon Styling (Line Art Outline-ish) */
.cat-bg-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%) scale(1);
    font-size: 10rem;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.3);
    opacity: 0.6;
    transition: all 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

.cat-card:hover .cat-bg-icon {
    transform: translate(-50%, -55%) scale(1.1) rotate(-5deg);
    opacity: 0.8;
    -webkit-text-stroke: 3px rgba(255, 255, 255, 0.5);
}

.cat-content {
    position: relative;
    z-index: 3;
    color: white;
}

.cat-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 3px solid white;
    padding-left: 10px;
    color: #ffffff;
}

.cat-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 5px;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
}

.cat-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    margin-top: 10px;
    transition: gap 0.3s;
    font-size: 0.9rem;
}

.cat-card:hover .cat-arrow {
    gap: 15px;
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.species-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    text-align: left;
}

.species-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.card-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.species-card:hover .card-img {
    transform: scale(1.1);
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.card-body h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.2;
}

.card-link {
    margin-top: auto;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.card-link:hover {
    gap: 12px;
}

/* --- Features Section --- */
.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.feature-item {
    text-align: center;
    padding: 40px 30px;
    background: white;
    border-radius: 20px;
    border: 1px solid #E0E0E0;
    transition: var(--transition);
}

/* Alternating Colors: Odd items get Olive Green (Primary), Even stay White */
.feature-item:nth-child(odd) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.feature-item:nth-child(odd) .feature-icon {
    color: white;
    /* Make icon white on green background */
}

.feature-item:nth-child(odd) h3 {
    color: white;
    /* Make title white on green background */
}

.feature-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.feature-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

/* --- Contact & Footer --- */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 10% 20px;
    text-align: center;
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    section {
        padding: 60px 5%;
    }
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.4s ease-out;
    text-align: center;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Visitor Counter Badge */
.visitor-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgba(30, 30, 30, 0.2);
    /* Much more transparent */
    color: rgba(255, 255, 255, 0.7);
    /* Slightly faded text */
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    z-index: 9999;
    backdrop-filter: blur(4px);
    /* Reduced blur initially */
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Faint border */
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    /* No shadow initially */
    transition: all 0.4s ease;
    user-select: none;
    cursor: default;
    opacity: 0.6;
    /* Semi-transparent element */
}

.visitor-badge:hover {
    background-color: rgba(30, 30, 30, 0.9);
    /* Solid dark on hover */
    color: rgba(255, 255, 255, 1);
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.visitor-badge i {
    color: var(--accent-color);
    /* Gold/Yellow accent */
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.visitor-badge:hover i {
    opacity: 1;
}