:root {
    /* Core Colors */
    --primary: #00E676;
    --primary-dark: #00C853;
    
    /* Semantic Colors (Dark Default) */
    --bg-main: #050505;
    --bg-card: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    
    --mesh-1: #0a1a10;
    --mesh-2: #000000;
    --mesh-3: #0f241a;
    
    --glow-primary: 0 0 20px rgba(0, 230, 118, 0.4);
}

[data-theme="light"] {
    /* Light Mode Overrides */
    --bg-main: #f0f2f5; 
    --bg-card: rgba(255, 255, 255, 0.9); /* Opaque for contrast */
    --text-main: #111111;
    --text-muted: #444444; 
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-highlight: rgba(0, 0, 0, 0.05);
    
    --mesh-1: #e0e8e4;
    --mesh-2: #f5f7fa;
    --mesh-3: #d0f0dd;
    
    --primary: #00C853; 
}

/* Light Mode Specific Overrides */
[data-theme="light"] #main-header {
    background: rgba(240, 240, 240, 0.95); /* Silver/White */
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

[data-theme="light"] .hero-content h1 {
    background: linear-gradient(to right, #222, #777); /* Dark Grey to Silver */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

[data-theme="light"] .service-card {
    background: rgba(255,255,255,0.9); 
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

[data-theme="light"] .service-icon {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-dark);
}

[data-theme="light"] .service-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 200, 83, 0.2);
}

[data-theme="light"] nav ul li a {
    color: #333;
}

[data-theme="light"] nav ul li a:hover {
    color: var(--primary-dark);
}

[data-theme="light"] .mobile-menu-btn span {
    background-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
    
    /* Mesh Gradient Background */
    background-image: 
        radial-gradient(at 0% 0%, var(--mesh-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--mesh-3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--mesh-2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, var(--mesh-1) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: 100% 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: transparent; /* Start transparent */
    transition: all 0.3s ease;
}

#main-header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}

/* Light Mode Header - Always White-ish */
[data-theme="light"] #main-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="light"] #main-header.scrolled {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Ensure links toggle color correctly */
[data-theme="light"] nav a {
    color: #333 !important; /* Force dark text */
}

/* Logo: User requested ORIGINAL colors. Removed filter: invert(1). */
[data-theme="light"] .logo {
    /* No filter */
}

/* Light Mode Services Background Fix */
[data-theme="light"] #services {
    background: #f0f2f5; /* Light uniform background */
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary);
}

.theme-btn {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--glass-highlight);
    border-color: var(--primary);
    transform: rotate(15deg);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 200, 83, 0.5);
}

/* Hero Section */
/* Removed duplicate .hero block to favor #hero */
/* Animated background mesh (pseudo-element) */
#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 230, 118, 0.08) 0%, transparent 50%);
    animation: rotateBackground 20s linear infinite;
    z-index: 0;
}

@keyframes rotateBackground {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

/* Removed duplicate .hero-content h1 causing blur */
.hero-content .highlight {
    /* Maintained by later rule */
}

/* Hero Specific Buttons */
#hero .btn-secondary {
    background: rgba(0, 0, 0, 0.6); /* Semi-transparent dark background */
    color: #ffffff;
    border-color: #ffffff;
    backdrop-filter: blur(4px);
}
#hero .btn-secondary:hover {
    background: #ffffff;
    color: var(--primary-dark);
    border-color: #ffffff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--glass-highlight);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    background: url('assets/portada_st.png') no-repeat center center/cover;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0.3), var(--dark-bg));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 700;
    color: #ffffff;
    /* Removed background-clip gradient to fix blurry/unfocused look */
    text-shadow: 0 2px 5px rgba(0,0,0,0.7); /* Sharp shadow for contrast */
}

.hero-content h1 .highlight {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--primary);
    text-shadow: 0 2px 5px rgba(0,0,0,0.8); /* Maintain contrast */
}

.hero-content p {
    font-size: 1.25rem;
    color: #ffffff; /* Force white, was text-muted */
    margin-bottom: 40px;
    max-width: 600px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9); /* Strong shadow for small text */
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center; /* Center buttons */
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    nav {
        display: none; /* Mobile menu implementation usually goes here */
    }
}

/* Sections General */
.section-padding {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header .highlight {
    color: var(--primary);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
#about {
    background-color: var(--bg-main);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* Services Grid */
#services {
    background: radial-gradient(circle at center, #111 0%, #0a0a0a 100%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(0, 200, 83, 0.1);
    padding: 20px;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.2) rotate(5deg);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Contact Section */
/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.map-info {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.map-info h3, .contact-wrapper h3 {
    margin-bottom: 20px;
    color: var(--text-main);
    font-size: 1.5rem;
}

.address {
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-wrapper {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

.btn-full {
    display: block;
    text-align: center;
    width: 100%;
}

.contact-wrapper {
    width: 100%;
}

/* Success Stories */
#projects {
    background-color: var(--bg-main);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.project-image {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.project-category {
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-content {
    padding: 30px;
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.project-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: gap 0.3s ease;
}

.project-link:hover {
    gap: 15px;
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Footer */
footer {
    background-color: var(--bg-main);
    padding: 60px 0 20px;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* WhatsApp Button */
.whatsapp-btn {
    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;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    nav {
        display: none; /* Default hidden */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 999;
    }

    nav.active {
        display: flex; /* Shown when active */
    }

    nav ul {
        flex-direction: column;
        gap: 40px;
    }

    nav a {
        font-size: 1.5rem;
    }

    /* Hamburger Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

/* Utilities */
.no-scroll {
    overflow: hidden;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Internal Pages & Catalog */
.page-header {
    padding: 150px 0 80px;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(10,10,10,0.8) 100%);
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .page-header {
    background: #f0f2f5;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="light"] .page-header h1 {
    color: #111; /* Ensure title is visible */
}

.breadcrumbs {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.catalog-section {
    padding: 80px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.product-image {
    height: 200px;
    background-color: #222; /* Placeholder color */
    background-size: cover;
    background-position: center;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 100%);
}

.product-content {
    padding: 25px;
}

.product-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.product-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-small {
    display: inline-block;
    padding: 8px 20px;
    background: var(--glass-highlight);
    color: var(--primary);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary);
    color: white;
}

/* Carousel Styles */
.carousel-container {
    margin-top: 40px;
    position: relative;
}
.carousel-main {
    position: relative;
    height: 400px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block; /* Ensure it renders */
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    border-radius: 5px;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn:hover { background: rgba(0,0,0,0.8); }

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.carousel-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    border: 2px solid transparent;
}
.carousel-thumb:hover, .carousel-thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

/* --- HOME PAGE CAROUSEL --- */
.carousel-wrapper-home {
    position: relative;
    padding: 0 40px; /* Space for buttons */
}
.projects-track-container {
    overflow: hidden;
    width: 100%;
}
.projects-track {
    display: flex;
    gap: 30px;
    transition: transform 0.5s ease-in-out;
    padding: 20px 5px; /* Padding for shadow/hover effects */
}
/* Override project-card for carousel */
#projects .project-card {
    min-width: 320px; /* Fixed width for consistent slide */
    flex: 0 0 320px;
    transition: transform 0.3s ease, border 0.3s ease;
}

@media (max-width: 768px) {
    #projects .project-card {
        min-width: 280px;
        flex: 0 0 280px;
    }
    .carousel-wrapper-home {
        padding: 0;
    }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.carousel-nav.prev { left: 0; }
.carousel-nav.next { right: 0; }
.carousel-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
