/* ******************** GARAGE HERO ******************** */
#garage_hero {
    padding: 8rem 2rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}
#garage_hero h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}
#garage_hero p {
    opacity: 0.7;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}


/* ******************** CAR GRID ******************** */
#garage_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.car-card {
    background: #14151f;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.car-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 157, 223, 0.15);
}
.car-card:focus-visible {
    outline: 2px solid #009DDF;
    outline-offset: 2px;
}

.car-card__img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0d14;
}
.car-card__img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    padding: 1rem;
}
.car-card:hover .car-card__img-wrapper img {
    transform: scale(1.05);
}

.car-card__info {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.car-card__year {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    color: #009DDF;
    letter-spacing: 2px;
}
.car-card__name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    margin: 0;
}
.car-card__arrow {
    width: 24px;
    height: 24px;
    opacity: 0.4;
    transition: opacity 0.3s, transform 0.3s;
    flex-shrink: 0;
}
.car-card:hover .car-card__arrow {
    opacity: 1;
    transform: translateX(4px);
}


/* ******************** MODAL ******************** */
.car-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.car-modal.open {
    opacity: 1;
    visibility: visible;
}

.car-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.car-modal__content {
    position: relative;
    background: #14151f;
    border-radius: 16px;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}
.car-modal.open .car-modal__content {
    transform: translateY(0);
}

/* Scrollbar styling */
.car-modal__content::-webkit-scrollbar {
    width: 6px;
}
.car-modal__content::-webkit-scrollbar-track {
    background: transparent;
}
.car-modal__content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.car-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.car-modal__close:hover {
    background: rgba(0, 157, 223, 0.3);
}


/* ******************** MODAL HEADER ******************** */
.car-modal__header {
    position: relative;
    background: #0d0d14;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    border-radius: 16px 16px 0 0;
}
.car-modal__hero-img {
    max-width: 55%;
    max-height: 260px;
    object-fit: contain;
}
.car-modal__title {
    flex: 1;
}
.car-modal__year {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: #009DDF;
    letter-spacing: 3px;
}
.car-modal__name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem;
    color: #fff;
    margin: 0.2rem 0 0.5rem;
    line-height: 1.1;
}
.car-modal__tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}


/* ******************** MODAL TABS ******************** */
.car-modal__tabs {
    display: flex;
    border-bottom: 1px solid #2a2b3a;
    padding: 0 2rem;
    gap: 0;
}
.car-modal__tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 1px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.car-modal__tab:hover {
    color: #fff;
}
.car-modal__tab.active {
    color: #009DDF;
}
.car-modal__tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #009DDF;
}


/* ******************** MODAL PANELS ******************** */
.car-modal__body {
    padding: 2rem;
}
.car-modal__panel {
    display: none;
}
.car-modal__panel.active {
    display: block;
}

/* Overview */
.car-modal__description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.car-modal__achievements h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: #009DDF;
    margin-bottom: 0.8rem;
}
.car-modal__achievements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.car-modal__achievements li {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Open Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.car-modal__achievements li::before {
    content: '▸';
    color: #009DDF;
}

/* Specifications */
.car-modal__specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.spec-item {
    background: #1a1b2e;
    border-radius: 10px;
    padding: 1.2rem;
    border: 1px solid #2a2b3a;
}
.spec-item__label {
    font-size: 0.75rem;
    font-family: 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.4rem;
}
.spec-item__value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: #fff;
}

/* Gallery */
.car-modal__gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}
.gallery-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.gallery-img:hover {
    transform: scale(1.03);
    opacity: 0.85;
}

/* Empty state */
.car-modal__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.95rem;
}


/* ******************** LIGHTBOX ******************** */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open {
    opacity: 1;
    visibility: visible;
}
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}


/* ******************** MEDIA ******************** */

/*  --- MOBILE ---  */
@media (max-width: 767px) {
    #garage_hero h1 {
        font-size: 2.5rem;
    }
    #garage_grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.2rem;
    }
    .car-modal__content {
        width: 95vw;
        max-height: 95vh;
        border-radius: 10px;
    }
    .car-modal__header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
        border-radius: 10px 10px 0 0;
    }
    .car-modal__hero-img {
        max-width: 90%;
    }
    .car-modal__name {
        font-size: 2rem;
    }
    .car-modal__tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }
    .car-modal__tab {
        padding: 0.8rem 1rem;
        font-size: 1rem;
        white-space: nowrap;
    }
    .car-modal__body {
        padding: 1.2rem;
    }
    .car-modal__specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .car-modal__gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*  --- TABLET ---  */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    #garage_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*  --- DESKTOP ---  */
@media only screen and (min-width: 992px) {

}

/*  --- TABLET & DESKTOP ---  */
@media only screen and (min-width: 768px) {

}
