/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e6212b;
    --primary-dark: #b0141c;
    --primary-light: #ff5a61;
    --secondary-color: #1976d2;
    --text-dark: #212121;
    --text-light: #757575;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

body.vista-luces > nav,
body.vista-luces > header,
body.vista-luces > footer,
body.vista-luces .services-section,
body.vista-luces .contact-section {
    display: none;
}

body.vista-luces .dashboard-lights-section {
    padding-top: 32px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 84px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 68px;
    width: auto;
    object-fit: contain;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.hamburger {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

.nav-social img {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.nav-social:hover img,
.nav-social:focus img {
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    margin-top: 84px;
    min-height: calc(100vh - 84px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('Images/taller1.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.hero-content {
    max-width: 700px;
}

.hero-logo {
    width: min(480px, 92vw);
    height: auto;
    margin: 0 auto 28px;
    padding: 12px 16px 8px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 16px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 32px;
    opacity: 0.95;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Section Styles */
.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.section-description {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* Services Section */
.services-section {
    padding: 80px 20px;
    background-color: var(--bg-light);
}

.service-category {
    margin-bottom: 80px;
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.service-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--text-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 24px;
}

.service-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-card:hover,
.service-card:focus-within {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.service-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cars-image {
    margin: 60px 0;
    text-align: center;
}

.cars-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

/* Dashboard Lights Section */
.dashboard-lights-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
}

.dashboard-lights-section .section-title {
    color: white;
}

.dashboard-lights-section .section-description {
    color: #ccc;
}

.dashboard-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    min-width: 0;
}

.dashboard-lights {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 32px;
    border-radius: 12px;
}

.lights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 12px;
    justify-items: center;
}

.light-icon {
    width: 100%;
    max-width: 128px;
    min-width: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 6px 10px;
    border-radius: 10px;
    color: #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.light-icon:hover,
.light-icon:focus-visible {
    background-color: rgba(255, 255, 255, 0.06);
}

.light-icon.is-active {
    background-color: rgba(255, 255, 255, 0.1);
}

.light-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
    border: 2px solid transparent;
}

.light-icon.is-active img {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.light-label {
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.25;
    text-align: center;
    color: #d0d0d0;
    overflow-wrap: anywhere;
}

.light-icon.is-active .light-label {
    color: #fff;
    font-weight: 700;
}

.light-info-panel {
    background-color: var(--bg-white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    min-height: 300px;
    display: none;
}

.light-info-panel.active {
    display: block;
}

.close-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-panel:hover,
.close-panel:focus {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.light-action {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 14px;
}

.light-action.info {
    color: #455a64;
}

.light-action.warning {
    color: #e65100;
}

.light-action.danger {
    color: #c62828;
}

.light-info-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-right: 36px;
}

.light-info-heading img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #111;
    border-radius: 8px;
    flex-shrink: 0;
}

.light-info-content h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 0;
}

.light-info-content p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 12px;
}

.info-placeholder {
    color: var(--text-light);
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
}

/* Contact Section */
.contact-section {
    padding: 80px 20px;
    background-color: var(--bg-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 48px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    background-color: var(--primary-color);
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    flex-shrink: 0;
}

.contact-item h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.contact-item p {
    font-size: 1.1rem;
}

.contact-link {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
}

.contact-link:hover,
.contact-link:focus {
    text-decoration: underline;
}

.contact-map {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.contact-map iframe {
    display: block;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    padding: 32px 20px;
}

.footer p {
    margin: 8px 0;
    opacity: 0.9;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-logo {
        height: 58px;
    }

    .nav-menu {
        position: absolute;
        top: 84px;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 12px 16px;
        width: 100%;
    }

    .nav-link::after {
        display: none;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 24px;
    }

    .dashboard-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-lights-section .container,
    .dashboard-lights,
    .light-info-panel {
        max-width: 100%;
        min-width: 0;
    }

    .dashboard-lights {
        padding: 16px 12px;
    }

    .lights-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px 6px;
    }

    .light-icon {
        max-width: none;
        padding: 6px 2px 8px;
    }

    .light-icon img {
        width: 64px;
        height: 64px;
    }

    .light-label {
        font-size: 0.72rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .dashboard-container {
        grid-template-columns: 2fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* Accessibility */
.nav-link:focus,
.btn:focus,
.light-icon:focus,
.close-panel:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading states */
img[loading="lazy"] {
    background: var(--bg-light);
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.contact-item {
    animation: fadeIn 0.5s ease-out;
}
