/* CSS Reset y Variables */
:root {
    --primary-color: #0c7540;
    /* Verde institucional, nutrición */
    --primary-light: #16b363;
    --primary-dark: #074726;
    --secondary-color: #f1b31c;
    /* Acento cálido/agro */
    --text-main: #333333;
    --text-muted: #666666;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;

    /* Gradientes */
    --gradient-hero: linear-gradient(135deg, rgba(12, 117, 64, 0.9) 0%, rgba(7, 71, 38, 0.9) 100%);
    --gradient-text: linear-gradient(90deg, var(--primary-light), var(--secondary-color));

    /* Sombras y transiciones */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.header {
    background: transparent;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-text {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--primary-light);
}

/* Header especifico de pagina productos */
.header-productos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.header-productos .header-content {
    justify-content: center;
}

.header-productos .nav-list a {
    color: var(--primary-color);
    text-shadow: none;
}

.header-productos .nav-list a:hover {
    color: var(--primary-dark);
}

.header-productos .hamburger span {
    background: var(--primary-color);
}



.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-list a {
    font-weight: 600;
    font-size: 1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.nav-list a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 90%;
    max-width: 900px;
}

.hero-text-overlay h1 {
    font-size: 4.5rem;
    font-weight: 900;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.hero-text-overlay p {
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    z-index: 3;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(12, 117, 64, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(12, 117, 64, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.w-100 {
    width: 100%;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-section {
    padding: 5rem 0;
    background: var(--bg-card);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Card 18 - Blog Post Style Replicated in CSS */
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease-in-out;
    height: 100%;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.blog-card-featured {
    flex-direction: column;
}

@media (min-width: 768px) {
    .blog-card-featured {
        flex-direction: row;
        min-height: 350px;
    }

    .blog-card-featured .blog-card-image-wrapper {
        width: 45%;
        height: auto;
        position: relative;
    }

    .blog-card-featured .blog-card-image {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
}

.blog-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .blog-card-featured .blog-card-content {
        padding: 2.5rem;
    }
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.blog-card-tag {
    border-radius: 9999px;
    background-color: rgba(22, 179, 99, 0.1);
    padding: 0.25rem 0.75rem;
    color: var(--primary-light);
}

.blog-card-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

.blog-card-featured .blog-card-title {
    font-size: 1.75rem;
}

.blog-card-title span {
    background-image: linear-gradient(to right, var(--primary-color), var(--primary-color));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease;
    padding-bottom: 2px;
}

.blog-card:hover .blog-card-title span {
    background-size: 100% 2px;
}

.blog-card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.blog-card-btn {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s;
    width: fit-content;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
}

.blog-card-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card-btn i {
    transform: translateX(4px);
}

.blog-card-btn:hover {
    background-color: var(--primary-light);
}

.blog-card-link {
    position: absolute;
    inset: 0;
    z-index: 10;
}

.blog-card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.values-list {
    margin-top: 1rem;
}

.values-list li {
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.values-list i {
    color: var(--primary-color);
    width: 20px;
    margin-top: 4px;
}

/* ==========================================================================
   Gradient Cards (Misión & Valores)
   ========================================================================== */
.gradient-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.gradient-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px) scale(1.02);
}

.gradient-green {
    background: linear-gradient(135deg, #a5d8c3, #81b7a0);
    color: white;
}

.gradient-orange {
    background: linear-gradient(135deg, #d9c49a, #bda678);
    color: white;
}

.gc-badge {
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    width: fit-content;
}

.gc-dot {
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 9999px;
}

.gc-content {
    flex-grow: 1;
    z-index: 10;
    position: relative;
}

.gc-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}

.gc-desc {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 0.95rem;
}

.gc-list {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    list-style: none;
    padding: 0;
}

.gc-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.gc-list i {
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

.gc-monogram {
    position: absolute;
    bottom: -15%;
    right: -10%;
    font-size: 10rem;
    color: rgba(0, 0, 0, 0.08);
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   Catalog Section
   ========================================================================== */
.catalog-section {
    padding: 5rem 0;
}

.catalog-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.catalog-sidebar {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 90px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.catalog-sidebar h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-weight: 500;
}

.category-item:hover {
    background: var(--bg-main);
    color: var(--primary-color);
}

.category-item.active {
    background: var(--primary-color);
    color: white;
}

/* Catalog Main */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.catalog-header h2 {
    font-size: 1.8rem;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 117, 64, 0.1);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.product-card .btn {
    margin-top: auto;
    text-align: center;
}

/* ==========================================================================
   Footer & Contacto
   ========================================================================== */
.contact-section {
    padding: 5rem 0;
    background: var(--bg-main);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 400px;
}

.contact-map {
    height: 100%;
    min-height: 400px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    min-height: 400px;
}

.footer {
    background-color: #111827;
    color: #f9fafb;
    padding: 4rem 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    color: #9ca3af;
    line-height: 1.6;
}

.footer h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: white;
}

.footer ul li {
    margin-bottom: 0.8rem;
    color: #9ca3af;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.footer ul li i {
    margin-top: 4px;
    color: var(--primary-color);
}

.footer ul li a:hover {
    color: white;
}

.footer-bottom {
    background-color: #030712;
    text-align: center;
    padding: 1.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 117, 64, 0.1);
}

.preview-box {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
}

.msg-preview-text {
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--text-main);
}

/* ==========================================================================
   Hamburger Menu
   ========================================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 200;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.35s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .catalog-container {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: relative;
        top: 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* --- Hamburger & Nav --- */
    .hamburger {
        display: flex;
    }

    .nav-list {
        display: flex !important;
        position: fixed;
        top: 0;
        right: -100%;
        left: auto;
        width: 65%;
        height: 100vh;
        background: rgba(7, 40, 20, 0.97);
        backdrop-filter: blur(10px);
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        z-index: 150;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-list.open {
        right: 0;
    }

    .nav-list a {
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        color: white !important;
        /* Forzar blanco en el sidebar oscuro */
    }

    /* --- Hero --- */
    .hero-text-overlay h1 {
        font-size: 2.2rem;
    }

    .hero-text-overlay p {
        font-size: 1rem;
    }

    /* --- Curvas en mobile: más visibles, misma dirección --- */
    .curve-roja {
        top: -4vh !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 32vh !important;
    }

    .curve-amarilla {
        bottom: -4vh !important;
        left: -3% !important;
        width: 103% !important;
        max-height: 32vh !important;
    }

    /* --- Slide images: centrar animales en mobile --- */
    .slide-pigs {
        object-position: 60% center !important;
        /* Desplazado un poco para enfocar al cerdo principal */
    }

    .slide-cows {
        object-position: 72% center !important;
        /* Vaca un poco menos a la derecha */
    }

    .slide-goats {
        object-position: 15% center !important;
    }

    .slide-chickens {
        object-position: 60% center !important;
        /* Pollo un poco menos a la derecha */
    }

    /* --- Intro / About --- */
    .intro-text h1 {
        font-size: 2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    /* --- Catalog --- */
    .catalog-container {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: relative;
        top: 0;
    }

    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .catalog-header h2 {
        font-size: 1.4rem;
    }

    /* --- Product Grid --- */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    /* --- Contact & Footer --- */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-map {
        height: 300px;
        min-height: 300px;
    }

    .contact-map iframe {
        min-height: 300px;
    }

    .contact-info {
        padding: 2rem !important;
        /* Un poco menos de padding en mobile */
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* --- General padding --- */
    .container {
        padding: 0 16px;
    }

    .about-section,
    .catalog-section {
        padding: 3rem 0;
    }

    /* --- Blog / Feature cards --- */
    .blog-card-featured {
        flex-direction: column;
    }

    .blog-card-featured .blog-card-image-wrapper {
        width: 100%;
        height: 220px;
    }

    /* --- Gradient cards --- */
    .gradient-card {
        padding: 1.5rem;
    }

    .gc-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hero-text-overlay h1 {
        font-size: 1.7rem;
    }

    .hero-text-overlay p {
        font-size: 0.9rem;
    }

    .curve-roja {
        max-height: 22vh !important;
    }

    .curve-amarilla {
        max-height: 22vh !important;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
}