:root {
    --gold: #C9A227;
    --gold-light: #D4AF37;
    --gold-dark: #B8860B;
    --black: #0D0D0D;
    --black-light: #1A1A1A;
    --white: #ffffff;
    --light: #F8F9FA;
    --cream: #FFFDF5;
    --text: #2D3436;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1300px; margin: 0 auto; padding: 0 40px; }
.section-padding { padding: 120px 0; }
.mt-20 { margin-top: 25px; }

/* NAVBAR */
#navbar {
    position: fixed;
    top: 0; width: 100%; z-index: 2000;
    padding: 20px 0; transition: var(--transition);
}

#navbar.scrolled {
    background: var(--white);
    padding: 10px 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo-wrapper img {
    height: 110px;
    transition: var(--transition);
}

#navbar.scrolled .logo-wrapper img { height: 65px; }

.nav-links { display: flex; list-style: none; align-items: center; }
.nav-links a {
    text-decoration: none; color: var(--white);
    margin-left: 40px; font-weight: 600; font-size: 0.95rem;
}

#navbar.scrolled .nav-links a { color: var(--black); }

.nav-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: white !important;
    padding: 12px 28px; border-radius: 50px;
    border: none;
}

.nav-btn:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.3);
}

/* LANGUAGE SELECTOR */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 25px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: var(--transition);
    opacity: 0.6;
}

.lang-btn:hover { opacity: 1; }
.lang-btn.active { opacity: 1; color: var(--gold); }

.lang-divider {
    color: var(--white);
    opacity: 0.4;
    font-weight: 300;
}

#navbar.scrolled .lang-btn { color: var(--black); }
#navbar.scrolled .lang-btn.active { color: var(--gold); }
#navbar.scrolled .lang-divider { color: var(--black); }

/* HERO */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    color: var(--white);
    overflow: hidden;
}

/* Hero Carousel */
.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(70deg, rgba(0,0,0,0.85), rgba(13,13,13,0.75), rgba(0,0,0,0.6));
    z-index: 2;
}

.hero-content { position: relative; z-index: 10; max-width: 900px; padding-top: 80px; }
.hero h1 { font-size: 3.2rem; line-height: 1.25; margin-bottom: 25px; font-weight: 400; }
.hero-highlight { color: var(--gold-light); font-weight: 700; display: block; font-size: 3.8rem; margin-bottom: 10px; }
.hero p { font-size: 1.3rem; opacity: 0.9; margin-bottom: 45px; max-width: 650px; }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: white; padding: 20px 45px;
    text-decoration: none; border-radius: 50px; font-weight: 700;
    transition: var(--transition); display: inline-block;
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(201, 162, 39, 0.4);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

/* SCROLL INDICATOR */
.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
}
.mouse {
    width: 25px; height: 40px; border: 2px solid var(--white); border-radius: 20px;
    display: flex; justify-content: center; padding-top: 8px;
}
.wheel { width: 4px; height: 8px; background: var(--gold); border-radius: 2px; animation: scrollWheel 1.5s infinite; }
.arrow span {
    display: block; width: 10px; height: 10px; border-bottom: 2px solid var(--gold);
    border-right: 2px solid var(--gold); transform: rotate(45deg); margin: 5px; animation: arrowFade 2s infinite;
}

@keyframes scrollWheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(15px); opacity: 0; } }
@keyframes arrowFade { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }

/* SERVICES */
#servicios {
    background: linear-gradient(135deg, var(--black) 0%, var(--black-light) 100%);
    position: relative;
}

#servicios::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(201,162,39,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

#servicios .container {
    position: relative;
    z-index: 1;
}

.services-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 80px; }
.tag { color: var(--gold-light); font-weight: 800; letter-spacing: 2px; font-size: 0.8rem; }
.services-header h2 { font-size: 3rem; color: var(--white); margin-top: 10px; }
.desc-block p { max-width: 450px; color: #b8b8b8; font-size: 1.1rem; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.service-card {
    position: relative;
    padding: 50px 40px;
    border-radius: 15px;
    transition: var(--transition);
    border: 1px solid rgba(201,162,39,0.2);
    overflow: hidden;
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(10px);
}

/* Card background image */
.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    transition: var(--transition);
}

.card-content {
    position: relative;
    z-index: 2;
}

/* Individual card backgrounds */
.service-card-1 .card-bg { background-image: url('img/cards/card-1.jpg'); }
.service-card-2 .card-bg { background-image: url('img/cards/card-2.jpg'); }
.service-card-3 .card-bg { background-image: url('img/cards/card-3.jpg'); }
.service-card-4 .card-bg { background-image: url('img/cards/card-4.jpg'); }
.service-card-5 .card-bg { background-image: url('img/cards/card-5.jpg'); }
.service-card-6 .card-bg { background-image: url('img/cards/card-6.jpg'); }

.service-card:hover {
    border-color: var(--gold);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(201,162,39,0.4);
    background: rgba(26, 26, 26, 0.75);
}
.service-card:hover .card-bg { opacity: 0.40; }

.icon-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(201,162,39,0.2);
}
.service-card h3 { color: var(--white); margin-bottom: 15px; font-weight: 600; }
.service-card p { color: #d1d1d1; line-height: 1.7; }
.service-card { cursor: pointer; }

/* SERVICE MODAL */
.service-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.service-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--black-light), var(--black));
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    border-radius: 20px;
    border: 1px solid rgba(201, 162, 39, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(201, 162, 39, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    font-size: 1.2rem;
}

.modal-close:hover {
    background: var(--gold);
    color: var(--black);
}

.modal-header {
    position: relative;
    padding: 60px 40px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.2);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: padding 0.3s ease;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(13, 13, 13, 0.75));
    z-index: 1;
}

.modal-header h2 {
    color: var(--white);
    font-size: 2rem;
    margin: 0;
    padding-right: 40px;
    position: relative;
    z-index: 2;
    transition: font-size 0.3s ease;
}

/* Modal header scroll effect */
.modal-header.scrolled {
    padding: 25px 40px;
}

.modal-header.scrolled h2 {
    font-size: 1.5rem;
}

.modal-body {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.modal-body #modalDescription {
    color: #d1d1d1;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.modal-link {
    margin: 20px 0;
}

.modal-link a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.modal-link a:hover {
    color: var(--gold);
    gap: 12px;
}

.background-title {
    color: var(--gold);
    font-size: 1.5rem;
    margin: 30px 0 20px 0;
    border-bottom: 2px solid rgba(201, 162, 39, 0.3);
    padding-bottom: 10px;
}

.background-content {
    color: #d1d1d1;
    line-height: 1.8;
}

.background-content ul {
    list-style: none;
    padding: 0;
}

.background-content li {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--gold);
    border-radius: 8px;
}

/* CERES Alimentos brand section in modal */
.ceres-alimentos-brand {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(201, 162, 39, 0.2);
}

.ceres-alimentos-brand img {
    width: 80px;
    height: auto;
    flex-shrink: 0;
}

.ceres-alimentos-brand div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ceres-alimentos-brand strong {
    color: var(--gold);
    font-size: 1.3rem;
}

.ceres-alimentos-brand em {
    color: #d1d1d1;
    font-style: italic;
    font-size: 1rem;
}

.background-content li strong {
    color: var(--gold-light);
    display: block;
    margin-bottom: 8px;
}

.background-content li strong i {
    margin-right: 8px;
    color: var(--gold);
}

.background-content li em {
    color: var(--gold-light);
    font-style: italic;
}

.background-content p {
    margin-bottom: 15px;
}

/* MODAL RESPONSIVE */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 15px;
        margin: 10px;
    }

    .modal-header {
        padding: 25px 20px;
        min-height: auto;
    }

    .modal-header.scrolled {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
        padding-right: 50px;
        line-height: 1.3;
    }

    .modal-header.scrolled h2 {
        font-size: 1.1rem;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .modal-body {
        padding: 20px;
        max-height: calc(95vh - 100px);
    }

    .modal-body #modalDescription {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 15px;
    }

    .background-title {
        font-size: 1.2rem;
        margin: 20px 0 15px 0;
    }

    .background-content li {
        padding: 15px;
        margin-bottom: 15px;
        font-size: 0.9rem;
    }

    .background-content li strong {
        font-size: 0.95rem;
    }

    .ceres-alimentos-brand {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 15px;
    }

    .ceres-alimentos-brand img {
        width: 60px;
    }

    .ceres-alimentos-brand strong {
        font-size: 1.1rem;
    }

    .ceres-alimentos-brand em {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .modal-body {
        padding: 15px;
        max-height: calc(100vh - 80px);
    }

    .background-content li {
        padding: 12px;
        font-size: 0.85rem;
    }
}

/* BRANDS SLIDER (HOVER CORREGIDO) */
.brands-section {
    background: linear-gradient(180deg, var(--black-light) 0%, var(--black) 100%);
    position: relative;
}

.brands-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(201,162,39,0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(201,162,39,0.05) 0%, transparent 50%);
    z-index: 0;
}

.brands-section .container {
    position: relative;
    z-index: 1;
}

.brand-intro { text-align: center; margin-bottom: 60px; }
.brand-intro h3 { font-size: 1.8rem; color: var(--white); }
.divider { width: 60px; height: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); margin: 20px auto; border-radius: 2px; }
.logo-slider {
    width: 100%;
    overflow: hidden;
    padding: 40px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
}
.logo-track { display: flex; width: calc(300px * 12); animation: scroll 30s linear infinite; align-items: center; }
.logo-item {
    width: 300px;
    padding: 0 50px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    opacity: 0.8;
    filter: grayscale(100%);
    transition: var(--transition);
}

/* HOVER EFECTO LOGOS */
.logo-item:hover img {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
}
.logo-track:hover { animation-play-state: paused; }

/* MiCo BioMed logo - filtro blanco para visibilidad */
.logo-item-mico img {
    filter: brightness(0) invert(1);
    max-height: 100px;
    opacity: 0.9;
}
.logo-item-mico:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* CERES Alimentos logo con cambio de imagen en hover */
.logo-item-ceres-alimentos {
    position: relative;
}
.logo-item-ceres-alimentos .logo-nocolor {
    filter: grayscale(100%);
    opacity: 0.8;
}
.logo-item-ceres-alimentos .logo-color {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: none;
    opacity: 0;
}
.logo-item-ceres-alimentos:hover .logo-nocolor {
    opacity: 0;
}
.logo-item-ceres-alimentos:hover .logo-color {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-300px * 6)); } }

/* FOOTER */
.footer { background: var(--black); color: white; padding: 100px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1.5fr 1fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid rgba(201,162,39,0.15); }
.footer-logo { height: 100px; margin-bottom: 25px; }
.footer-grid h4 { font-size: 1.1rem; margin-bottom: 20px; color: var(--gold); display: flex; align-items: center; gap: 10px; }
.footer-grid p { color: #9ca3af; font-size: 0.95rem; margin-bottom: 10px; }
.footer-bottom { text-align: center; padding-top: 40px; font-size: 0.85rem; color: #6b7280; }

/* RESPONSIVE NAVIGATION */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 2001;
}

.hamburger-bar {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--white);
    margin: 6px 0;
    transition: var(--transition);
}

#navbar.scrolled .hamburger-bar { background-color: var(--black); }

/* GENERAL RESPONSIVE STYLES */
@media (max-width: 992px) {
    .container { padding: 0 30px; }
    .section-padding { padding: 80px 0; }

    /*- Navbar responsive */
    .nav-links-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(13, 13, 13, 0.95);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: var(--transition);
    }

    .nav-links-wrapper.active { transform: translateX(0); }
    .nav-links { flex-direction: column; gap: 15px; }
    .nav-links li { text-align: center; }
    .nav-links a {
        color: var(--white);
        font-size: 1.3rem;
        margin: 0;
        padding: 12px 20px;
        display: block;
    }
    #navbar.scrolled .nav-links a { color: var(--white); }

    .nav-btn { padding: 15px 40px; margin-top: 25px; }
    .hamburger { display: block; }
    .hamburger.active .hamburger-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .hamburger-bar:nth-child(2) { opacity: 0; }
    .hamburger.active .hamburger-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /*- Logo responsive */
    .logo-wrapper img { height: 85px; }
    #navbar.scrolled .logo-wrapper img { height: 55px; }
    .footer-logo { height: 80px; }

    /*- Language selector responsive */
    .lang-selector {
        position: absolute;
        top: 50%;
        right: 70px;
        transform: translateY(-50%);
        margin-left: 0;
    }

    /*- Hero responsive */
    .hero { height: 100vh; text-align: center; }
    .hero-content { max-width: 100%; }
    .hero h1 { font-size: 1.8rem; }
    .hero-highlight { font-size: 2.2rem; }
    .hero p { font-size: 1.1rem; max-width: 100%; }

    /*- Services responsive */
    .services-header { flex-direction: column; align-items: flex-start; text-align: left; margin-bottom: 50px; }
    .services-header h2 { font-size: 2.5rem; }
    .desc-block { margin-top: 15px; }
    .desc-block p { max-width: 100%; }
    .services-grid { grid-template-columns: 1fr; gap: 30px; }
    .service-card { padding: 40px 30px; }
    
    /*- Brands responsive */
    .brand-intro h3 { font-size: 1.5rem; }

    /*- Footer responsive */
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
    .hero h1 { font-size: 1.4rem; line-height: 1.4; }
    .hero-highlight { font-size: 1.8rem; margin-bottom: 8px; }
    .hero p { font-size: 0.95rem; }
    .btn-primary { padding: 16px 30px; font-size: 0.9rem; }
    .services-header h2 { font-size: 2rem; }

    /*- Logo smaller screens */
    .logo-wrapper img { height: 70px; }
    #navbar.scrolled .logo-wrapper img { height: 50px; }
    .footer-logo { height: 70px; }
}