/* Home page category bubbles (include/home-category-bubbles.php), right under
   the hero slider. Managed in Admin → Category Bubbles. */
.cat-bubbles {
    padding: 2.25rem 1rem .75rem;
}

.cat-bubbles__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 1.75rem;
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 0 0; /* room for pop-out images above the first row */
    list-style: none;
}

.cat-bubbles__item {
    flex: 0 0 132px;
    width: 132px;
    margin: 0;
    animation: catBubbleIn .55s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes catBubbleIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.cat-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.cat-bubble__circle {
    position: relative;
    display: block;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: linear-gradient(180deg, #f6f8fb 0%, #e8edf3 100%);
    border: 1px solid #e3e8ef;
    box-shadow: inset 0 -10px 20px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .05);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease;
}

.cat-bubble__circle picture {
    display: contents;
}

/* Transparent product shot that rises out of the top of the circle */
.cat-bubble--popout .cat-bubble__img {
    position: absolute;
    left: 6%;
    bottom: 8%;
    width: 88%;
    height: 112%;
    object-fit: contain;
    object-position: 50% 100%;
    transform-origin: 50% 100%;
    filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .16));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

/* Photo cropped to the circle */
.cat-bubble--fill .cat-bubble__circle {
    overflow: hidden;
}

.cat-bubble--fill .cat-bubble__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.cat-bubble__label {
    max-width: 100%;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--c-text, #212529);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}

@media (hover: hover) {
    .cat-bubble:hover .cat-bubble__circle {
        transform: translateY(-4px);
        border-color: #bcd3ee;
        box-shadow: 0 12px 24px rgba(0, 86, 179, .14);
    }

    .cat-bubble:hover .cat-bubble__img {
        transform: scale(1.07);
    }

    .cat-bubble:hover .cat-bubble__label {
        color: var(--c-brand, #0056b3);
    }
}

.cat-bubble:focus-visible .cat-bubble__circle {
    transform: translateY(-4px);
    border-color: var(--c-brand, #0056b3);
}

.cat-bubble:active .cat-bubble__circle {
    transform: scale(.96);
}

/* Dark mode (main.main-content stays white, so the band needs its own
   background, the same as .mcdodo-featured-section below it) */
[data-theme="dark"] .cat-bubbles {
    background: #1a1a1a;
}

[data-theme="dark"] .cat-bubble__circle {
    background: linear-gradient(180deg, #2b3038 0%, #1f242b 100%);
    border-color: #363d48;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .25);
}

[data-theme="dark"] .cat-bubble__label {
    color: #e5e7eb;
}

[data-theme="dark"] .cat-bubble--popout .cat-bubble__img {
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}

@media (hover: hover) {
    [data-theme="dark"] .cat-bubble:hover .cat-bubble__circle {
        border-color: #3b82f6;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .4);
    }

    [data-theme="dark"] .cat-bubble:hover .cat-bubble__label {
        color: #93c5fd;
    }
}

/* Tablet */
@media (max-width: 1100px) {
    .cat-bubbles__list {
        gap: 1.25rem 1.25rem;
    }

    .cat-bubbles__item {
        flex-basis: 116px;
        width: 116px;
    }

    .cat-bubble__circle {
        width: 100px;
        height: 100px;
    }
}

/* Phone: one swipeable row, centred when it fits */
@media (max-width: 767px) {
    .cat-bubbles {
        padding: 1.25rem 0 .25rem;
    }

    .cat-bubbles__list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0 .875rem;
        padding: 14px 1rem 6px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 1rem;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .cat-bubbles__list::-webkit-scrollbar {
        display: none;
    }

    .cat-bubbles__item {
        flex: 0 0 76px;
        width: 76px;
        scroll-snap-align: start;
    }

    .cat-bubbles__item:first-child {
        margin-left: auto;
    }

    .cat-bubbles__item:last-child {
        margin-right: auto;
    }

    .cat-bubble {
        gap: .5rem;
    }

    .cat-bubble__circle {
        width: 70px;
        height: 70px;
    }

    .cat-bubble__label {
        font-size: .75rem;
        line-height: 1.25;
    }
}
