.car-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 500px;
    display: flex;
    align-items: flex-end;
    border-bottom: 8px solid var(--racing-red);
    overflow: hidden;
}

.car-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(26, 30, 47, 0.7);
    z-index: 1;
}

.car-hero .hero-content {
    position: relative;
    z-index: 2;
}

.car-gallery {
    margin-top: -100px;
    position: relative;
    z-index: 2;
}

.image-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 2 / 1; /* квадратное соотношение сторон */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 4px solid white;
    margin: 0 auto;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.thumbnail-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 9999;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.nav-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail:hover, .thumbnail.active {
    border-color: var(--racing-red);
    transform: scale(1.05);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr:nth-child(even) {
    background-color: rgba(0,0,0,0.03);
}

.specs-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.specs-table td:first-child {
    font-weight: bold;
    color: var(--asphalt-black);
    width: 40%;
}

.price-badge {
    background-color: var(--racing-red);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--font-subheading);
    font-size: 1.8rem;
    display: inline-block;
    margin: 15px 0;
}

.call-modal .modal-content {
    border-radius: 8px;
    border-top: 4px solid var(--racing-red);
}

.call-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.call-modal .modal-title {
    font-family: var(--font-heading);
    color: var(--gasoline-blue);
}

.similar-car {
    transition: transform 0.3s;
}

.similar-car:hover {
    transform: translateY(-10px);
}

/* Fullscreen Gallery Modal - Адаптивные стили */
#fullscreenGallery .modal-content.bg-dark {
    background-color: rgba(0, 0, 0, 0.98) !important;
}

#fullscreenGallery .modal-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9999;
    padding: 1rem;
    border: none !important;
}

#fullscreenGallery .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#fullscreenGallery .modal-header .btn-close:hover {
    opacity: 1;
}

#fullscreenGallery .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Навигация для больших экранов */
.fullscreen-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 2rem;
    z-index: 9999;
}

.nav-btn-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn-lg:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Индикатор текущего изображения */
.gallery-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Адаптивность для разных экранов */

/* Мобильные устройства (до 576px) */
@media (max-width: 575.98px) {
    .fullscreen-image {
        max-width: 100%;
        max-height: 85vh;
    }
    
    .nav-btn-lg {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .fullscreen-nav {
        padding: 0 1rem;
    }
    
    .gallery-indicator {
        bottom: 1rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    #fullscreenGallery .modal-header {
        padding: 0.5rem;
    }
    
    .nav-btn-lg {
        background: rgba(255, 255, 255, 0.15);
        border-width: 1px;
    }
}