/* Menu — viewport-fixed panel (desktop push + mobile drawer) */
.categories__menu{
    background-color: var(--bg-secondary);
    position: fixed;
    top: 0;
    left: var(--theme-shell-gutter, 0px);
    width: var(--theme-sidebar-width, 306px);
    height: 100vh;
    height: 100dvh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100dvh;
    max-height: 100vh;
    border-radius: 0;
    border-right: 2px solid var(--border-tertiary);
    transition: left 0.3s ease;
}

/* Header Menu Top*/
.categories__menu-header{
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    padding: 18px 12px 16px 12px;
    border-bottom: 2px solid var(--border-tertiary);
}

/* Header Menu Top - Main */
.categories__menu-header-main{
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Sidebar logo (desktop) / close (mobile) */
.categories__menu-logo{
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    width: auto;
    height: 2.75rem;
}

.categories__menu-logo-image{
    display: block;
    width: auto;
    max-width: 12rem;
    height: 100%;
    object-fit: contain;
}

.categories__menu-close{
    display: none;
    flex: 0 0 auto;
    color: var(--fg-primary);
}

/* Idle search = icon-only; active search = field + X */
.categories__menu-search-toggle,
.categories__menu-search-close{
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.625rem;
    color: var(--fg-secondary);
}

@media (min-width: 768px) {
    /* Push sidebar (tablet + desktop): logo visible; mobile drawer keeps no-logo rule below */
    .categories__menu:not(.categories__menu--search) .categories__menu-logo{
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    .categories__menu-search-toggle{
        margin-left: auto;
    }
}

.categories__menu-search-toggle svg,
.categories__menu-search-close svg{
    width: 1.5rem;
    height: 1.5rem;
}

.categories__menu-search-close{
    display: none;
}

.categories__menu-search{
    display: none;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    height: 2.75rem;
    padding: 0.25rem;
    color: var(--fg-secondary);
    background-color: var(--bg-primary-alt);
    border: 1.5px solid var(--border-primary);
    border-radius: 14px;
}

.categories__menu-search-submit{
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: var(--fg-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.categories__menu-search-submit svg{
    width: 1.5rem;
    height: 1.5rem;
    color: var(--fg-secondary);
    fill: currentColor;
}

.categories__menu-search input{
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0 0.375rem 0 0;
    color: var(--fg-secondary);
    font-family: var(--font-text);
    font-weight: 500;
    font-size: var(--text-base);
    line-height: 1.25rem;
    letter-spacing: 0.009375rem;
    background-color: transparent;
    border: none;
    outline: none;
}

.categories__menu-search input::placeholder{
    color: var(--fg-tertiary);
}

/* Search mode: hide idle controls; show X + field */
.categories__menu--search .categories__menu-logo,
.categories__menu--search .categories__menu-close,
.categories__menu--search .categories__menu-search-toggle,
.categories__menu--search [data-sidebar-nav-content]{
    display: none !important;
}

.categories__menu--search .categories__menu-search-close,
.categories__menu--search .categories__menu-search,
.categories__menu--search [data-sidebar-search-results]{
    display: flex !important;
}

.categories__menu--search .categories__menu-header-main{
    gap: 0.5rem;
}

@media (max-width: 767px) {
    .categories__menu-header{
        padding: 12px 16px;
    }

    .categories__menu-header-main{
        gap: 0.625rem;
    }

    .categories__menu-logo{
        display: none;
    }

    .categories__menu-close{
        display: flex;
    }

    .categories__menu-search-toggle{
        display: none;
    }

    .categories__menu-search:not([hidden]){
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    .categories__menu--search .categories__menu-close{
        display: none !important;
    }
}

/* Sidebar Menu Middle — fills leftover height; footer hugs content */
.categories__menu-content{
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    height: auto;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sidebar Menu Middle - List */
.categories__menu-content-list{
    flex: 1 1 auto;
    position: relative;
    top: auto;
    left: auto;
    padding: 10px 12px;
    width: 100%;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--fg-secondary) transparent;
    overflow-x: hidden;
    overflow-y: auto;
}
.categories__menu-content-list::-webkit-scrollbar {
    width: 6px;
}
.categories__menu-content-list::-webkit-scrollbar-track {
    background: transparent;
}
.categories__menu-content-list::-webkit-scrollbar-thumb {
    background-color: var(--fg-secondary);
    border-radius: 3px;
}
.categories__menu-content-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--fg-secondary);
}
.categories__menu-content-list::-webkit-scrollbar-button {
    display: none;
}
.categories__menu-content-list::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}
.categories__menu-content-list::-webkit-scrollbar-button:start:decrement,
.categories__menu-content-list::-webkit-scrollbar-button:end:increment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Quick search results */
.categories__menu-search-results{
    display: none;
    flex: 1 1 auto;
    position: relative;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    width: 100%;
    padding: 0 0 4.5rem;
    overflow: hidden;
}

.categories__menu-search-results-list{
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--fg-secondary) transparent;
}

.categories__menu-search-card{
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
    padding: 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-tertiary);
}

.categories__menu-search-card-media{
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    min-height: 4.5rem;
    padding: 0.75rem 0.75rem 0.5rem;
    background: var(--bg-primary-alt);
    border-radius: 1.25rem 0 0 1.25rem;
}

.categories__menu-search-card-image{
    display: block;
    width: 100%;
    height: 100%;
    max-height: 3.5rem;
    object-fit: contain;
}

.categories__menu-search-card-image--empty{
    width: 100%;
    min-height: 2.5rem;
    background: var(--border-tertiary);
    border-radius: 0.5rem;
}

.categories__menu-search-card-info{
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
    padding: 0.5rem 0;
}

.categories__menu-search-card-name{
    display: -webkit-box;
    overflow: hidden;
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-weight: 500;
    font-size: var(--text-base);
    line-height: 1.25rem;
    letter-spacing: 0.009375rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.categories__menu-search-card-meta{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.categories__menu-search-card-price{
    color: var(--fg-brand-primary);
    font-family: var(--font-text);
    font-weight: 500;
    font-size: var(--text-xs);
    line-height: 0.875rem;
    letter-spacing: 0.006875rem;
    white-space: nowrap;
}

.categories__menu-search-empty{
    margin: 1rem 12px;
}

.categories__menu-search-all{
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    gap: 0.125rem !important;
    justify-content: center;
}

/* Sidebar Menu Middle - Promo scroller */
.categories__menu-promo {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background-color: var(--bg-primary-alt);
    border: 1px solid var(--border-secondary);
    box-sizing: border-box;
}

.categories__menu-promo[hidden] {
    display: none !important;
}

.categories__menu-promo .promo-scroller--sidebar {
    width: 100%;
}

/* Sidebar Menu Middle - List - Parent Category */
.categories__menu-content-parent{
    display: flex;
    flex-direction: column;
}

.categories__menu-content-parent-split {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.categories__menu-content-parent-split .categories__menu-content-parent-btn {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    min-height: var(--btn-size-h);
    font-weight: 600;
    border-radius: 14px 0 0 14px;
}

/* Icon-only toggle — square hit target beside main segment */
.categories__menu-content-parent-split .categories__menu-content-parent-toggle {
    flex: 0 0 var(--btn-size-h);
    width: var(--btn-size-h);
    min-width: var(--btn-size-h);
    height: auto;
    min-height: var(--btn-size-h);
    align-self: stretch;
    padding: 0;
    margin-left: calc(-1 * var(--btn-edge));
    border-radius: 0 14px 14px 0;
}

/* Idle root row — same edge token/width as subcategory .btn--secondary */
.categories__menu-content-parent-split .categories__menu-content-parent-btn:not(.categories__menu-content-parent-btn--active):not(.categories__menu-content-parent-btn--semi)::before {
    border: var(--btn-edge) solid var(--border-primary);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right-width: 0;
}

.categories__menu-content-parent-split .categories__menu-content-parent-toggle:not(.categories__menu-content-parent-btn--active):not(.categories__menu-content-parent-btn--semi)::before {
    border: var(--btn-edge) solid var(--border-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left-width: 0;
}

/* Root category without sub-toggle — full pill like dropdown buttons */
.categories__menu-content-parent-split .categories__menu-content-parent-btn:only-child {
    border-radius: 14px;
}

.categories__menu-content-parent-split .categories__menu-content-parent-btn:only-child:not(.categories__menu-content-parent-btn--active):not(.categories__menu-content-parent-btn--semi)::before {
    border: var(--btn-edge) solid var(--border-primary);
    border-radius: inherit;
}

/* Selected / semi root row — keep seamless join on brand borders */
.categories__menu-content-parent-split .categories__menu-content-parent-btn.categories__menu-content-parent-btn--active::before,
.categories__menu-content-parent-split .categories__menu-content-parent-btn.categories__menu-content-parent-btn--semi::before {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right-width: 0;
}

.categories__menu-content-parent-split .categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active::before,
.categories__menu-content-parent-split .categories__menu-content-parent-toggle.categories__menu-content-parent-btn--semi::before {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left-width: 0;
}

.categories__menu-content-parent-toggle svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(180deg);
}

.categories__menu-content-parent:has(.categories__menu-content-parent-dropdown--active) .categories__menu-content-parent-toggle svg {
    transform: rotate(0deg);
}

/*
 * Semi / full selected — must beat .btn--secondary tokens from button.css.
 * Paint both the ledge (background) and ::before surface so yellow reads clearly.
 */
.btn.categories__menu-content-parent-btn--semi,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--semi {
    --btn-base: var(--border-brand-secondary);
    --btn-surface: var(--bg-brand-tertiary);
    --btn-surface-hover: var(--bg-brand-secondary-hover);
    --btn-surface-press: var(--bg-brand-secondary-press);
    background-color: var(--border-brand-secondary);
    border: none;
}
.btn.categories__menu-content-parent-btn--semi::before,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--semi::before {
    background-color: var(--bg-brand-tertiary);
    border-color: var(--border-brand-secondary);
}
.btn.categories__menu-content-parent-btn--semi:hover::before,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--semi:hover::before {
    background-color: var(--bg-brand-secondary-hover);
}

.btn.categories__menu-content-parent-btn--active,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active,
.btn.categories__menu-content-parent-dropdown-btn--active{
    --btn-lift: 0px;
    --btn-lift-hover: 0px;
    --btn-base: var(--border-brand-primary);
    --btn-surface: var(--bg-brand-secondary);
    --btn-surface-hover: var(--bg-brand-secondary-hover);
    --btn-surface-press: var(--bg-brand-secondary-press);
    background-color: var(--border-brand-primary);
    border: none;
}
.btn.categories__menu-content-parent-btn--active::before,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active::before,
.btn.categories__menu-content-parent-dropdown-btn--active::before,
.btn.categories__menu-content-parent-btn--active:hover::before,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active:hover::before,
.btn.categories__menu-content-parent-dropdown-btn--active:hover::before{
    background-color: var(--bg-brand-secondary);
    border-color: var(--border-brand-primary);
    transform: translateY(0);
}
.btn.categories__menu-content-parent-btn--active:active::before,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active:active::before,
.btn.categories__menu-content-parent-dropdown-btn--active:active::before{
    background-color: var(--bg-brand-secondary-press);
    transform: translateY(0);
}
.btn.categories__menu-content-parent-btn--active > *,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active > *,
.btn.categories__menu-content-parent-dropdown-btn--active > *,
.btn.categories__menu-content-parent-btn--active:hover > *,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active:hover > *,
.btn.categories__menu-content-parent-dropdown-btn--active:hover > *,
.btn.categories__menu-content-parent-btn--active:active > *,
.btn.categories__menu-content-parent-toggle.categories__menu-content-parent-btn--active:active > *,
.btn.categories__menu-content-parent-dropdown-btn--active:active > *{
    translate: none;
}

.btn.categories__menu-content-parent-btn > span,
.btn.categories__menu-content-parent-dropdown-btn > span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    white-space: normal;
    align-self: center;
}

.categories__menu-content-parent-btn svg,
.categories__menu-content-parent-btn .categories__menu-icon{
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--fg-secondary);
    fill: currentColor;
}
.categories__menu-content-parent-btn svg path,
.categories__menu-content-parent-btn .categories__menu-icon path{
    fill: currentColor;
}

/* Sidebar Menu Middle - List - Parent Category - Dropdown */
.categories__menu-content-parent-dropdown{
    display: flex;
    flex-direction: column;
    align-items: end;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin-top 0.3s ease-in-out;
    overflow-y: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    gap:8px;
    pointer-events: none;
}
.categories__menu-content-parent-dropdown--active{
    max-height: 1000px;
    opacity: 1;
    margin-top: 10px;
    overflow: visible;
    pointer-events: auto;
}
.categories__menu-content-parent-dropdown-btn{
    width: 96%;
    height: auto;
    min-height: var(--btn-size-h);
}
.categories__menu-content-parent-dropdown-btn svg:last-of-type{
    display: none;
}
.categories__menu-content-parent-dropdown-btn--active svg:last-of-type{
    display: block;
}
.categories__menu-content-parent-dropdown-btn svg,
.categories__menu-content-parent-dropdown-btn .categories__menu-icon{
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--fg-secondary);
    fill: currentColor;
}
.categories__menu-content-parent-dropdown-btn svg path,
.categories__menu-content-parent-dropdown-btn .categories__menu-icon path{
    fill: currentColor;
}


/* Sidebar Menu Footer — hug contents, pin to bottom via flex */
.categories__menu-footer{
    flex: 0 0 auto;
    padding: 18px 12px;
    border-top: 2px solid var(--border-tertiary);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.categories__menu-footer-btns{
    display: flex;
    gap:10px;
}
.categories__menu-footer-btns >li{
    flex: 1;
}
.categories__menu-footer-btn{
    padding: 8px 10px !important;
    justify-content: center;
    flex-direction: column;
    gap: 6px !important;
    width: 100%;
    color: var(--fg-secondary);
    position: relative;
}
.categories__menu-footer-btn svg{
    color: var(--fg-secondary);
    fill: currentColor;
}
/* Labels only — do not hide corner count badges */
.categories__menu-footer-btn > span:not(.nav-count-badge){
    display: none;
    font-family: var(--font-text);
    color: var(--fg-secondary);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 0.875rem; 
    letter-spacing: 0.006875rem;
}
.categories__menu-footer-btn-language span{
    display: flex;
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 0.875rem; 
    letter-spacing: 0.006875rem;
    text-transform: uppercase;
    opacity: 0.8;
}



/* Sidebar Menu Footer - Cart / Basket (Figma Toggle Navigation → Basket)
 * Surface is a real element (not ::before) so overflow:hidden can clip basket art. */
.categories__menu-footer-cart{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 8.5rem;
    padding: 0 !important;
    position: relative;
    overflow: visible;
    min-height: 119px;
    width: 100%;
}

/* Kill default raised ::before — .categories__menu-footer-cart-surface replaces it */
.categories__menu-footer-cart.btn--secondary::before,
.categories__menu-footer-cart.btn--brand-secondary::before{
    content: none;
    display: none;
}

/* Keep surface translate flat even on hover/active — btn child lift would push it UP */
.categories__menu-footer-cart.btn--secondary > .categories__menu-footer-cart-surface,
.categories__menu-footer-cart.btn--brand-secondary > .categories__menu-footer-cart-surface,
.categories__menu-footer-cart.btn--secondary:hover > .categories__menu-footer-cart-surface,
.categories__menu-footer-cart.btn--brand-secondary:hover > .categories__menu-footer-cart-surface,
.categories__menu-footer-cart.btn--secondary:active > .categories__menu-footer-cart-surface,
.categories__menu-footer-cart.btn--brand-secondary:active > .categories__menu-footer-cart-surface{
    top: auto;
    translate: none;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Qty badge — pin to chrome, do not ride surface / btn content lift */
.categories__menu-footer-cart.btn--secondary > .categories__menu-footer-cart-label,
.categories__menu-footer-cart.btn--brand-secondary > .categories__menu-footer-cart-label,
.categories__menu-footer-cart.btn--secondary:hover > .categories__menu-footer-cart-label,
.categories__menu-footer-cart.btn--brand-secondary:hover > .categories__menu-footer-cart-label,
.categories__menu-footer-cart.btn--secondary:active > .categories__menu-footer-cart-label,
.categories__menu-footer-cart.btn--brand-secondary:active > .categories__menu-footer-cart-label{
    translate: none;
    display: inline-flex;
    width: auto;
    height: auto;
    pointer-events: none;
}

.categories__menu-footer-cart-surface{
    position: absolute;
    inset: 0;
    z-index: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    overflow: hidden;
    border-radius: inherit;
    border: var(--btn-edge) solid var(--btn-base);
    background-color: var(--btn-surface);
    /* Idle raised; hover = 1px DOWN from idle; press = flush */
    transform: translateY(calc(-1 * var(--btn-lift)));
    transition:
        transform 140ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 120ms ease,
        border-color 120ms ease,
        box-shadow 80ms ease;
}

.categories__menu-footer-cart:hover .categories__menu-footer-cart-surface{
    transform: translateY(calc(-1 * var(--btn-lift) + 1px));
    background-color: var(--btn-surface-hover);
}

.categories__menu-footer-cart:active .categories__menu-footer-cart-surface{
    transform: translateY(0);
    background-color: var(--btn-surface-press);
    box-shadow: inset 0 var(--btn-press-shadow) 0 0 var(--btn-base);
}

/* Selected cart — flat (same as other selected raised controls) */
.categories__menu-footer-cart--selected{
    --btn-lift: 0px;
    --btn-lift-hover: 0px;
}
.categories__menu-footer-cart--selected .categories__menu-footer-cart-surface,
.categories__menu-footer-cart--selected:hover .categories__menu-footer-cart-surface,
.categories__menu-footer-cart--selected:active .categories__menu-footer-cart-surface{
    transform: translateY(0);
}

/* Mobile drawer: cart joins footer row as icon btn (no basket art / paw) */
@media (max-width: 767px) {
    .categories__menu-footer{
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }

    /* Flatten ul so theme / wishlist / profile / cart share one flex row */
    .categories__menu-footer-btns{
        display: contents;
    }

    .categories__menu-footer-btns > li{
        flex: 1 1 0;
        min-width: 0;
    }

    .categories__menu-footer-cart{
        display: flex !important;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        min-height: var(--btn-size-h, 40px);
        align-self: stretch;
    }

    /* Match sibling footer btns — drop tall art stage */
    .categories__menu-footer-cart.btn--secondary > .categories__menu-footer-cart-surface,
    .categories__menu-footer-cart.btn--brand-secondary > .categories__menu-footer-cart-surface,
    .categories__menu-footer-cart.btn--secondary:hover > .categories__menu-footer-cart-surface,
    .categories__menu-footer-cart.btn--brand-secondary:hover > .categories__menu-footer-cart-surface,
    .categories__menu-footer-cart.btn--secondary:active > .categories__menu-footer-cart-surface,
    .categories__menu-footer-cart.btn--brand-secondary:active > .categories__menu-footer-cart-surface{
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .categories__menu-footer-cart-surface{
        padding: 8px 10px;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }

    .categories__menu-footer-cart-title{
        width: auto;
        justify-content: center;
        gap: 0;
        line-height: 0;
        opacity: 1;
    }

    .categories__menu-footer-cart-title > span:not(.categories__menu-footer-cart-paw),
    .categories__menu-footer-cart-paw,
    .categories__menu-footer-cart-basket{
        display: none !important;
    }
}

.categories__menu-footer-cart-title{
    color: var(--fg-secondary);
    opacity: 0.8;
    line-height: 1.5rem;
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: var(--text-base);
    font-weight: 600;
    width: 100%;
    position: relative;
    z-index: 2;
}
.categories__menu-footer-cart-title svg{
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    color: inherit;
    fill: currentColor;
}
.categories__menu-footer-cart-title svg path{
    fill: currentColor;
}
.categories__menu-footer-cart-title > span:not(.categories__menu-footer-cart-paw){
    flex: 0 1 auto;
    min-width: 0;
}

/* Paw — title far right; only when on cart page (selected) */
.categories__menu-footer-cart-paw{
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}
.categories__menu-footer-cart-paw svg{
    width: 20px;
    height: 20px;
    color: inherit;
    fill: currentColor;
}
.categories__menu-footer-cart-paw svg path{
    fill: currentColor;
}

/* Qty — bottom-right, same inset as surface padding (10px / 14px) */
.categories__menu-footer-cart-label{
    position: absolute;
    right: 14px;
    bottom: 10px;
    z-index: 4;
    margin-left: 0;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 14px;
    background-color: var(--bg-brand-primary);
    color: var(--fg-dark-secondary, var(--fg-dark-primary));
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 14px;
    letter-spacing: 0.01em;
}

/* Shared count badges — sidebar footer + header icon buttons (top-right) */
.nav-count-badge{
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--border-brand-primary);
    background-color: var(--bg-brand-primary);
    color: var(--fg-dark-secondary, var(--fg-dark-primary));
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    pointer-events: none;
}

/* Pin to chrome — do not ride raised .btn > * lift translate */
.btn > .nav-count-badge,
.categories__menu-footer-btn > .nav-count-badge{
    translate: none;
}

.btn:hover > .nav-count-badge,
.btn:active > .nav-count-badge,
.categories__menu-footer-btn:hover > .nav-count-badge,
.categories__menu-footer-btn:active > .nav-count-badge{
    translate: none;
}

.nav-count-badge[hidden]{
    display: none !important;
}

.categories__menu-footer-cart-label.nav-count-badge{
    /* Sit on raised face: chrome bottom + lift ≈ surface padding inset */
    top: auto;
    right: 14px;
    bottom: calc(10px + var(--btn-lift, 0px));
    min-width: 22px;
    height: auto;
    padding: 2px 6px;
    border-radius: 14px;
    border: 0;
    font-weight: 500;
    line-height: 14px;
}

/* Mobile: corner pin like wishlist / profile counts (beats desktop bottom inset) */
@media (max-width: 767px) {
    .categories__menu-footer-cart > .categories__menu-footer-cart-label.nav-count-badge{
        top: -6px;
        right: -6px;
        bottom: auto;
        min-width: 1.125rem;
        height: 1.125rem;
        padding: 0 0.25rem;
        border-radius: 999px;
        border: 1px solid var(--border-brand-primary);
        font-weight: 600;
        line-height: 1;
    }
}

.shop-header__compare,
.shop-header__wishlist,
.shop-header__cart,
.shop-header__profile,
.shop-header__profile-desktop,
[data-nav-count-wrap]{
    position: relative;
    overflow: visible;
}

.categories__menu-footer-cart-basket{
    /* Tweak basket stage position relative to the cart button */
    position: absolute;
    left: 0.3rem;
    bottom: -3.5rem;
    flex: 1;
    width: 164px;
    height: 164px;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}

.categories__menu-footer-cart-basket-back,
.categories__menu-footer-cart-basket-front{
    position: absolute;
    width: 144px;
    height: 144px;
    max-width: none;
    object-fit: contain;
    object-position: left bottom;
    user-select: none;
    /* Prevent global `svg { fill }` from tinting illustration assets */
    fill: none;
}

.categories__menu-footer-cart-basket-back{
    z-index: 1;
}

.categories__menu-footer-cart-basket-front{
    z-index: 3;
}

/* Item stage — tweak left/bottom/width/height to move the whole trio */
.categories__menu-footer-cart-basket-items{
    position: absolute;
    left: 16px;
    bottom: 28px;
    width: 113px;
    height: 68px;
    z-index: 2;
    overflow: visible;
}

.categories__menu-footer-cart-basket-item{
    position: absolute;
    width: 54px;
    height: 66px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-primary-alt);
    border: 1px solid var(--border-tertiary);
    box-sizing: border-box;
    transform-origin: center bottom;
    /* Resting Y — drop anim only tweaks `translate` so it always ends at 0 */
    translate: 0 0;
    /* Resting scale — keyframes must end here or end-snap appears */
    scale: 0.8;
}

.categories__menu-footer-cart-basket-item img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * Per-item slots (up to 3) — adjust left / bottom / rotate here:
 *   .categories__menu-footer-cart-basket-item--1
 *   .categories__menu-footer-cart-basket-item--2
 *   .categories__menu-footer-cart-basket-item--3
 * File: public/themes/shop/default/css/components/categories-menu.css
 */
.categories__menu-footer-cart-basket-item--1{
    left: 2rem;
    bottom: 3rem;
    transform: rotate(-11deg);
    z-index: 2;
}

.categories__menu-footer-cart-basket-item--2{
    left: 2.8rem;
    bottom: 2.8rem;
    transform: rotate(23deg);
    z-index: 1;
}

.categories__menu-footer-cart-basket-item--3{
    left: 0.4rem;
    bottom: 2.5rem;
    transform: rotate(-10deg);
    z-index: 3;
}

/* Hidden until fly lands, then is-dropping plays */
.categories__menu-footer-cart-basket-item.is-awaiting-drop{
    opacity: 0;
    pointer-events: none;
}

/* Drop ends at scale 0.8 = resting scale (no snap) */
.categories__menu-footer-cart-basket-item.is-dropping{
    animation: basketItemDrop 0.42s cubic-bezier(0.33, 1, 0.32, 1) forwards;
}

@keyframes basketItemDrop {
    0% {
        opacity: 0;
        translate: 0 -36px;
        scale: 0.62;
    }
    68% {
        opacity: 1;
        translate: 0 3px;
        scale: 0.84;
    }
    100% {
        opacity: 1;
        translate: 0 0;
        scale: 0.8;
    }
}

/* Soft catch pulse on cart control after fly lands */
.categories__menu-footer-cart.is-catching .categories__menu-footer-cart-basket{
    animation: basketCatch 0.38s cubic-bezier(0.33, 1, 0.32, 1);
}

/* At capacity (3 thumbs visible): nudge only — no new item drop */
.categories__menu-footer-cart.is-catching--subtle .categories__menu-footer-cart-basket{
    animation: basketCatchSubtle 0.28s cubic-bezier(0.33, 1, 0.32, 1);
}

@keyframes basketCatch {
    0% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(4px) scale(0.96);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes basketCatchSubtle {
    0% {
        transform: translateY(0) scale(1);
    }
    45% {
        transform: translateY(2px) scale(0.98);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.categories__menu-footer-cart--empty,
.categories__menu-footer-cart--filled{
    gap: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .categories__menu-footer-cart-basket-item.is-dropping,
    .categories__menu-footer-cart-basket-item.is-awaiting-drop{
        animation: none !important;
        translate: 0 0;
        scale: 0.8;
        opacity: 1;
    }
    .categories__menu-footer-cart.is-catching .categories__menu-footer-cart-basket,
    .categories__menu-footer-cart.is-catching--subtle .categories__menu-footer-cart-basket{
        animation: none !important;
    }
}


/* Desktop / tablet (≥768) — always visible, fixed left */
.categories__menu--main--desktop{
    position: fixed;
    top: 0;
    left: var(--theme-shell-gutter, 0px);
    bottom: 0;
    height: 100vh;
    height: 100dvh;
}

/* Legacy tablet classes (cleared by adaptive.js; kept safe if reapplied) */
.categories__menu--main--hide-side{
    left: calc(var(--theme-shell-gutter, 0px) - var(--theme-sidebar-width, 306px));
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.categories__menu--main--show-side{
    left: var(--theme-shell-gutter, 0px);
    top: 0;
    height: 100vh;
    height: 100dvh;
}

/* Open / show — must beat page-level menu left leftovers */
.categories__menu.categories__menu--main.categories__menu--main--show,
.categories__menu.categories__menu--main.categories__menu--main--open{
    left: var(--theme-shell-gutter, 0px);
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.categories__menu--main--hide{
    left: calc(var(--theme-shell-gutter, 0px) - var(--theme-sidebar-width, 306px));
    top: 0;
    height: 100vh;
    height: 100dvh;
}

/* Mobile (<768) — fixed drawer, off-canvas when closed */
@media (max-width: 767px) {
    .categories__menu.categories__menu--main{
        --theme-sidebar-width: 340px;
        border-radius: 0;
        width: var(--theme-sidebar-width, 340px);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        border-right: 2px solid var(--border-tertiary);
        border-left: none;
        border-top: none;
    }

    /* :not(--open) so this cannot override open/show */
    .categories__menu.categories__menu--main:not(.categories__menu--main--open):not(.categories__menu--main--show){
        left: calc(-1 * var(--theme-sidebar-width, 340px));
    }

    .categories__menu.categories__menu--main.categories__menu--main--open,
    .categories__menu.categories__menu--main.categories__menu--main--show{
        left: 0;
    }
}

/* Landing: drawer only — never pin as desktop push column */
.categories__menu--drawer-only{
    left: calc(-1 * var(--theme-sidebar-width, 306px));
}

.categories__menu--drawer-only.categories__menu--main--open{
    left: 0;
}

@media (min-width: 768px) {
    .categories__menu--drawer-only{
        display: none !important;
    }
}

