:root {
    --primary: #dc2626;
    /* Red Premium */
    --primary-dark: #b91c1c;
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    --phone: #3b82f6;
    --phone-dark: #2563eb;

    /* Light Mode (Default variables) */
    --bg-main: #ffffff;
    --bg-main-rgb: 255, 255, 255;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --container: 1400px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0a0a0a;
        --bg-main-rgb: 10, 10, 10;
        --bg-secondary: #171717;
        --bg-card: #171717;
        --text-main: #ffffff;
        --text-muted: #a3a3a3;
        --border-color: #262626;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
.logo,
.btn {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate.fade-up {
    transform: translateY(30px);
}

.animate.fade-in {
    transform: scale(0.95);
}

.animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Splash Screen */
#intro-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease-out, visibility 1s ease-out;
}

#intro-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    /* Slightly smaller to fit vertical stack */
    font-weight: 800;
    color: var(--text-main);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.splash-logo span {
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    margin: 0.5rem 0;
    /* Vertical margin for stacked layout */
}

/* Header Animation State - Removed hiding logic to ensure visibility */
body.loading #main-nav {
    opacity: 1;
}

body.loaded #main-nav {
    opacity: 1;
}

/* Navigation */
/* Navigation & Header */
#main-nav {
    height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;

    /* Glassmorphism Effect */
    background: rgba(var(--bg-main-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(var(--border-color), 0.5);
    transition: all 0.3s ease;
}

#main-nav.scrolled {
    height: 70px;
    background: rgba(var(--bg-main-rgb), 0.95);
    box-shadow: var(--shadow-sm);
}

#main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.03em;
}

.logo span {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
}

nav a:hover {
    color: var(--text-main);
}


/* Hero Section */
#hero {
    min-height: 100vh;
    padding-top: 90px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000;
    /* Fallback */
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Darkens video by 40% */
    z-index: 2;
}

#hero .container {
    display: flex;
    /* Changed from grid to flex for centered text on video */
    flex-direction: column;
    align-items: flex-start;
    /* Align text to left or center as preferred */
    justify-content: center;
    position: relative;
    z-index: 10;
    height: 100%;
}

.hero-text {
    max-width: 800px;
    /* Limit width */
}

.hero-text h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: #fff;
    /* Force white text on video */
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    /* Force light text */
    max-width: 600px;
    margin-bottom: 2.5rem;
}

/* Hide old visual styles */
.hero-visual {
    display: none;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1.25rem 2.5rem;
    border-radius: 100px;
    /* Pill shape */
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(225, 29, 72, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

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

/* Inventory Grid */
#inventory {
    padding: 10rem 0;
    background-color: var(--bg-secondary);
}

.section-header {
    margin-bottom: 5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.1;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
}

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

.vehicle-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.vehicle-card:hover {
    transform: translateY(-15px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.vehicle-img-wrapper {
    overflow: hidden;
    height: 250px;
}

.vehicle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.vehicle-card:hover .vehicle-img {
    transform: scale(1.05);
}

.vehicle-info {
    padding: 2rem;
}

.vehicle-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.vehicle-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.vehicle-year {
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.vehicle-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.vehicle-details {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Features */
#features {
    padding: 8rem 0;
}

#features .container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
}

.feature-item {
    text-align: left;
    flex: 1;
    padding: 2rem;
    border-right: 1px solid var(--border-color);
}

.feature-item:last-child {
    border-right: none;
}

.feature-item .icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1rem;
    background: rgba(225, 29, 72, 0.1);
    border-radius: 50%;
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-item p {
    color: var(--text-muted);
}

/* Contact */
#contact {
    padding: 6rem 0;
    background-color: var(--bg-main);
    position: relative;
}

.contact-card {
    background-color: #000;
    color: #fff;
    border-radius: 30px;
    padding: 5rem;
    text-align: center;
    background-image: linear-gradient(45deg, #000, #1a1a1a);
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--primary), transparent 50%);
    opacity: 0.2;
}

.contact-card h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.contact-details {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    font-size: 1.1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

/* Footer */
footer {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links a {
    color: var(--text-muted);
    margin: 0 1.5rem;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Lighter backdrop for modern feel */
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
}

.modal-content {
    background: var(--bg-main);
    width: 95vw;
    max-width: 95vw;
    /* Maximized width for huge gallery */
    max-height: 90vh;
    border-radius: 32px;
    position: relative;
    padding: 0;
    /* Removing padding to let gallery fill left side */
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-card.interactive {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.contact-card.interactive:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(225, 29, 72, 0.15);
}

.contact-card.interactive .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.contact-card.interactive h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.25rem;
}

.contact-card.interactive p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.action-text {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.contact-card.interactive:hover .action-text {
    opacity: 1;
    transform: translateY(0);
}

.btn-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-email:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.1);
    background: var(--bg-main) !important;
}

/* Filters & Search */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
    min-width: 250px;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

/* Skeleton Loading */
.skeleton {
    background: #e2e8f0;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card .vehicle-img-wrapper {
    background: #e2e8f0;
}

.skeleton-img {
    width: 100%;
    height: 100%;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 80%;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: white;
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1010;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.close-modal:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.modal-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    /* Dominant left column */
    width: 100%;
    gap: 0;
}

/* Carousel Styles */
.modal-left-col {
    display: flex;
    flex-direction: column;
    /* height: 100% removed to allow content to dictate height */
    grid-column: 1;
    overflow: hidden;
    /* Ensure content stays in column */
}

.modal-details {
    grid-column: 2;
}

.modal-gallery {
    position: relative;
    width: 100%;
    /* Enforce 3:2 aspect ratio to match vehicle photos */
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 32px 0 0 0;
    /* Matches modal top-left curve */
    display: flex;
    align-items: flex-start;
    /* Align to top to avoid padding */
    justify-content: center;
    background-color: #000;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    /* Fill the 3:2 container */
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
    /* Force single slide width */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover the area to avoid gaps */
    display: block;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1.5rem;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    transition: all 0.3s;
    color: var(--text-main);
}

.carousel-btn:hover {
    background: white;
    transform: scale(1.15);
    color: var(--primary);
}

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.modal-details {
    padding: 3.5rem;
    background: var(--bg-main);
}

.modal-details h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-whatsapp {
    background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-dark));
    color: white;
    text-decoration: none;
    /* Remove underline */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px -6px rgba(37, 211, 102, 0.4);
    border: none;
}

.btn-whatsapp:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px -8px rgba(37, 211, 102, 0.5);
    color: white;
}

.btn-phone {
    background: linear-gradient(135deg, var(--phone), var(--phone-dark));
    color: white;
    text-decoration: none;
    /* Remove underline */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.4);
    border: none;
}

.btn-phone:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px -8px rgba(59, 130, 246, 0.5);
    color: white;
}

/* Location Styles */
#location {
    padding: 8rem 0;
    background: var(--bg-card);
}

.map-wrapper {
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.map-wrapper iframe {
    display: block;
}

.floating-contact {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2000;
}

.fab-btn {
    width: 65px;
    height: 65px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.fab-btn svg {
    display: block;
    width: 32px;
    height: 32px;
}

.fab-btn.wa {
    background: #25D366;
    /* Solid bright green */
}

.fab-btn.wa:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px -10px rgba(37, 211, 102, 0.6);
}

.fab-btn.ph {
    background: #3b82f6;
    /* Solid bright blue */
}

.fab-btn.ph:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 35px -10px rgba(59, 130, 246, 0.6);
}

@media (max-width: 900px) {
    #hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-visual img {
        width: 100%;
        margin-left: 0;
    }

    .cta-group {
        justify-content: center;
    }

    #features .container {
        flex-direction: column;
        gap: 0;
    }

    .feature-item {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-grid {
        grid-template-columns: 1fr !important;
        display: flex;
        flex-direction: column;
    }

    .modal-left-col,
    .modal-details {
        width: 100%;
        display: block;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }

    .modal-gallery {
        min-height: auto;
        /* Remove fixed height constraint */
        height: auto;
        width: 100%;
        background: transparent;
        /* Ensure no black background shows */
    }

    .carousel-slide img {
        max-height: 50vh;
        /* Prevent taking too much vertical space */
        object-fit: cover;
    }

    .close-modal {
        position: fixed;
        /* Keep button visible on scroll */
        top: 1rem;
        right: 1rem;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        z-index: 2000;
    }
}

/* Global conversion link refinement */
.footer-links a,
.modal-actions a,
.floating-contact a {
    text-decoration: none !important;
}


/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Footer & Marketplaces --- */
.main-footer {
    padding: 4rem 0 2rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.marketplaces-section {
    text-align: center;
    width: 100%;
}

.marketplaces-section h3 {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.marketplaces-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.market-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: transparent;
    /* Clean look, no box */
    border: none;
    border-radius: 0;
    text-decoration: none;
    transition: transform 0.3s ease;
    min-width: auto;
    max-width: none;
}

.market-btn:hover {
    transform: scale(1.1);
    /* Gentle zoom instead of lift */
    border-color: transparent;
    box-shadow: none;
}

.market-btn img {
    height: 35px;
    /* Base height for logos */
    width: auto;
    object-fit: contain;
    filter: brightness(1);
    display: block;
}

/* Specific adjustment for Wallapop to balance visual weight */
.market-btn img.logo-wallapop {
    height: 60px;
    /* Significantly larger to match visual weight of others */
}

.footer-contact-row {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-contact-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.footer-contact-link.wa {
    color: var(--whatsapp);
}

.footer-contact-link.ph {
    color: var(--phone);
}

.footer-contact-link:hover {
    padding-left: 0;
    opacity: 0.8;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    text-align: center;
}

.footer-legal-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-legal-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.footer-legal-links a:hover {
    color: var(--text-main);
}

.copy-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* responsive footer */
@media (max-width: 600px) {
    .footer-contact-row {
        gap: 1.5rem;
    }

    .market-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    #main-nav .container {
        padding: 0 1rem !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        display: flex;
        justify-content: space-between;
    }

    #nav-menu {
        position: absolute;
        /* Remove from flex flow */
        visibility: hidden;
    }

    .mobile-menu-btn {
        display: flex !important;
        margin-right: -4px !important;
    }

    .logo {
        font-size: 1.25rem;
        z-index: 1002;
    }

    nav ul {
        visibility: visible;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-main);
        flex-direction: column;
        justify-content: flex-start;
        /* Align to top */
        align-items: flex-start;
        /* Align to left */
        box-shadow: none;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 6rem 2rem 2rem 2rem;
        /* Give space at top for logo/header */
        z-index: 1000;
        gap: 1rem;
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        width: 100%;
        text-align: left;
        /* Text to the left */
        border-bottom: 1px solid rgba(var(--border-color), 0.3);
        /* Subtle divider */
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav a {
        font-size: 2rem;
        /* Larger font size */
        font-weight: 700;
        display: block;
        padding: 1.5rem 0;
        color: var(--text-main);
        text-transform: uppercase;
        letter-spacing: -0.02em;
    }

    nav a:hover {
        color: var(--primary);
        padding-left: 0.5rem;
        /* Slight shift feedback */
    }
}

/* Modal Header Styles with Responsive Layout */
.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-ref {
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-price {
    font-size: 2.5rem;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    /* Prevent price wrapping */
}

@media (max-width: 600px) {
    .modal-details {
        padding: 1.5rem !important;
        /* Reduce padding to give more width to content */
    }

    .modal-header-row {
        flex-direction: column;
        gap: 0.25rem;
        /* Tighter gap */
    }

    .modal-ref {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .modal-details h2 {
        font-size: 1.8rem;
        /* Slightly smaller title to prevent excessive wrapping */
        line-height: 1.2;
    }

    .modal-price {
        font-size: 2.2rem;
        /* Large enough but not overwhelming */
        align-self: flex-start;
        margin-top: 0.75rem;
        color: var(--primary);
        display: block;
        /* Ensure it takes its own line */
        width: 100%;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    nav ul {
        display: flex;
        gap: 1.5rem;
        /* Reduce gap for tablets */
    }

    nav a {
        font-size: 0.85rem;
    }
}