/* ==========================================================================
   Mobile side menu (drawer + drill-down panels)
   ========================================================================== */

#sliding-menu.mobile-menu {
    --mm-bg: #ffffff;
    --mm-text: #333333;
    --mm-muted: rgba(51, 51, 51, 0.6);
    --mm-line: #e2e2e2;
    --mm-line-soft: #e7e7e7;
    --mm-soft: rgba(51, 51, 51, 0.04);
    --mm-chip: rgba(51, 51, 51, 0.11);

    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    z-index: 10601;
    width: min(420px, 88vw);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--mm-bg);
    color: var(--mm-text);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
}

body.ltr #sliding-menu.mobile-menu,
html[dir="ltr"] #sliding-menu.mobile-menu {
    right: auto;
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-105%);
}

#sliding-menu.mobile-menu.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

body.dark #sliding-menu.mobile-menu {
    --mm-bg: var(--dark-body-bg, #1a1a1a);
    --mm-text: var(--dark-body-text, #e0e0e0);
    --mm-muted: rgba(255, 255, 255, 0.6);
    --mm-line: rgba(255, 255, 255, 0.12);
    --mm-line-soft: rgba(255, 255, 255, 0.1);
    --mm-soft: rgba(255, 255, 255, 0.04);
    --mm-chip: rgba(255, 255, 255, 0.1);
}

/* Overlay */
#sidenav-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10600;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

body.sidenav-open #sidenav-overlay,
#sidenav-overlay.active {
    width: 100%;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
}

body.sidenav-open {
    overflow: hidden;
}

/* Top bar */
#sliding-menu .mm-top {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 25px;
    border-bottom: 1px solid var(--mm-line);
}

#sliding-menu .mm-logo {
    display: flex;
    align-items: center;
    height: 50px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

#sliding-menu .mm-logo img {
    height: 100%;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

body.dark #sliding-menu .mm-logo img {
    filter: none;
}

#sliding-menu .mm-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mm-text);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Panels */
#sliding-menu .mm-panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#sliding-menu .mm-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 18px;
    background: var(--mm-bg);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0s linear 0.35s;
}

#sliding-menu .mm-panel.is-before {
    transform: translateX(30%);
}

#sliding-menu .mm-panel.is-active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0s;
}

body.ltr #sliding-menu .mm-panel,
html[dir="ltr"] #sliding-menu .mm-panel {
    transform: translateX(100%);
}

body.ltr #sliding-menu .mm-panel.is-before,
html[dir="ltr"] #sliding-menu .mm-panel.is-before {
    transform: translateX(-30%);
}

body.ltr #sliding-menu .mm-panel.is-active,
html[dir="ltr"] #sliding-menu .mm-panel.is-active {
    transform: translateX(0);
}

/* Menu list */
#sliding-menu .mm-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 0;
}

#sliding-menu .mm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

#sliding-menu .mm-link {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    padding: 6px 25px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--mm-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

#sliding-menu .mm-link--all {
    font-weight: 500;
    color: var(--mm-muted);
}

#sliding-menu .mm-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 38px;
    margin-inline-end: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--mm-text);
    cursor: pointer;
}

body.ltr #sliding-menu .mm-next .mm-chevron,
html[dir="ltr"] #sliding-menu .mm-next .mm-chevron {
    transform: scaleX(-1);
}

#sliding-menu .mm-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 25px;
    border: 0;
    border-bottom: 1px solid var(--mm-line-soft);
    background: var(--mm-soft);
    color: var(--mm-text);
    font-size: 15px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}

#sliding-menu .mm-back .mm-chevron {
    transform: scaleX(-1);
}

body.ltr #sliding-menu .mm-back .mm-chevron,
html[dir="ltr"] #sliding-menu .mm-back .mm-chevron {
    transform: none;
}

/* Promo banner */
#sliding-menu .mm-promo {
    padding: 14px 18px 6px;
}

#sliding-menu .mm-promo a {
    display: block;
    overflow: hidden;
    border-radius: 12px;
}

#sliding-menu .mm-promo img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

/* Contact / social */
#sliding-menu .mm-social {
    margin-top: 8px;
    border-top: 1px solid var(--mm-line-soft);
}

#sliding-menu .mm-social__title {
    margin: 0;
    padding: 16px 25px;
    font-size: 15px;
    font-weight: 500;
    color: var(--mm-text);
}

#sliding-menu .mm-social__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 25px;
}

#sliding-menu .mm-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--mm-chip);
    color: var(--mm-text);
    font-size: 19px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#sliding-menu .mm-social__btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Footer bar */
#sliding-menu .mm-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--mm-soft);
    border-top: 1px solid var(--mm-line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

#sliding-menu .mm-footer--two {
    grid-template-columns: repeat(2, 1fr);
}

#sliding-menu .mm-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 82px;
    padding: 12px 6px;
    border: 0;
    background: transparent;
    color: var(--mm-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#sliding-menu .mm-action + .mm-action {
    border-inline-start: 1px solid var(--mm-line-soft);
}

#sliding-menu .mm-action__sub {
    font-weight: 400;
    color: var(--mm-muted);
}

#sliding-menu .mm-action__icon {
    position: relative;
    display: inline-flex;
}

#sliding-menu .mm-badge {
    position: absolute;
    top: -8px;
    inset-inline-end: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--primary-color, #222222);
    color: var(--text-color-primary-bg, #ffffff);
    font-size: 10px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

#sliding-menu .mm-badge.d-none {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    #sliding-menu .mm-close:hover,
    #sliding-menu .mm-action:hover {
        background: var(--mm-chip);
    }

    #sliding-menu .mm-link:hover {
        color: var(--primary-color, inherit);
    }

    #sliding-menu .mm-social__btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    #sliding-menu .mm-promo a:hover img {
        transform: scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    #sliding-menu.mobile-menu,
    #sliding-menu .mm-panel,
    #sidenav-overlay {
        transition: none;
    }
}

/* ==========================================================================
   Header icons: same box size, same vertical center, equal spacing
   (verified on desktop and at 390px wide)
   ========================================================================== */

.search-header-bar .header-cart {
    gap: 14px;
}

.search-header-bar .header-cart > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.search-header-bar div:has(> .a-shopping-cart),
.search-header-bar .account-area {
    display: flex;
    align-items: center;
}

.search-header-bar .sm-search-icon,
.search-header-bar .a-shopping-cart,
.search-header-bar .account-area .account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0;
    line-height: 1;
}

/* Language/currency globe: inline SVG, same box as the other icons */
.search-header-bar .language-currency {
    display: inline-flex;
    align-items: center;
    height: 28px;
    line-height: 0;
    padding: 0 !important;
}

.search-header-bar .language-currency .currency-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    vertical-align: top;
}

body.dark .search-header-bar .currency-btn {
    color: var(--dark-header-text);
}

/* !important: the toggle button has an inline `all: unset` */
.search-header-bar #theme-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
}

.search-header-bar #theme-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

@media (max-width: 991.98px) {
    .search-header-bar .header-cart {
        gap: 10px;
    }

    .search-header-bar .header-logo {
        gap: 10px;
    }

    .search-header-bar .ic.menu {
        position: static;
        margin: 0 !important;
        left: auto;
        right: auto;
    }

    #theme-toggle-mobile-slot {
        height: 28px;
    }

    .search-header-bar .sm-search-icon {
        width: 28px;
    }
}

/* Logo height: desktop and mobile come from the header settings */
.search-header-bar .header-logo-wrap {
    height: var(--logo-h, 40px);
}

@media (max-width: 991.98px) {
    .search-header-bar .header-logo-wrap {
        height: var(--logo-h-mobile, 32px);
    }
}

.search-header-bar .header-logo-wrap .image-logo,
.search-header-bar .header-logo-wrap .image-logo-dark {
    padding: 0;
    height: 100%;
}

/* Desktop: let the logo height set the header height.
   The nav items had 14px top/bottom padding, which made them (68px) the tallest
   thing in the header, so lowering the logo height had no visible effect. */
@media (min-width: 992px) {
    .search-header .mega-root-item {
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Space between menu links: 28px text to text (was ~48px) */
    .search-header .mega-nav-root {
        gap: 28px;
    }

    .search-header .mega-root-item > a {
        padding-left: 0;
        padding-right: 0;
    }

    /* Invisible bridge under a hovered link so the pointer can reach the
       dropdown panel (anchored to the bottom of the header) without closing it */
    .search-header .mega-root-item.has-children > a {
        position: relative;
    }

    .search-header .mega-root-item.has-children:hover > a::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 40px;
    }
}
