/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
:root {
    /* Black & White Premium Palette */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F8F9FA;
    --color-bg-dark: #0A0A0A;
    --color-bg-dark-accent: #1A1A1A;
    
    --color-text-main: #111111;
    --color-text-muted: #666666;
    --color-text-light: #FFFFFF;
    --color-text-light-muted: #CCCCCC;
    
    --color-border: #EAEAEA;
    --color-border-dark: #333333;
    
    /* Typography */
    --font-primary: 'Outfit', sans-serif;
    
    /* Layout */
    --container-width: 1200px;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-speed) ease;
}

ul {
    list-style: none;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(3rem, 5vw, 5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Components
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 100px; /* Pill shape for modern look */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    border: 2px solid var(--color-bg-dark);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-text-main);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text-light);
    border: 2px solid var(--color-text-light);
}

.btn-outline:hover {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
}

.btn-dark {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    border: 2px solid var(--color-bg-primary);
}

.btn-dark:hover {
    background-color: transparent;
    color: var(--color-text-light);
}

.btn-block {
    width: 100%;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366; /* WhatsApp brand color */
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    color: white;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s ease;
    padding: 1.5rem 0;
    background-color: transparent;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
    /* Invert colors if on dark background, but our nav will be white mostly.
       If we want to start transparent on a dark image, we can use CSS filters.
       Since the hero image might be light or dark, we'll give the nav a white gradient or solid color when scrolled */
}

/* Adjust logo color based on scroll if needed. Since logo is BMP (probably black on white or transparent),
   if it has a white background, it might look odd on transparent. Let's force a blend mode or filter. */
.navbar:not(.scrolled) .brand-logo {
    /* If the background hero is dark, make the logo white */
    filter: invert(1) brightness(2);
}

.navbar.scrolled .brand-logo {
    filter: none;
}


.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding: 0.5rem 0;
}

.navbar:not(.scrolled) .nav-links {
    color: var(--color-text-light);
}

.navbar.scrolled .nav-links {
    color: var(--color-text-main);
}

/* Underline animation */
.nav-links::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.nav-links:hover::after, .nav-links.active::after {
    width: 100%;
}

.nav-btn {
    border: 1px solid currentColor;
    padding: 0.5rem 1.5rem !important;
    border-radius: 100px;
}
.nav-btn::after {
    display: none;
}
.navbar:not(.scrolled) .nav-btn:hover {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
}
.navbar.scrolled .nav-btn:hover {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
}

.nav-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-text-light);
}
.navbar.scrolled .bar {
    background-color: var(--color-primary-dark);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.checkbox-group input {
    width: auto;
    padding: 0;
    margin: 0;
}
.checkbox-group a {
    color: var(--color-primary);
    text-decoration: underline;
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-weight: 500;
    display: none;
}
.form-status.success {
    display: block;
    background-color: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border: 1px solid #25D366;
}
.form-status.error {
    display: block;
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--color-text-light);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax effect */
    z-index: -2;
    transform: scale(1.05); /* Slight zoom for animation */
    animation: slowZoom 20s infinite alternate linear;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    z-index: -1;
}

.hero-content {
    max-width: var(--container-width);
    width: 100%;
    padding: 0 2rem;
    z-index: 1;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.hero-content h1 span {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-text-light);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
    color: var(--color-text-light-muted);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   General Sections
   ========================================================================== */
.section-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.services, .contact {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 5rem;
}

/* ==========================================================================
   Services Section (Grid Cards)
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    transition: all 0.4s ease;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Specific styling for the card with image */
.service-card:has(.service-img-container) {
    padding: 0;
    border: none;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
}
.service-img-container {
    height: 200px;
    overflow: hidden;
}
.service-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.service-card:hover .service-img-container img {
    transform: scale(1.1);
}
.service-content-inner {
    padding: 2rem;
}
.service-card:has(.service-img-container) p {
    color: var(--color-text-light-muted);
}


.service-card:not(:has(.service-img-container)):hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    background-color: var(--color-bg-primary);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--color-text-main);
    transition: transform 0.4s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ==========================================================================
   Projects Highlight Section
   ========================================================================== */
.projects-highlight {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 0; /* Handled by internal flex */
}

.projects-split {
    display: flex;
    flex-wrap: wrap;
    min-height: 80vh;
}

.projects-text {
    flex: 1;
    min-width: 300px;
    padding: 8rem 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.projects-text h2 {
    color: var(--color-text-light);
}

.projects-text p {
    color: var(--color-text-light-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.projects-image {
    flex: 1;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

.projects-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-box {
    background-color: var(--color-bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.contact-info {
    flex: 1;
    min-width: 300px;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 4rem;
}

.contact-info h2 {
    color: var(--color-text-light);
}

.contact-info p {
    color: var(--color-text-light-muted);
}

.contact-list {
    margin-top: 3rem;
}

.contact-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-list li i {
    width: 40px;
    font-size: 1.5rem;
}

.contact-form-container {
    flex: 1.5;
    min-width: 300px;
    padding: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

input, textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-secondary);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    color: var(--color-text-main);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-bg-dark);
    background-color: var(--color-bg-primary);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}

/* ==========================================================================
   Acabados (Finishes)
   ========================================================================== */
.finishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.finish-item {
    text-align: center;
    cursor: pointer;
}

.finish-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.finish-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.finish-item:hover .finish-img {
    transform: scale(1.05);
}

.finish-item p {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background-color: var(--color-bg-dark-accent);
    color: var(--color-text-light);
    padding-top: 5rem;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-brand p {
    color: var(--color-text-light-muted);
    margin-top: 1.5rem;
}

.footer-logo {
    height: 40px;
    filter: invert(1) brightness(2);
}

.footer-links h4, .footer-social h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--color-text-light);
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links ul li a {
    color: var(--color-text-light-muted);
}

.footer-links ul li a:hover {
    color: var(--color-text-light);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--color-text-light);
    font-size: 1.2rem;
}

.social-icons a:hover {
    background-color: var(--color-text-light);
    color: var(--color-bg-dark);
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: var(--color-bg-dark);
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border-dark);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-light-muted);
}

/* ==========================================================================
   Products Section
   ========================================================================== */
.products {
    background-color: var(--color-bg-secondary);
    padding: 8rem 0;
}

.products-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--color-border-dark);
    background-color: transparent;
    color: var(--color-text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    border-color: var(--color-bg-dark);
}

.loading-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.product-card {
    background-color: var(--color-bg-primary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-img-container {
    height: 250px;
    background-color: var(--color-bg-secondary);
    overflow: hidden;
    display: block;
    border-bottom: 1px solid var(--color-border);
    transition: height 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), background-color 0.6s ease;
}

.product-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease; /* No animamos object-fit porque no todos los navegadores lo soportan bien */
}

.product-card:hover .product-img-container {
    height: 450px; /* Expande el espacio de la imagen hacia abajo empujando el texto */
    background-color: #fff; /* Fondo blanco para que el diagrama destaque limpio */
}

.product-card:hover .product-img-container img {
    object-fit: contain; /* Pasa de panorámico a encajado entero */
    transform: scale(1); /* Quitamos el zoom para que se vea todo el plano */
    padding: 1rem;
}

.product-header {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-bg-dark-accent);
}

.product-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.product-badge {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.product-body {
    padding: 2rem;
}

.product-features {
    margin-bottom: 2rem;
}

.product-features li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.product-features li i {
    color: var(--color-bg-dark);
    margin-top: 5px;
    margin-right: 15px;
    font-size: 0.9rem;
}

.product-downloads {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.product-downloads h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.downloads-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    color: var(--color-text-main);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    border-color: var(--color-bg-dark);
}

.download-btn i {
    font-size: 1.1rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 992px) {
    .projects-text {
        padding: 5rem 2rem;
    }
}

@media screen and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--color-bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-links, .navbar:not(.scrolled) .nav-links {
        color: var(--color-text-light);
        font-size: 1.5rem;
    }
    
    .nav-toggle {
        display: block;
        z-index: 1001;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        background-color: var(--color-text-light);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        background-color: var(--color-text-light);
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info, .contact-form-container {
        padding: 3rem 2rem;
    }
}

/* ==========================================================================
   Cookie Banner
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 1.5rem 2rem;
    z-index: 9999;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}
.cookie-banner.appear {
    transform: translateY(0);
}
.cookie-content {
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    width: 100%;
}
.cookie-content p {
    margin: 0;
    font-size: 0.95rem;
}
.cookie-content a {
    color: var(--color-primary);
    text-decoration: underline;
}
.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}
.cookie-buttons .btn-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}
@media screen and (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}
