/* ===== Yacht categories (updated to match the old good look) ===== */
.yacht-categories {
    padding: 60px 0;
}

/* grid */
.yacht-categories__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* card */
.yacht-category {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    /* default no border */
    will-change: transform;
}

.yacht-category:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(35, 188, 179, 0.3);
}

/* ACTIVE: bigger + WHITE BORDER + stronger glow */
.yacht-category--active {
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(35, 188, 179, 0.35);
}

/* image */
.yacht-category__image {
    width: 100%;
    height: 270px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yacht-category:hover .yacht-category__image {
    transform: scale(1.05);
}

/* title: pill, like before (white chip with dark text) */
.yacht-category__title {
    /* Auto layout */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 10px;

    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    min-width: 123px;
    height: 44px;

    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;

    /* Typography */
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #181E1D;

    /* Layout */
    flex: none;
    order: 0;
    flex-grow: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

/* focus for accessibility */
.yacht-category:focus-visible {
    outline: none;
    border-color: #fff;
    transform: scale(1.03);
}

/* ====== Responsiveness (kept, with grid tweaks) ====== */
@media (max-width: 1200px) {
    .yacht-categories__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .yacht-categories__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .yacht-categories__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .yacht-category__image {
        height: 150px;
    }

    .yacht-category__title {
        font-size: 16px;
        line-height: 20px;
        min-width: 100px;
        height: 38px;
        padding: 8px;
    }
}

@media (max-width: 480px) {

    /* Убираем overflow для всех родительских контейнеров */
    .yacht-categories {
        overflow: visible !important;
    }

    .yacht-categories .container {
        overflow: visible !important;
    }

    /* Превращаем grid в Swiper слайдер на мобильных */
    .yacht-categories__grid {
        display: block !important;
        overflow: visible !important;
        position: relative;
    }

    /* Добавляем Swiper wrapper стили */
    .yacht-categories__grid.swiper-initialized {
        padding-bottom: 50px;
        display: block !important;
    }

    .yacht-categories__grid .swiper-wrapper {
        overflow: visible !important;
        display: flex;
    }

    /* Каждая категория становится слайдом */
    .yacht-categories__grid .swiper-slide {
        flex-shrink: 0;
        height: auto;
    }

    .yacht-category {
        margin: 0;
        overflow: visible !important;
        width: 100%;
        height: 100%;
    }

    .yacht-category__image {
        height: 160px;
    }

    .yacht-category__title {
        font-size: 14px;
        line-height: 18px;
        min-width: 90px;
        height: 34px;
        padding: 6px;
        bottom: 10px;
    }



    /* Стили для пагинации Swiper - копия hero slider */
    .yacht-categories__grid .swiper-pagination {
        position: absolute !important;
        bottom: 5px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 14px 0 6px !important;
        z-index: 10 !important;
    }

    .yacht-categories__grid .swiper-pagination-bullet {
        width: 9px !important;
        height: 9px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.35) !important;
        background-color: rgba(255, 255, 255, 0.35) !important;
        opacity: 1 !important;
        cursor: pointer !important;
        transition: transform 180ms ease, background-color 180ms ease !important;
        margin: 0 !important;
        border: none !important;
    }

    .yacht-categories__grid .swiper-pagination-bullet-active {
        background: #23BCB3 !important;
        background-color: #23BCB3 !important;
        opacity: 1 !important;
        transform: scale(1.1) !important;
    }
}