/*
 * Category pills reuse Avada's own .fusion-button classes (see
 * fcg_category_gallery_tabs_html() in functions.php) so colour, radius,
 * font and hover state all come from Theme Options > Buttons rather than
 * being redefined here. Only layout/sizing is set on this side.
 */
.category-gallery-tabs-wrap {
    margin-bottom: 24px;
}

.category-gallery-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-gallery-tab {
    display: block;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

/*
 * This site's global button setting has border-width: 0 (buttons only rely
 * on fill colour, e.g. the white "Call" button reads fine against the dark
 * hero background). Our inactive pills sit on plain white, so a 0-width
 * border is invisible - add just the width back, keeping Avada's own
 * border-color/style/radius from the button-white class untouched.
 */
.category-gallery-tab.button-white,
.category-gallery-tabs-toggle.button-white {
    border-width: 1px !important;
}

.category-gallery-tabs-toggle {
    display: none !important;
}

.category-gallery-tabs-toggle-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.category-gallery-tabs-toggle[aria-expanded="true"] .category-gallery-tabs-toggle-chevron {
    transform: rotate(180deg);
}

.category-gallery-slider {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.category-gallery-slides {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 11;
}

.category-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    visibility: hidden;
    transform: translateX(0%);
}

.category-gallery-slide.is-current-category {
    display: block;
}

.category-gallery-slide.is-current-category.is-active {
    visibility: visible;
    cursor: pointer;
}

.category-gallery-slides::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d233a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    pointer-events: none;
    z-index: 2;
}

@media (max-width: 640px) {
    .category-gallery-slides::after {
        width: 30px;
        height: 30px;
        background-size: 14px 14px;
        right: 8px;
        bottom: 8px;
    }
}

.category-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #0d233a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    transition: background 0.2s ease;
}

.category-gallery-arrow:hover {
    background: #ffffff;
}

.category-gallery-arrow.is-hidden {
    display: none;
}

.category-gallery-prev {
    left: 12px;
}

.category-gallery-next {
    right: 12px;
}

.category-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.category-gallery-thumbs.is-hidden {
    display: none;
}

.category-gallery-thumbs .category-gallery-thumb {
    display: none;
    width: 100%;
    height: 95px;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    border: 0;
    padding: 0;
    background: none;
}

.category-gallery-thumbs .category-gallery-thumb.is-current-category.is-visible {
    display: block;
}

.category-gallery-thumbs .category-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.category-gallery-thumbs .category-gallery-thumb.is-active img {
    opacity: 1;
}

@media (max-width: 800px) {
    .category-gallery-arrow {
        width: 32px;
        height: 32px;
    }

    .category-gallery-thumbs {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-gallery-thumbs .category-gallery-thumb {
        height: auto;
        aspect-ratio: 136 / 95;
    }
}

@media (max-width: 640px) {
    .category-gallery-thumbs {
        display: none;
    }

    .category-gallery-tabs-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
    }

    .category-gallery-tabs {
        display: none;
        gap: 8px;
        margin-top: 12px;
    }

    .category-gallery-tabs-wrap.is-open .category-gallery-tabs {
        display: grid;
    }
}
