/* style.css */
:root {
    --electric-blue: #0066b2; /* Ajustado para parecerse más al azul del botón en la referencia */
    --pure-white: #FFFFFF;
    --light-ash: #F4F4F4;
    --carbon-dark: #171A20;
    --graphite: #393C41;
    --pewter: #5C5E62;
    --silver-fog: #8E8E8E;
    --cloud-gray: #EEEEEE;
    --pale-silver: #D0D1D2;
    --transition-speed: 0.33s;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--graphite);
    background-color: var(--pure-white);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.43;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--carbon-dark);
    font-weight: 500;
}

/* Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: background-color var(--transition-speed);
    background-color: transparent;
}
header.scrolled {
    background-color: var(--pure-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* subtle shadow for readability if needed, though Tesla avoids it */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    max-width: 1440px;
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 101;
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
}

nav ul li a {
    text-decoration: none;
    color: var(--carbon-dark);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color var(--transition-speed);
}
nav ul li a:hover {
    background-color: var(--light-ash);
}

.nav-right {
    display: flex;
    gap: 8px;
}

.nav-icon-btn, .menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: var(--carbon-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-btn {
    display: none;
    z-index: 102;
    position: relative;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-card {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    will-change: transform, box-shadow;
}

.btn-primary {
    background-color: var(--electric-blue);
    color: var(--pure-white);
}
.btn-primary:hover {
    background-color: #004d87;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 102, 178, 0.3);
}

.btn-secondary {
    background-color: var(--pure-white);
    color: var(--graphite);
    border: 1px solid var(--cloud-gray);
}
.btn-secondary:hover {
    background-color: var(--light-ash);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    width: 100vw;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active { opacity: 1; }

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5); /* darken to make text pop */
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 20px;
    animation: fadeInSlideUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInSlideUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-size: 72px;
    font-weight: 700;
    color: var(--pure-white);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 24px;
    color: var(--pure-white);
    margin-bottom: 40px;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Sections */
.section {
    padding: 100px 32px;
    max-width: 1440px;
    margin: 0 auto;
}
.dark-section {
    background-color: var(--carbon-dark);
    max-width: 100%;
    color: var(--pure-white);
}
.light-ash {
    background-color: var(--light-ash);
    max-width: 100%;
}

.section-title {
    font-size: 32px;
    text-align: center;
    margin-bottom: 56px;
}
.text-white { color: var(--pure-white) !important; }
.section-subtitle { text-align: center; margin-top: -40px; margin-bottom: 56px; color: var(--pale-silver); }

/* Products Grid (Reference visual update) */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    justify-items: center;
}

.product-card {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1.1;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #fff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.product-info {
    margin-bottom: 20px;
}

.product-name {
    color: var(--pure-white);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
}

.btn-card {
    background-color: var(--electric-blue);
    color: var(--pure-white);
    width: 100%;
    font-size: 15px;
    padding: 14px;
}
.btn-card:hover {
    background-color: #004d87;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 102, 178, 0.4);
}

/* Map Section */
.map-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 64px auto;
}

.us-map-img {
    width: 100%;
    height: auto;
    filter: invert(1) hue-rotate(180deg) brightness(1.5) contrast(1.2);
    display: block;
}

#map-dots {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

.client-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--pure-white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px 2px rgba(255,255,255,0.8);
    animation: flash 2s infinite alternate;
}

@keyframes flash {
    0% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.8); box-shadow: 0 0 5px 0px rgba(255,255,255,0.4); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); box-shadow: 0 0 15px 4px rgba(255,255,255,1); }
}

/* Counters */
.counters-container {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
}

.counter-box {
    text-align: center;
}

.counter-value {
    font-size: 56px;
    color: var(--pure-white);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.counter-label {
    color: var(--pale-silver);
    font-size: 16px;
}

/* Testimonials */
.testimonials-container {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 16px;
    padding-bottom: 24px;
    max-width: 1440px;
    margin: 0 auto 64px auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.testimonials-container::-webkit-scrollbar { display: none; }

.testimonial-card {
    background-color: var(--pure-white);
    padding: 40px;
    flex: 0 0 350px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    scroll-snap-align: center;
}

.testimonial-text {
    font-size: 16px;
    color: var(--graphite);
    margin-bottom: 24px;
    font-style: italic;
    line-height: 1.6;
}

.testimonial-author {
    font-weight: 600;
    color: var(--carbon-dark);
}

/* Gallery Slideshow */
.gallery-section {
    padding: 80px 32px;
    background-color: var(--carbon-dark);
    color: var(--pure-white);
}

.gallery-slider-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0 60px;
}

.gallery-slides {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 480px;
}

.gallery-slide {
    flex: 0 0 calc((100% - 48px) / 3);
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.gallery-slide img, .gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65);
    display: block;
}

.slide-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 24px 60px 50px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
}

.slide-content h3 {
    color: var(--pure-white);
    font-size: 24px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.slide-features {
    list-style: none;
    margin: 0; padding: 0;
}

.slide-features li {
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.slide-features li::before {
    content: '';
    display: inline-block;
    width: 5px; height: 5px;
    background-color: var(--electric-blue);
    border-radius: 50%;
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    padding: 16px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.3s;
    z-index: 10;
}
.gallery-prev:hover, .gallery-next:hover { background: rgba(255,255,255,0.3); }
.gallery-prev { left: 0; border-radius: 50%; }
.gallery-next { right: 0; border-radius: 50%; }

.gallery-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.indicator {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.indicator.active {
    background: var(--electric-blue);
    transform: scale(1.3);
}
.parallax-section::before {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.4);
}

.parallax-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}
.parallax-content h2 { color: white; font-size: 40px; margin-bottom: 16px; }
.parallax-content p { font-size: 18px; }

/* Contact form */
.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.contact-form-container p { margin-bottom: 32px; font-size: 16px; }
.simple-contact input, .simple-contact textarea {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--pale-silver);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
}
.simple-contact input:focus, .simple-contact textarea:focus {
    outline: none;
    border-color: var(--electric-blue);
}
.simple-contact textarea { resize: vertical; }

/* Footer */
.main-footer {
    background-color: var(--carbon-dark);
    color: var(--pale-silver);
    padding: 64px 32px 100px;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    justify-content: space-between;
    margin-bottom: 48px;
}

.footer-brand h3 {
    color: var(--pure-white);
    font-size: 20px;
    margin-bottom: 16px;
}

.footer-contact h4, .footer-social h4 {
    color: var(--pure-white);
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-contact p {
    margin-bottom: 8px;
}
.footer-contact a {
    color: var(--pale-silver);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-contact a:hover {
    color: var(--pure-white);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.social-link {
    color: var(--pale-silver);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}
.social-link:hover {
    color: var(--pure-white);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
}

/* Modal Form */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(23, 26, 32, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--pure-white);
    width: 100%;
    max-width: 500px;
    padding: 40px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--pewter);
    padding: 4px;
    display: flex;
}
.close-btn:hover { color: var(--carbon-dark); }

.modal-header { margin-bottom: 24px; }
.modal-header h2 { font-size: 24px; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--carbon-dark); }
.form-group input[type="text"], .form-group input[type="tel"] {
    width: 100%; padding: 12px;
    border: 1px solid var(--pale-silver);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
.form-group input:focus { outline: none; border-color: var(--electric-blue); }

.form-product-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    background-color: var(--light-ash);
    padding: 16px;
    border-radius: 12px;
}

.form-product-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--electric-blue);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.form-product-name {
    font-weight: 700;
    font-size: 18px;
    color: var(--carbon-dark);
}

.switch-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--pale-silver); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--electric-blue); }
input:checked + .slider:before { transform: translateX(20px); }

.file-upload-group {
    background-color: var(--light-ash);
    padding: 16px;
    border-radius: 8px;
    border: 1px dashed var(--pale-silver);
}
.file-help { font-size: 12px; color: var(--pewter); margin-top: 8px; }

/* Persistent Chat Bar */
.persistent-chat-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--pure-white);
    border-top: 1px solid var(--cloud-gray);
    padding: 12px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 90;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--light-ash);
    border-radius: 24px;
    padding: 6px 16px;
    flex: 1;
    max-width: 600px;
}
.chat-icon { margin-right: 8px; color: var(--pewter); display: flex; align-items: center;}
.chat-input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 8px 0;
    font-family: inherit;
    font-size: 14px;
}
.chat-input:focus { outline: none; }
.chat-send { background: transparent; border: none; cursor: pointer; color: var(--electric-blue); display: flex; align-items: center;}

.chat-cta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-cta::before {
    content: '';
    display: inline-block;
    width: 12px; height: 12px;
    background-color: #0066b2;
    border-radius: 50%;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 80px;
    right: 32px;
    border-radius: 50%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
    overflow: hidden;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.whatsapp-icon-wrapper {
    width: 100%;
    height: 100%;
    background-image: url('assets/images/whatsapp-icons.png');
    background-size: 200% 100%;
    background-position: right center;
    border-radius: 50%;
}

.whatsapp-float:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0 8px 15px rgba(37, 211, 102, 0.4));
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .gallery-slide { flex: 0 0 calc((100% - 24px) / 2); }
}
@media (max-width: 768px) {
    nav { 
        display: block; 
        position: fixed;
        top: 0; right: -100%;
        width: 80%; max-width: 320px;
        height: 100vh;
        background-color: var(--pure-white);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 80px 32px;
        z-index: 100;
    }
    nav.active { right: 0; }
    nav ul { flex-direction: column; gap: 32px; }
    nav ul li a { font-size: 20px; display: block; }
    
    .menu-btn { display: flex; }
    .hero-actions { flex-direction: column; align-items: center; }
    .counters-container { gap: 32px; flex-direction: column; }
    .persistent-chat-bar { flex-direction: column; padding: 16px; }
    .chat-input-wrapper { max-width: 100%; width: 100%; }
    .gallery-slide { flex: 0 0 100%; }
    .whatsapp-float { bottom: 140px; right: 16px; width: 50px; height: 50px; }
}
