/* ==========================================================================
   MKS — Header redesign (desktop + mobile)
   Loaded after mks.css from header.php. Scoped to header components only,
   so nothing here leaks into the rest of the theme.
   ========================================================================== */

:root {
    --hdr-red: #cf3040;
    --hdr-red-dark: #a91f2d;
    --hdr-rose: #e4525f;
    --hdr-gold: #f0a13a;
    --hdr-ink: #1f2937;
    --hdr-ink-soft: #4b5563;
    --hdr-muted: #8a919c;
    --hdr-line: #eceef2;
    --hdr-soft: #f5f6f8;
    --hdr-accent: linear-gradient(100deg, #cf3040 0%, #e4525f 55%, #f0a13a 100%);
    --hdr-shadow: 0 18px 44px rgba(17, 24, 39, .12);
    --hdr-ease: cubic-bezier(.33, .9, .35, 1);
}

/* --------------------------------------------------------------------------
   1. Shell
   -------------------------------------------------------------------------- */

header.mks-header {
    position: relative;
    z-index: 1040;
    display: block;
    width: 100%;
}

header.mks-header-mobile {
    position: sticky;
    top: 0;
}

/* The mobile bar is sticky and lives in the normal flow, so the legacy
   fixed-header offset from responsive.css (body{margin-top:49px}) has to go.
   :has() keeps it automatic; the JS-added class is the fallback. */
body:has(> header.mks-header-mobile),
body.mks-mobile-header-in-flow {
    margin-top: 0;
}

/* Keep sticky bars below the WordPress admin bar */
body.admin-bar .dm-nav,
body.admin-bar header.mks-header-mobile {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .dm-nav,
    body.admin-bar header.mks-header-mobile {
        top: 46px;
    }
}

/* --------------------------------------------------------------------------
   2. Desktop — first level (logo / search / account / cart)
   -------------------------------------------------------------------------- */

.dm-header {
    display: block;
    width: 100%;
    background: #fff;
    border-bottom: 0;
    box-shadow: none;
}

.dm-header .mks-bg-black {
    background: #fff;
    padding: 0;
}

.dmh-row {
    display: flex;
    align-items: center;
    gap: 26px;
    min-height: 92px;
    margin: 0;
    padding: 0;
}

/* Logo */
.dmh-logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.dmh-logo {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0;
    text-align: initial;
}

.dmh-logo img {
    display: block;
    width: auto;
    max-width: 200px;
    max-height: 58px;
    padding: 0;
    object-fit: contain;
}

/* Search */
.dmh-search-wrap {
    position: relative;
    flex: 1 1 420px;
    min-width: 0;
    margin: 0;
}

.dmh-search {
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 5px;
    background: var(--hdr-soft);
    border: 1.5px solid transparent;
    border-radius: 14px;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.dmh-search:hover {
    background: #f1f2f5;
}

.dmh-search:focus-within {
    background: #fff;
    border-color: rgba(207, 48, 64, .55);
    box-shadow: 0 0 0 4px rgba(207, 48, 64, .09);
}

.dmh-search form {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
}

.dmh-search-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hdr-red) 0%, var(--hdr-red-dark) 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(207, 48, 64, .22);
    transition: filter .18s ease, box-shadow .18s ease;
}

.dmh-search-submit i {
    font-size: 16px;
    color: #fff;
}

.dmh-search-submit:hover {
    color: #fff;
    filter: brightness(1.07);
    box-shadow: 0 10px 20px rgba(207, 48, 64, .3);
}

.dmh-search-submit:focus-visible {
    outline: 2px solid rgba(207, 48, 64, .45);
    outline-offset: 2px;
}

.dmh-search input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    color: var(--hdr-ink);
}

.dmh-search input:focus,
.dmh-search input:focus-visible {
    outline: none;
    border: 0;
    box-shadow: none;
}

.dmh-search input::placeholder {
    color: var(--hdr-muted);
    opacity: 1;
}

.dmh-search-clear {
    position: static;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    display: none;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-inline-end: 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e7e9ee;
    color: #6b7280;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background .18s ease, color .18s ease;
}

.dmh-search-clear:not(.d-none) {
    display: grid;
}

.dmh-search-clear:hover {
    background: #dcdfe6;
    color: var(--hdr-ink);
}

/* Live search panel */
.dmh-search-wrap .ajax-search-result {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 10px);
    max-height: 470px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--hdr-line);
    border-radius: 18px;
    box-shadow: var(--hdr-shadow);
    z-index: 6;
}

.dmh-search-wrap .ajax-search-result p {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--hdr-ink);
}

.dmh-search-wrap .ajax-search-result p i {
    margin: 0;
    font-size: 18px;
    color: var(--hdr-rose);
}

.dmh-search-wrap .ajax-search-result hr {
    margin: 12px 0;
    border-top: 1px solid var(--hdr-line);
}

.dmh-search-wrap .ajax-search-result ul li a {
    gap: 10px;
    padding: 9px 8px;
    border-bottom: 1px solid #f3f4f6;
    border-radius: 10px;
    transition: background .15s ease;
}

.dmh-search-wrap .ajax-search-result ul li a:hover {
    background: #fff6f7;
}

.dmh-search-wrap .ajax-search-result ul li a span:first-child img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.dmh-search-wrap .ajax-search-result ul li:last-child a {
    padding: 12px 8px 4px;
    color: var(--hdr-red);
    font-weight: 800;
}

.dmh-search-wrap .ajax-search-result .as-cats {
    margin: 0 4px 8px 0;
    padding: 6px 13px;
    border: 1px solid #f4d2d6;
    border-radius: 999px;
    background: #fff7f8;
    color: var(--hdr-red);
    font-size: 13px;
    font-weight: 700;
    transition: .18s ease;
}

.dmh-search-wrap .ajax-search-result .as-cats:hover {
    background: var(--hdr-red);
    border-color: var(--hdr-red);
    color: #fff;
}

.dmh-search-wrap .ajax-search-result .as-cats i {
    font-size: 14px;
    vertical-align: middle;
}

/* Actions */
.dmh-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-inline-start: auto;
}

.dmh-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 48px;
    padding-inline: 14px 16px;
    border: 1px solid var(--hdr-line);
    border-radius: 14px;
    background: #fff;
    color: var(--hdr-ink-soft);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}

.dmh-account-btn:hover {
    border-color: rgba(207, 48, 64, .38);
    background: #fff8f9;
    color: var(--hdr-red);
    box-shadow: 0 6px 18px rgba(207, 48, 64, .08);
}

.dmh-account-btn i.dmh-login-i {
    margin: 0;
    font-size: 19px;
    color: var(--hdr-red);
    vertical-align: middle;
}

.dmh-account-btn .dmh-sep {
    color: #d5d8de;
    font-weight: 400;
}

.dmh-account-btn .dmh-account-caret {
    margin: 0;
    font-size: 12px;
    color: var(--hdr-muted);
    transition: transform .18s ease;
}

.mks-user-logged-in:hover .dmh-account-caret {
    transform: rotate(180deg);
}

/* Cart button */
.dmh-cart-wrap {
    position: relative;
    flex: 0 0 auto;
}

.mdh-cart {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--hdr-red) 0%, var(--hdr-red-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(207, 48, 64, .28);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.mdh-cart:hover,
.mdh-cart:focus-visible {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(207, 48, 64, .34);
    outline: none;
}

.mdh-cart i {
    margin: 0;
    font-size: 23px;
    color: #fff;
}

.mdh-cart span {
    position: absolute;
    top: -7px;
    inset-inline-end: -7px;
    display: block;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--hdr-red);
    font-size: 11.5px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(17, 24, 39, .16);
    z-index: 1;
}

/* Mini cart panel */
.mini-cart {
    position: absolute;
    inset-inline-end: 0;
    inset-inline-start: auto;
    top: calc(100% + 12px);
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 16px;
    background: #fff;
    border: 1px solid var(--hdr-line);
    border-radius: 18px;
    box-shadow: var(--hdr-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 3;
}

#mdh-cart:hover .mini-cart,
#mdh-cart:focus-within .mini-cart {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mini-cart::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    width: 100%;
    height: 16px;
    background: transparent;
}

.mini-cart > .row {
    --bs-gutter-x: 12px;
    margin-inline: -6px;
}

.mini-cart .mini-cart-item-bb {
    border-bottom: 1px solid #f3f4f6;
    padding: 10px 0;
}

.mini-cart .mini-cart-item-bb:last-child {
    border-bottom: 0;
}

.mini-cart-image {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.mini-cart-title {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    color: var(--hdr-ink);
}

.mini-cart-price {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--hdr-red);
}

.mini-cart-price > .price ins {
    font-size: 13px !important;
    font-weight: 800 !important;
    text-decoration: none;
}

.mini-cart-total-info {
    margin-top: 6px;
    padding: 12px 0 0;
    border-top: 1px dashed #e6e8ee;
    background: transparent;
    text-align: right;
}

.mini-cart-total-info p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--hdr-muted);
}

.mini-cart-total-info p span {
    font-size: 13px;
    font-weight: 700;
    color: var(--hdr-muted) !important;
}

.mini-cart-total-info p span:last-child,
.mini-cart-total-info p span:last-child bdi {
    font-size: 15px;
    font-weight: 800;
    color: var(--hdr-ink) !important;
}

.mini-cart-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--hdr-red) 0%, var(--hdr-red-dark) 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 8px 18px rgba(207, 48, 64, .22);
    transition: filter .18s ease;
}

.mini-cart-btn:hover {
    color: #fff;
    filter: brightness(1.05);
}

/* Account dropdown */
.mks-user-logged-in {
    position: relative;
    float: none;
    width: auto;
    cursor: pointer;
    z-index: 4;
}

.mks-user-logged-in:hover {
    background: transparent;
    color: inherit;
}

.mks-user-logged-in > ul {
    position: absolute;
    inset-inline-end: 0;
    inset-inline-start: auto;
    top: calc(100% + 12px);
    display: block;
    min-width: 250px;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--hdr-line);
    border-radius: 16px;
    box-shadow: var(--hdr-shadow);
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 4;
}

.mks-user-logged-in:hover > ul,
.mks-user-logged-in:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mks-user-logged-in > ul > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--hdr-ink-soft);
    font-size: 13.5px;
    font-weight: 600;
    transition: background .15s ease, color .15s ease;
}

.mks-user-logged-in > ul > li > a:hover {
    background: #fff6f7;
    color: var(--hdr-red);
}

.mks-user-logged-in > ul > li > a > i {
    width: 18px;
    font-size: 17px;
    color: var(--hdr-red);
    text-align: center;
    vertical-align: middle;
}

.mks-user-logged-in > ul > li > a[style] {
    border-radius: 10px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. Desktop — second level (sticky category navigation)
   -------------------------------------------------------------------------- */

.dm-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--hdr-line);
    border-bottom: 1px solid var(--hdr-line);
    transition: box-shadow .22s ease;
}

.dm-nav::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    background: var(--hdr-accent);
    opacity: .85;
    pointer-events: none;
}

.dm-nav.is-stuck {
    box-shadow: 0 12px 28px rgba(17, 24, 39, .09);
}

.dm-nav > .container-xxl > .row {
    margin: 0;
}

.dm-nav .col-lg-12 {
    padding: 0;
}

#d-second-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0;
    border-top: 0;
}

.dm-second {
    display: block;
    min-width: 0;
}

.dm-second > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.dm-second > ul > li {
    display: inline-flex;
    position: relative;
    list-style: none;
}

.dm-second > ul > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 15px 13px;
    border-radius: 0;
    background: transparent;
    color: var(--hdr-ink-soft);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    transition: color .18s ease;
}

.dm-second > ul > li > a::after {
    content: "";
    position: absolute;
    inset-inline: 13px;
    bottom: 0;
    height: 3px;
    border-radius: 4px 4px 0 0;
    background: var(--hdr-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .22s var(--hdr-ease);
}

.dm-second > ul > li:hover > a,
.dm-second > ul > li.current-menu-item > a,
.dm-second > ul > li.current-menu-ancestor > a,
.dm-second > ul > li.current-menu-parent > a {
    color: var(--hdr-red);
    background: transparent;
}

.dm-second > ul > li:hover > a::after,
.dm-second > ul > li.current-menu-item > a::after,
.dm-second > ul > li.current-menu-ancestor > a::after,
.dm-second > ul > li.current-menu-parent > a::after {
    transform: scaleX(1);
}

.dm-second > ul > li > a > i {
    margin: 0;
    font-size: 16px;
    vertical-align: middle;
}

/* Chevron for items that hold a sub menu */
.dm-second > ul > li.menu-item-has-children > a::before {
    content: "";
    order: 2;
    width: 5px;
    height: 5px;
    margin-inline-start: 4px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .55;
}

.dm-second > ul > li > ul {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% - 4px);
    display: block;
    min-width: 230px;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--hdr-line);
    border-radius: 16px;
    box-shadow: var(--hdr-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 3;
}

.dm-second > ul > li:hover > ul,
.dm-second > ul > li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.dm-second > ul > li > ul > li {
    list-style: none;
}

/* Flipped by JS when the drop-down would run outside the viewport, and for
   the items that sit at the inline end of the bar (guarded so a short menu
   never flips its first items). */
.dm-second > ul > li > ul.dm-submenu-flip,
.dm-second > ul > li:nth-last-child(-n+3):not(:nth-child(-n+4)) > ul {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.dm-second > ul > li > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--hdr-ink-soft);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.dm-second > ul > li > ul > li > a:hover {
    background: #fff6f7;
    color: var(--hdr-red);
}

/* Categories mega menu button */
.mdh-nested-menu-list {
    display: flex;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.mdh-nested-menu-list > li {
    width: auto;
    background: transparent;
}

.mdh-nested-menu-list > li:hover {
    background: transparent;
}

.mdh-nested-menu-list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: auto;
    padding: 11px 17px;
    border-radius: 12px;
    background: var(--hdr-accent);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(207, 48, 64, .25);
    transition: filter .18s ease, transform .18s ease;
}

.mdh-nested-menu-list > li > a:hover {
    color: #fff !important;
    filter: brightness(1.06);
}

.mdh-nested-menu-list > li > a > i {
    margin: 0;
    font-size: 16px;
    vertical-align: middle;
}

.cat-nested-main {
    top: calc(100% + 14px);
    min-height: 380px;
    border: 1px solid var(--hdr-line);
    border-radius: 20px;
    box-shadow: var(--hdr-shadow);
}

/* --------------------------------------------------------------------------
   4. Mobile — sticky top bar
   -------------------------------------------------------------------------- */

.mobile-main-header {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    background: #fff;
    box-shadow: 0 1px 0 var(--hdr-line), 0 10px 26px rgba(17, 24, 39, .06);
}

.mobile-main-header::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    background: var(--hdr-accent);
    opacity: .9;
    pointer-events: none;
}

.mmh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 60px;
    padding: 8px 12px;
}

.mmh-side {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.mmh-side-end {
    margin-inline-start: auto;
}

.mmh-btn {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--hdr-ink);
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .18s ease, color .18s ease;
}

.mmh-btn i,
.mmh-bar .mmh-btn > i {
    margin: 0;
    font-size: 21px;
    line-height: 1;
    color: inherit;
}

.mmh-btn:active,
.mmh-btn:hover {
    background: var(--hdr-soft);
    color: var(--hdr-red);
}

.mmh-btn:focus-visible {
    outline: 2px solid rgba(207, 48, 64, .5);
    outline-offset: 2px;
}

.mmh-logo {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 2px;
}

.mmh-bar .mmh-logo img {
    display: block;
    width: auto;
    max-width: 132px;
    max-height: 40px;
    object-fit: contain;
}

.mmh-btn-cart {
    background: linear-gradient(135deg, var(--hdr-red) 0%, var(--hdr-red-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(207, 48, 64, .26);
}

.mmh-btn-cart:hover,
.mmh-btn-cart:active {
    background: linear-gradient(135deg, var(--hdr-red) 0%, var(--hdr-red-dark) 100%);
    color: #fff;
    filter: brightness(1.06);
}

.mobile-cart-count {
    position: absolute;
    top: 1px;
    inset-inline-end: 0;
    display: block;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--hdr-red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
    box-sizing: content-box;
}

.mmh-btn-cart .mobile-cart-count {
    background: #fff;
    color: var(--hdr-red);
    border-color: #fff;
    box-shadow: 0 3px 8px rgba(17, 24, 39, .2);
}

/* --------------------------------------------------------------------------
   5. Mobile — offcanvas drawer + search sheet
   -------------------------------------------------------------------------- */

#mobile_cat_menu {
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(86vw, 340px);
    max-width: 340px;
    height: 100%;
    border: 0;
    background: #fff;
    box-shadow: -18px 0 46px rgba(17, 24, 39, .2);
    transform: translateX(-105%);
    transition: transform .3s var(--hdr-ease), visibility .3s;
    z-index: 1045;
}

html[dir="rtl"] #mobile_cat_menu {
    transform: translateX(105%);
}

#mobile_cat_menu.show,
#mobile_cat_menu.showing,
html[dir="rtl"] #mobile_cat_menu.show,
html[dir="rtl"] #mobile_cat_menu.showing {
    transform: none;
}

#mobile_search {
    top: 0;
    bottom: auto !important;
    height: auto !important;
    max-height: 100%;
    padding-bottom: 8px;
    border: 0;
    border-bottom: 1px solid var(--hdr-line);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 24px 48px rgba(17, 24, 39, .18);
    z-index: 1045;
}

.mmh-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hdr-line);
}

.mmh-offcanvas-header .offcanvas-title {
    margin: 0;
    line-height: 1;
}

.offcanvas-mobile-logo {
    width: auto;
    max-width: 118px;
    max-height: 42px;
    object-fit: contain;
}

.mmh-offcanvas-header .btn-close {
    opacity: .55;
    transition: opacity .18s ease, transform .18s ease;
}

.mmh-offcanvas-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

#mobile_cat_menu .offcanvas-body {
    padding-bottom: 28px;
}

/* Drawer menu list */
.mmc-list > ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.mmc-list > ul > li {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
}

.mmc-list > ul > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 13px 16px;
    padding-inline-end: 48px;
    color: var(--hdr-ink);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.mmc-list > ul > li > a:active,
.mmc-list > ul > li > a:hover {
    background: #fff6f7;
    color: var(--hdr-red);
}

.mmc-list > ul > li > a > i {
    margin: 0;
    font-size: 16px;
    color: var(--hdr-red);
    vertical-align: middle;
}

.mmc-li-plus {
    position: absolute;
    top: 50%;
    inset-inline-end: 12px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--hdr-soft);
    color: var(--hdr-ink-soft);
    font-size: 14px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.mmc-li-plus:hover {
    background: #fdeef0;
    color: var(--hdr-red);
}

.mmc-li-dot {
    margin: 0 0 0 2px;
    font-size: 12px;
    color: var(--hdr-rose);
}

.mmc-list > ul > li > ul {
    display: none;
    padding: 4px 0 8px;
    margin: 0;
    list-style: none;
    background: #fafbfc;
    border-top: 1px solid #f3f4f6;
}

.mmc-list > ul > li > ul > li {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
}

.mmc-list > ul > li > ul > li > a {
    display: block;
    padding: 9px 30px;
    padding-inline-end: 48px;
    color: var(--hdr-ink-soft);
    font-size: 13.5px;
    font-weight: 600;
}

.mmc-list > ul > li > ul > li > a:hover {
    color: var(--hdr-red);
}

.mmc-list > ul > li > ul > li > ul {
    display: none;
    padding: 2px 0 6px;
    margin: 0;
    list-style: none;
    background: #f4f5f7;
}

.mmc-list > ul > li > ul > li > ul > li {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
}

.mmc-list > ul > li > ul > li > ul > li > a {
    display: block;
    padding: 8px 44px;
    padding-inline-end: 52px;
    color: var(--hdr-muted);
    font-size: 13px;
}

.custom-close-mobile-menu {
    display: none;
}

/* Search sheet */
#mobile_search .offcanvas-body {
    padding: 18px 16px 4px;
}

#mobile_search .dmh-search {
    height: 48px;
    background: var(--hdr-soft);
    border-radius: 14px;
}

#mobile_search .ajax-search-result {
    position: static;
    margin-top: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: 60vh;
    background: transparent;
}

#mobile_search .ajax-search-result p {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--hdr-ink);
}

#mobile_search .ajax-search-result p i {
    margin-inline-end: 5px;
    font-size: 18px;
    color: var(--hdr-rose);
    vertical-align: middle;
}

#mobile_search .ajax-search-result .as-cats {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px 8px 0;
    padding: 7px 13px;
    border: 1px solid #f4d2d6;
    border-radius: 999px;
    background: #fff7f8;
    color: var(--hdr-red);
    font-size: 13px;
    font-weight: 700;
}

#mobile_search .ajax-search-result .as-cats i {
    margin: 0;
    font-size: 13px;
}

#mobile_search .ajax-search-result hr {
    margin: 12px 0;
    border-top: 1px solid var(--hdr-line);
}

#mobile_search .ajax-search-result ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

#mobile_search .ajax-search-result ul li a span:first-child img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

#mobile_search .ajax-search-result ul li a span:last-child {
    padding: 0;
    font-size: 13.5px;
    font-weight: 600;
}

/* The "added to cart" modal lives inside the header markup */
#mks-aac-modal {
    z-index: 1080;
}

/* --------------------------------------------------------------------------
   6. Small screens / narrow desktop fallbacks
   -------------------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .dmh-row {
        gap: 16px;
        min-height: 82px;
    }

    .dmh-logo img {
        max-width: 158px;
        max-height: 48px;
    }

    .dmh-search-wrap {
        max-width: none;
    }

    .dmh-account-btn {
        padding-inline: 12px;
        height: 46px;
    }

    .mdh-cart {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    .dm-second > ul > li > a {
        padding: 13px 10px;
        font-size: 13.5px;
    }
}

@media (max-width: 991.98px) {
    .dmh-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 0;
        min-height: 0;
    }

    .dmh-logo-wrap {
        order: 1;
    }

    .dmh-actions {
        order: 2;
        margin-inline-start: auto;
    }

    .dmh-search-wrap {
        order: 3;
        flex: 1 0 100%;
    }

    /* Keep the header compact once the search drops to its own row */
    .dmh-account-btn {
        padding-inline: 12px;
    }

    .dmh-account-btn .dmh-sep,
    .dmh-account-btn .dmh-account-label {
        display: none;
    }

    .dmh-account-btn .dmh-account-caret {
        display: none;
    }

    .dm-nav .row {
        margin: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dmh-search,
    .dmh-search-submit,
    .dmh-search-clear,
    .dmh-account-btn,
    .mdh-cart,
    .mini-cart,
    .mks-user-logged-in > ul,
    .dm-second > ul > li > a,
    .dm-second > ul > li > a::after,
    .dm-second > ul > li > ul,
    .mmh-btn,
    #mobile_cat_menu {
        transition: none;
    }
}
