/* --- BASES --- */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-color: #D4AF37;
    --gold-light: #E8C547;
    --gold-dark: #B8860B;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}

h1,
h2,
h3,
.oswald {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- PRELOADER --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-logo {
    max-width: 200px;
    width: 80%;
    height: auto;
    opacity: 0;
    animation: heartbeat 3.5s ease-in-out;
}

@keyframes heartbeat {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

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

    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    mix-blend-mode: difference;
    opacity: 0;
    transition: opacity 0.8s ease;
}

header.visible {
    opacity: 1;
}

.logo {
    font-weight: 700;
    letter-spacing: 2px;
    padding: 5px;
    z-index: 201;
}

.menu-toggle {
    width: 40px;
    height: 20px;
    position: relative;
    cursor: pointer;
    z-index: 201;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: transform 0.3s ease;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #000000 100%);
    z-index: 150;
    display: flex;
    justify-content: center;
    align-items: center;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    pointer-events: none;
}

.nav-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.nav-links {
    list-style: none;
    text-align: center;
    position: relative;
    z-index: 1;
}

.nav-item {
    overflow: visible;
    margin: 20px 0;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--accent-color), var(--gold-light));
    transition: all 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.nav-item:hover::before {
    left: -30px;
    height: 60%;
}

.nav-link {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.9);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100%);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: 2px;
    position: relative;
    white-space: nowrap;
    overflow: visible;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold-light), var(--accent-color));
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    transition: width 0.5s ease;
}

.nav-link:hover {
    color: var(--accent-color);
    -webkit-text-stroke: 1.5px var(--accent-color);
    transform: translateX(30px) !important;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4), 0 0 60px rgba(212, 175, 55, 0.2);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.nav-link:hover::after {
    width: 100%;
}

/* --- HERO SECTION --- */
.hero-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    z-index: 1;
    will-change: opacity;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

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

/* Controles del carousel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.carousel-btn-prev {
    left: 30px;
}

.carousel-btn-next {
    right: 30px;
}

.carousel-btn i {
    font-size: 1.2rem;
}

/* Indicadores del carousel */
.carousel-indicators {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicator:hover {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.3);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.carousel-indicator.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    width: 30px;
    border-radius: 6px;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    pointer-events: none;
}

.hero-title {
    font-size: 8vw;
    line-height: 0.9;
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-size: 1.2rem;
    letter-spacing: 8px;
    color: var(--accent-color);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: #fff;
}

/* --- SCROLL HORIZONTAL WRAPPER --- */
.horizontal-section {
    width: 300%;
    height: 100vh;
    display: flex;
    flex-wrap: nowrap;
    background: #000;
}

.brand-panel {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-right: 1px solid #222;
}

.panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.3) grayscale(1);
    /* transition: 1s;  <-- REMOVED to avoid conflict with GSAP */
    z-index: 1;
}

.brand-panel:hover .panel-bg {
    filter: brightness(0.6) grayscale(0);
    transform: scale(1.05);
}

.panel-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* .panel-logo styles removed as element was deleted from HTML */

.brand-logo-img {
    display: block;
    margin: 0 auto 30px auto;
    max-width: 140px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    opacity: 0;
    transform: translateY(20px);
}

.panel-cta {
    margin-top: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--gold-light));
    color: #000;
    font-family: 'Oswald';
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    /* Prepare for animation */
    opacity: 0;
    transform: skew(-10deg) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    /* Only animate specific props on hover, let GSAP handle entrance */
}

.panel-cta:hover {
    background: linear-gradient(135deg, var(--gold-light), #fff);
    /* We need to be careful not to override GSAP transform here, but skew is structural */
    /* GSAP will animate to 'skew(-10deg) translateY(0)' */
    /* So hover should probably just scale */
    transform: skew(-10deg) scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
    /* Force override for hover effect */
}

.extra-text {
    display: block;
    margin-top: 15px;
    font-size: 1rem;
    color: #ccc;
    opacity: 0;
    transform: translateY(20px);
}

/* --- STOCK SECTION --- */
.stock-section {
    background: #0a0a0a;
    padding: 100px 40px;
    position: relative;
    z-index: 2;
}

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.car-card {
    background: #111;
    padding: 0;
    overflow: hidden;
    transition: 0.3s;
}

.car-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    filter: grayscale(100%);
    transition: 0.4s;
}

.car-card:hover img {
    filter: grayscale(0%);
}

.car-info {
    padding: 20px;
}

.car-info h3 {
    color: #fff;
    font-size: 1.5rem;
}

.car-info span {
    color: var(--accent-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: bold;
}

/* --- CONTACT SECTION --- */
.contact-section {
    background: #0a0a0a;
    padding: 100px 40px;
    position: relative;
    z-index: 2;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-title {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 3px;
}

.contact-subtitle {
    color: #888;
    text-align: center;
    margin-bottom: 60px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.contact-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -12px;
    left: 0;
    font-size: 0.85rem;
    color: var(--accent-color);
    background: #0a0a0a;
    padding: 0 8px;
}

.form-label {
    position: absolute;
    top: 18px;
    left: 20px;
    color: #888;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: 'Roboto', sans-serif;
}

.form-textarea:focus + .form-label,
.form-textarea:not(:placeholder-shown) + .form-label {
    top: -12px;
    left: 0;
    font-size: 0.85rem;
    color: var(--accent-color);
    background: #0a0a0a;
    padding: 0 8px;
}

.form-submit {
    width: 100%;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--accent-color), var(--gold-light));
    color: #000;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    margin-top: 20px;
}

.form-submit:hover {
    background: linear-gradient(135deg, var(--gold-light), #fff);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.form-submit:active {
    transform: translateY(0);
}

/* --- FOOTER --- */
footer {
    background: #000;
    border-top: 1px solid #222;
    padding: 60px 40px 30px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-logo img {
    height: 40px;
    opacity: 0.9;
}

.footer-nav h4,
.footer-brands h4,
.footer-social h4 {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-nav ul,
.footer-brands ul {
    list-style: none;
    padding: 0;
}

.footer-nav ul li,
.footer-brands ul li {
    margin-bottom: 12px;
    color: #ccc;
    font-size: 0.95rem;
}

.footer-nav ul li a,
.footer-brands ul li a {
    color: #ccc;
    transition: color 0.3s;
}

.footer-nav ul li a:hover,
.footer-brands ul li a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: var(--accent-color);
    color: #000;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
}

.footer-bottom p {
    color: #666;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    .nav-link {
        font-size: 2.5rem;
        letter-spacing: 1px;
    }
    
    .nav-item {
        margin: 18px 0;
    }
    
    .nav-item::before {
        width: 3px;
    }
    
    .nav-item:hover::before {
        left: -20px;
        height: 50%;
    }

    .hero-title {
        font-size: 15vw;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn-prev {
        left: 15px;
    }

    .carousel-btn-next {
        right: 15px;
    }

    .carousel-btn i {
        font-size: 1rem;
    }

    .carousel-indicators {
        bottom: 60px;
    }

    /* .panel-logo removed */

    .car-grid {
        display: block;
    }

    .car-card {
        margin-bottom: 50px;
        transition: none !important;
    }

    .car-card img {
        transition: none !important;
    }

    .horizontal-section {
        width: 100%;
        height: auto;
        flex-direction: column;
        display: block;
    }

    .brand-panel {
        width: 100%;
        height: 100vh;
        border-right: none;
        border-bottom: 1px solid #222;
        align-items: flex-start;
        padding-top: 100px;
    }

    .panel-content {
        margin-top: -20px;
    }

    .extra-text {
        display: block;
    }

    .horizontal-section>.brand-panel:nth-child(1) .panel-bg {
        background-image: url('/web-html/img/BASALT_azul_nano_sm.png') !important;
    }

    .horizontal-section>.brand-panel:nth-child(2) .panel-bg {
        background-image: url('/web-html/img/408_nano_sm.png') !important;
    }

    .horizontal-section>.brand-panel:nth-child(3) .panel-bg {
        background-image: url('/web-html/img/DS7_nano_sm.png') !important;
    }

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

    .footer-logo,
    .footer-nav,
    .footer-brands,
    .footer-social {
        width: 100%;
        text-align: center;
    }

    .footer-nav ul,
    .footer-brands ul {
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    /* Contact Section Mobile */
    .contact-section {
        padding: 60px 20px;
    }

    .contact-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .contact-subtitle {
        font-size: 0.95rem;
        margin-bottom: 40px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .form-input {
        padding: 16px 18px;
    }

    .form-label {
        top: 16px;
        left: 18px;
        font-size: 0.85rem;
    }

    .form-input:focus + .form-label,
    .form-input:not(:placeholder-shown) + .form-label {
        top: -10px;
        font-size: 0.75rem;
        padding: 0 6px;
    }

    .form-textarea:focus + .form-label,
    .form-textarea:not(:placeholder-shown) + .form-label {
        top: -10px;
        font-size: 0.75rem;
        padding: 0 6px;
    }

    .form-submit {
        padding: 16px 30px;
        font-size: 1rem;
    }
}