/* ========== HERO CAROUSEL ========== */
.hero-carousel-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(10, 20, 35, 0.85) 0%, rgba(25, 28, 30, 0.85) 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0px;
    align-content: center;
    justify-content: center;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.hero-content.hidden {
    display: none;
}

/* Allow pointer events on interactive elements within hero-content */
.hero-content select,
.hero-content button,
.hero-content input,
.hero-content label {
    pointer-events: auto;
}

.hero-content > div > div {
    pointer-events: auto;
}

.carousel-rows-container {
    width: 100%;
    overflow: hidden;
    flex-grow: 1;
}

.carousel-row-wrapper {
    width: 100%;
    overflow: visible;
    margin: 8px 0;
}

.carousel-row {
    width: max-content;
    display: flex;
    gap: 16px;
    padding: 0;
}

.carousel-row.scrollLeft {
    animation: carouselScrollLeft var(--scroll-duration, 80s) linear infinite;
}

.carousel-row.scrollRight {
    animation: carouselScrollRight var(--scroll-duration, 95s) linear infinite;
}

.carousel-row:hover {
    animation-play-state: paused;
}

.carousel-row.dragging {
    animation-play-state: paused;
}

@keyframes carouselScrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes carouselScrollRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.carousel-card {
    flex: 0 0 auto;
    width: 240px;
    background: rgba(18, 22, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    pointer-events: auto;
}

.carousel-card.hidden {
    display: none;
}

.carousel-card:hover,
.carousel-card:active {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 50px rgba(56, 222, 187, 0.2);
    border-color: rgba(56, 222, 187, 0.35);
}

.carousel-card:hover .carousel-card-image img,
.carousel-card:active .carousel-card-image img {
    filter: brightness(1.1) saturate(1.1);
    transform: scale(1.1);
}

.carousel-card:hover .carousel-card-spec,
.carousel-card:active .carousel-card-spec {
    background: rgba(56, 222, 187, 0.1);
}

.carousel-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(20, 25, 40, 0.5);
    flex-shrink: 0;
}

.carousel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.3s ease;
}

.carousel-card-favorite {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-card-content {
    padding: 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.carousel-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.carousel-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #e1e2e4;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.carousel-card-price {
    color: #38debb;
    font-weight: 700;
    font-size: 10px;
    white-space: nowrap;
    line-height: 1.2;
    flex-shrink: 0;
}

.carousel-card-info {
    color: #9ca3af;
    font-size: 10px;
    line-height: 1.3;
    margin: 0;
}

.carousel-card-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 2px;
}

.carousel-card-spec {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 5px 3px;
    text-align: center;
    color: #c5c6cd;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 30px;
}

.carousel-card-spec-icon {
    font-size: 14px;
    color: #b9c7e4;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
}

.carousel-card-spec-text {
    font-size: 8px;
    color: #c5c6cd;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    word-break: break-word;
}

/* ========== FULLSCREEN MODE ========== */
.hero-carousel-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #111415;
}

.hero-carousel-fullscreen .hero-carousel-container {
    position: fixed;
    background: linear-gradient(135deg, #0a1a2f 0%, #1a1c1e 100%);
}

.hero-carousel-fullscreen .carousel-card {
    width: 340px;
}

.hero-carousel-fullscreen .hero-content {
    display: none;
}

/* ========== CONTROL BUTTONS ========== */
.carousel-control-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(56, 222, 187, 0.9);
    border: none;
    color: #111415;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(56, 222, 187, 0.3);
    pointer-events: auto;
}

.carousel-control-btn:hover {
    background: rgba(56, 222, 187, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(56, 222, 187, 0.4);
}

.carousel-control-btn.fullscreen {
    bottom: 16px;
    right: 16px;
}

.carousel-control-btn.close {
    bottom: 24px;
    right: 24px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero-carousel-container {
        gap: 8px;
        padding: 16px;
    }

    .carousel-row {
        gap: 12px;
    }

    .carousel-card {
        width: 240px;
    }

    .carousel-card-title {
        font-size: 14px;
    }

    .carousel-card-price {
        font-size: 12px;
    }

    .carousel-card-info {
        font-size: 11px;
    }

    .carousel-card-specs {
        gap: 6px;
    }

    .carousel-card-spec {
        padding: 6px;
        font-size: 10px;
    }

    .carousel-control-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        bottom: 12px;
        right: 12px;
    }

    .carousel-control-btn.close {
        bottom: 20px;
        right: 20px;
    }

    .parking-zone {
        top: 60px;
        right: 12px;
        width: 160px;
    }
}

@media (max-width: 480px) {
    .carousel-card {
        width: 200px;
    }

    .carousel-control-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .parking-zone {
        width: 140px;
        padding: 10px;
    }

    .parking-card-title {
        font-size: 13px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.carousel-card[style*="animation: pulse"] {
    animation: pulse 0.5s ease !important;
}

/* ========== PARKING ZONE ========== */
.parking-zone {
    position: fixed;
    top: 80px;
    right: 16px;
    width: 200px;
    z-index: 101;
    background: linear-gradient(145deg, rgba(30, 40, 60, 0.95), rgba(20, 25, 40, 0.95));
    border: 2px solid #38debb;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 0 20px rgba(56, 222, 187, 0.2);
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.parking-zone.visible {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.parking-title {
    font-size: 12px;
    font-weight: 700;
    color: #38debb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.parking-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.parking-slot {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.parking-slot:hover {
    background: rgba(255, 255, 255, 0.08);
}

.parking-slot.occupied {
    border-style: solid;
    border-color: #38debb;
    background: rgba(56, 222, 187, 0.1);
}

.parking-slot.occupied img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.parking-counter {
    font-size: 11px;
    color: #38debb;
    font-weight: 700;
    text-align: center;
}

.parking-button {
    width: 100%;
    padding: 8px;
    background: #38debb;
    color: #111415;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.parking-button:hover:not(:disabled) {
    background: #5ffbd6;
    transform: scale(1.05);
}

.parking-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .parking-zone {
        top: 60px;
        right: 12px;
        width: 160px;
        padding: 10px;
    }

    .parking-slots {
        gap: 4px;
    }

    .parking-slot {
        font-size: 14px;
    }
}

/* ========== FULLSCREEN MODE ========== */
body.hero-carousel-fullscreen {
    overflow: hidden;
}

.hero-carousel-fullscreen .hero-carousel-container {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    padding: 20px;
    z-index: 999;
}

.hero-carousel-fullscreen .carousel-row {
    animation-play-state: paused !important;
}

.hero-carousel-fullscreen .carousel-rows-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.hero-carousel-fullscreen .carousel-row-wrapper {
    width: 100%;
    overflow: visible;
    margin: 0;
}

.hero-carousel-fullscreen .carousel-row {
    width: 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
}

/* Убираем скролл-бар в полноэкранном режиме для чистоты */
.hero-carousel-fullscreen .carousel-row::-webkit-scrollbar {
    height: 4px;
}

.hero-carousel-fullscreen .carousel-row::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.hero-carousel-fullscreen .carousel-row::-webkit-scrollbar-thumb {
    background: rgba(56, 222, 187, 0.3);
    border-radius: 2px;
}

.hero-carousel-fullscreen .carousel-row::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 222, 187, 0.5);
}
