
/* MarketBashi Header — v0.1 */

.mb-site-header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--mb-border);
}

.mb-header-top {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mb-header-brand,
.mb-header-actions,
.mb-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mb-brand-link {
    min-width: 0;
}

.mb-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.mb-brand-name {
    color: var(--mb-primary);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.mb-menu-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--mb-border);
    border-radius: 12px;
    background: var(--mb-surface);
    color: var(--mb-text);
}

.mb-header-actions {
    flex-shrink: 0;
}

.mb-header-account,
.mb-header-cart {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--mb-text);
    font-size: 21px;
    text-decoration: none;
}

.mb-header-cart .mb-cart-count {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mb-primary);
    color: #fff;
    font-size: 11px;
    line-height: 19px;
    text-align: center;
}

.mb-header-search {
    padding-bottom: 14px;
}

.mb-header-search form {
    display: flex;
    width: 100%;
    margin: 0;
}

.mb-header-search input[type="search"] {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--mb-border);
    border-radius: 12px;
    background: var(--mb-surface-soft);
    color: var(--mb-text);
}

.mb-header-search button,
.mb-header-search input[type="submit"] {
    min-height: 46px;
    padding: 0 16px;
    margin-inline-start: 8px;
    border: 0;
    border-radius: 12px;
    background: var(--mb-primary);
    color: #fff;
}

.mb-header-navigation {
    display: none;
}

@media (max-width: 380px) {
    .mb-header-top {
        gap: 5px;
    }

    .mb-brand-name {
        font-size: 0.95rem;
    }

    .mb-header-brand,
    .mb-header-actions,
    .mb-brand-link {
        gap: 5px;
    }

    .mb-menu-toggle,
    .mb-header-account,
    .mb-header-cart {
        width: 34px;
        height: 38px;
    }
}

@media (min-width: 992px) {
    .mb-header-top {
        min-height: 82px;
    }

    .mb-brand-logo {
        width: 52px;
        height: 52px;
    }

    .mb-brand-name {
        font-size: 1.4rem;
    }

    .mb-header-navigation {
        display: block;
        padding-bottom: 12px;
    }

    .mb-header-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
        padding: 0;
        margin: 0;
        list-style: none;
    }
}

/* =========================================
   M.B Mobile Off-Canvas Menu
   ========================================= */

.mb-mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(20, 15, 35, 0.5);
}

.mb-mobile-menu {
    position: fixed;
    z-index: 9991;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
    background: var(--mb-surface);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}

.mb-mobile-menu[hidden],
.mb-mobile-menu-backdrop[hidden] {
    display: none !important;
}

.mb-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--mb-border);
}

.mb-mobile-menu__header strong {
    font-size: 1.1rem;
    color: var(--mb-primary);
}

.mb-mobile-menu__close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--mb-border);
    border-radius: 12px;
    background: var(--mb-surface-soft);
    color: var(--mb-text);
    font-size: 28px;
    line-height: 1;
}

.mb-mobile-menu__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mb-mobile-menu__list li {
    margin: 0;
    border-bottom: 1px solid var(--mb-border);
}

.mb-mobile-menu__list a {
    display: block;
    padding: 13px 8px;
    color: var(--mb-text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.mb-mobile-menu__list a:hover,
.mb-mobile-menu__list a:focus-visible {
    color: var(--mb-primary);
    background: var(--mb-primary-soft);
    border-radius: 8px;
}

/* Nested menu items */

.mb-mobile-menu__list .sub-menu {
    margin: 0;
    padding: 0 16px 8px 0;
    list-style: none;
}

.mb-mobile-menu__list .sub-menu a {
    font-size: 0.88rem;
    color: var(--mb-text-muted);
}

/* Prevent background scrolling */

body.mb-mobile-menu-open {
    overflow: hidden;
}

/* On desktop, use the main navigation */

@media (min-width: 992px) {
    .mb-menu-toggle {
        display: none;
    }

    .mb-mobile-menu,
    .mb-mobile-menu-backdrop {
        display: none !important;
    }
}

/* M.B Mobile Menu — Position Fix */

@media (max-width: 991px) {

    .mb-mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;

        width: 85%;
        max-width: 340px;
        height: 100dvh;

        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;

        z-index: 99999;
    }

    .mb-mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 99998;
    }

    /* Adjust menu for WordPress admin bar */

    body.admin-bar .mb-mobile-menu {
        top: 46px;
        height: calc(100dvh - 46px);
    }
}

/* M.B Mobile Nested Navigation */

@media (max-width: 991px) {

    .mb-mobile-menu__list li.menu-item-has-children {
        position: relative;
    }

    .mb-mobile-menu__list .sub-menu {
        display: none;
        padding: 4px 14px 10px 0;
        margin: 0;
        background: var(--mb-surface-soft);
        border-radius: 12px;
    }

    .mb-mobile-menu__list li.mb-submenu-open > .sub-menu {
        display: block;
    }

    .mb-submenu-toggle {
        position: absolute;
        top: 5px;
        left: 0;
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--mb-primary);
        font-size: 18px;
        cursor: pointer;
    }

    .mb-submenu-toggle:hover,
    .mb-submenu-toggle:focus-visible {
        background: var(--mb-primary-soft);
    }

    .mb-mobile-menu__list .sub-menu li {
        border-bottom: 1px solid var(--mb-border);
    }

    .mb-mobile-menu__list .sub-menu li:last-child {
        border-bottom: 0;
    }

    .mb-mobile-menu__list .sub-menu a {
        padding: 11px 12px;
        font-size: 0.88rem;
    }
}

/* M.B Header Search — Refined Style */

.mb-header-search form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.mb-header-search input[type="search"] {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px 10px 54px;
    border: 1px solid var(--mb-border);
    border-radius: 14px;
    background: var(--mb-surface-soft);
    color: var(--mb-text);
    outline-offset: 3px;
}

.mb-header-search input[type="search"]::placeholder {
    color: var(--mb-text-muted);
    opacity: 1;
}

.mb-header-search button,
.mb-header-search input[type="submit"] {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: var(--mb-primary);
    color: #fff;
    font-size: 0;
}

.mb-header-search button::after,
.mb-header-search input[type="submit"]::after {
    content: "";
    width: 19px;
    height: 19px;
    display: block;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.8' cy='10.8' r='6.8' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='m16 16 5 5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.8' cy='10.8' r='6.8' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='m16 16 5 5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mb-header-search input[type="search"]:focus {
    border-color: var(--mb-primary);
    background: #fff;
}


/* M.B Search Icon — Center Alignment Fix */

.mb-header-search button,
.mb-header-search input[type="submit"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    line-height: 1 !important;
}

.mb-header-search button::after,
.mb-header-search input[type="submit"]::after {
    content: "";
    display: block;
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    transform: none !important;
}
/* MarketBashi — Mobile Menu Stagger Animation */
@media (max-width: 991px) and (prefers-reduced-motion: no-preference) {

    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li {
        opacity: 0;
        animation: mb-menu-item-enter 320ms cubic-bezier(.22, .7, .25, 1) both;
    }

    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(1)  { animation-delay: 0ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(2)  { animation-delay: 35ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(3)  { animation-delay: 70ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(4)  { animation-delay: 105ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(5)  { animation-delay: 140ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(6)  { animation-delay: 175ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(7)  { animation-delay: 210ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(8)  { animation-delay: 245ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(9)  { animation-delay: 280ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(10) { animation-delay: 315ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(11) { animation-delay: 350ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(12) { animation-delay: 385ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(13) { animation-delay: 420ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(14) { animation-delay: 455ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(15) { animation-delay: 490ms; }
    body.mb-mobile-menu-open #mb-mobile-menu .mb-mobile-menu__list > li:nth-child(16) { animation-delay: 525ms; }
}

@keyframes mb-menu-item-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}