:root {
    /* Brand Colors (Based on #002F2F) */
    --primary: #002F2F;
    --primary-light: #004d4d;
    --primary-dark: #001515;
    --accent: #D4AF37;
    /* Gold/Complementary for contrast */
    --accent-hover: #c5a020;

    /* Analogous Colors */
    --teal-1: #004445;
    --teal-2: #2c7873;
    --teal-3: #6fb98f;

    /* Neutrals */
    --dark-grey: #333333;
    --text-color: #334155;
    --bg-light: #F4F7F6;
    --bg-white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.85);

    /* Fonts */
    --font-header: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

img {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
.brand-name {
    font-family: var(--font-header);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.preloader-content {
    text-align: center;
}

#preloader-logo {
    width: 220px;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.loader-bar {
    width: 100px;
    height: 4px;
    background: #eee;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 40px;
    height: 100%;
    background: var(--primary);
    position: absolute;
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    from {
        left: -40px;
    }

    to {
        left: 100px;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header & Nav */
#main-header {
    height: 90px;
    display: flex;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(0, 30, 30, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#main-header.scrolled {
    background: var(--bg-white) !important;
    /* Solid on scroll */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    height: 75px;
    border-bottom: none;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

#main-header.scrolled .menu-toggle {
    color: var(--primary);
}

.logo {
    background-color: #FFFFFF;
    width: 150px;
}

.logo img {
    width: 100%;
    padding-top: 60px;
}


.brand-name {
    font-size: 1.5rem;
    color: white;
    /* White initially */
    transition: var(--transition);
}

#main-header.scrolled .brand-name {
    color: var(--primary);
    /* Dark on scroll */
}

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

.nav-links a {
    text-decoration: none;
    color: white;
    /* White initially */
    font-weight: 500;
    transition: var(--transition);
}

#main-header.scrolled .nav-links a {
    color: var(--text-color);
    /* Dark on scroll */
}

.nav-links a:hover {
    color: var(--accent);
}

/* Nav CTA Button */
.nav-links .btn-nav-cta {
    background: var(--accent);
    color: var(--primary) !important;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.nav-links .btn-nav-cta:hover {
    background: var(--accent-hover);
    color: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* WhatsApp Nav Button */
.nav-links .whatsapp-btn {
    background: #25D366;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.nav-links .whatsapp-btn:hover {
    background: #128C7E;
    color: white !important;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn i {
    font-size: 1.2em;
}

/* Theme Toggle Button */
.btn-theme {
    background: transparent;
    border: none;
    color: white;
    /* Always white on transparent header */
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    display: flex;
    align-items: center;
}

#main-header.scrolled .btn-theme {
    color: var(--text-color);
    /* Changes to dark/light on scroll */
}

.btn-theme:hover {
    color: var(--accent);
    transform: scale(1.1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --primary: #008080;
    /* Brighter teal for contrast on dark background */
    --primary-light: #00bfbf;
    --primary-dark: #001a1a;
    --text-color: #f1f1f1;
    --dark-grey: #e0e0e0;
    --bg-light: #181818;
    --bg-white: #121212;
    --glass-bg: rgba(18, 18, 18, 0.85);
}

[data-theme="dark"] .logo {
    background-color: #FFFFFF;
    /* Ensure logo bg stays white since it's SVG with dark text */
    border-radius: 0 0 10px 10px;
}

[data-theme="dark"] #main-header.scrolled {
    background: var(--bg-white) !important;
}

[data-theme="dark"] .dropdown-content {
    background-color: #222;
}

[data-theme="dark"] #main-header.scrolled .dropdown-content a:hover {
    background-color: #333;
}

[data-theme="dark"] .mvv-card {
    background: #1e1e1e;
}

[data-theme="dark"] .service-card {
    background: #1e1e1e;
}

[data-theme="dark"] .contact-form-container {
    background: #000000;
    color: var(--text-color);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: #2c2c2c;
    color: #f1f1f1;
    border: 1px solid #444;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(0, 47, 47, 0.95);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    top: 100%;
}

#main-header.scrolled .dropdown-content {
    background-color: var(--bg-white);
}

.dropdown-content a {
    color: white !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

#main-header.scrolled .dropdown-content a {
    color: var(--text-color) !important;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent) !important;
}

#main-header.scrolled .dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown>a::after {
    content: '▼';
    font-size: 0.6em;
    vertical-align: middle;
    margin-left: 6px;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(to bottom, rgba(0, 20, 20, 0.8), rgba(0, 47, 47, 0.6)), url('img/laboratorio.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 1024px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-btns {
    margin-top: 2.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    margin-left: 15px;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Sections */
.section {
    padding: 50px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--teal-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: inline-block;
}

.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    margin: 0 auto;
    border-radius: 4px;
}

.bg-alt {
    background-color: var(--bg-light);
}

/* Grid System */
.grid {
    display: grid;
    gap: 30px;
}

.col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.col-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* About Section */
.about-content {
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.about-image {
    background: url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80&w=1200');
    background-size: cover;
    height: 400px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 30px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 16px;
    color: white;
    text-align: center;
}

/* MVV Cards */
.mvv-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.mvv-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.mvv-card ul {
    list-style: none;
    text-align: left;
    display: inline-block;
}

.mvv-card li::before {
    content: '✓';
    color: var(--accent);
    margin-right: 10px;
    font-weight: bold;
}

/* Services */
.service-card {
    background: var(--bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.service-img-container {
    height: 200px;
    overflow: hidden;
}

.service-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-img-container img {
    transform: scale(1.1);
}

.service-info {
    padding: 30px;
}

.service-info h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.service-info p,
.text-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 15px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 47, 47, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
    color: white;
    font-family: var(--font-header);
    font-weight: 600;
}

/* RollOver Blur Effect */
.blur-on-hover:hover img {
    filter: blur(5px);
    transform: scale(1.05);
}

.blur-on-hover:hover .gallery-overlay {
    opacity: 1;
}

/* Contact */
.contact-wrapper {
    background: var(--primary);
    color: white;
    border-radius: 30px;
    padding: 60px;
    margin-top: 50px;
}

.contact-details {
    margin-top: 30px;
}

.detail {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.detail a {
    color: white;
}

.contact-form-container {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 20px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-body);
}

/* Footer */
.main-footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}


.container.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 20px;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.ema-lab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    gap: 40px;
}

.ema-lab img {
    max-width: 540px;
    width: 100%;
}

/* Responsiveness */
@media (max-width: 968px) {

    .grid.col-2,
    .grid.col-3 {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: row;
        /* Ensure they stay side by side */
        justify-content: space-between;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        flex-direction: column;
        background: var(--primary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 40px 0;
        gap: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    #main-header.scrolled .nav-links {
        top: 70px;
        background: var(--bg-white);
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .dropdown-content {
        position: static;
        display: none;
        background-color: transparent;
        box-shadow: none;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        color: white !important;
        text-align: center;
        padding: 5px;
        font-size: 1rem;
    }

    .contact-wrapper {
        padding: 30px;
    }

    .container.footer-content {
        flex-direction: column;
        gap: 15px;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 0 20px;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 300px;
    }

    .btn-secondary {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .mvv-card {
        padding: 25px 15px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-white);
    margin: auto;
    padding: 50px;
    border: none;
    width: 90%;
    max-width: 650px;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(-30px);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.mt-3 {
    margin-top: 15px;
}

.none {
    display: none;
}

/** ALERT **/
.alert {
    color: var(--primary);
    font-size: 1.2rem;
    text-align: center;
}

.contact-form-loader {
    text-align: center;

}
.none {
  display: none;
}

/* Tabs for Contact Forms */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 10px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(0, 47, 47, 0.05);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

[data-theme="dark"] .tabs-nav {
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

[data-theme="dark"] .tab-btn {
    color: #f1f1f1;
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .tab-btn.active {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tab-btn.active::after {
    background: var(--accent);
}

[data-theme="dark"] select[name="tipo"] {
    background: #2c2c2c !important;
    color: #f1f1f1 !important;
    border: 1px solid #444 !important;
}

.documents-pdf {
    margin-top: 4rem;
}
