/* Child mobile nav — Woodmart-like tabs + drilldown */

.wt-mobile-nav.mobile-menu-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.wt-mobile-nav .mobile-menu-header {
    flex-shrink: 0;
}

.wt-mobile-tabs {
    display: flex;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    border-bottom: 1px solid #e8e8e8;
    background: #f3f3f3;
}

.wt-mobile-tab {
    flex: 1 1 50%;
    margin: 0;
    background: #f3f3f3;
}

.wt-mobile-tab.is-active {
    background: #fff;
}

.wt-mobile-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 8px;
    border: 0;
    background: transparent;
    color: #9aa0a6;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    box-shadow: none;
}

.wt-mobile-tab-btn::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    bottom: -1px;
    height: 2px;
    background: transparent;
}

.wt-mobile-tab-btn.is-active,
.wt-mobile-tab.is-active .wt-mobile-tab-btn {
    color: #222;
}

.wt-mobile-tab-btn.is-active::after,
.wt-mobile-tab.is-active .wt-mobile-tab-btn::after {
    background: var(--wetheme-primary-color, #2e6bff);
}

.wt-mobile-panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.wt-drill-nav {
    position: absolute;
    inset: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wt-drill-nav.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wt-drill-nav:has(.wt-drill-item.is-open) {
    overflow: hidden;
}

.wt-drill-item {
    position: static;
    margin: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.wt-drill-row {
    position: relative;
}

.wt-drill-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 16px;
    color: #222;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.wt-drill-item.has-children > .wt-drill-row .wt-drill-link {
    padding-inline-end: 58px;
}

.wt-drill-link .menu-item-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.wt-drill-link .menu-item-visual--icon i {
    font-size: 18px;
    color: #222;
}

.wt-drill-link .menu-item-visual--image img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.wt-drill-text {
    flex: 1 1 auto;
    line-height: 1.4;
}

.wt-drill-opener {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 48px;
    border: 0;
    border-inline-start: 1px solid #eee;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.wt-drill-opener::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    margin: 0 auto;
    border-top: 2px solid #222;
    border-left: 2px solid #222;
    transform: rotate(-45deg);
}

html[dir="ltr"] .wt-drill-opener::before {
    border-left: 0;
    border-right: 2px solid #222;
    transform: rotate(45deg);
}

.wt-drill-sub {
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 3;
    transform: translateX(-110%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}

html[dir="ltr"] .wt-drill-sub {
    transform: translateX(110%);
}

.wt-drill-item.is-open > .wt-drill-sub {
    transform: translateX(0);
    z-index: 5;
    pointer-events: auto;
}

.wt-drill-back {
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.wt-drill-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: #222;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
}

.wt-drill-back-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #222;
    border-right: 2px solid #222;
    transform: rotate(45deg);
}

html[dir="ltr"] .wt-drill-back-icon {
    border-right: 0;
    border-left: 2px solid #222;
    transform: rotate(-45deg);
}

.wt-drill-sub .wt-drill-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.wt-drill-sub:has(.wt-drill-item.is-open) > .wt-drill-list {
    overflow: hidden;
}

.wt-drill-empty {
    padding: 20px 16px;
    color: #888;
    font-size: 13px;
}

.wt-mobile-nav .mobile-mega-sections,
.wt-mobile-nav .mobile-navigation {
    display: none !important;
}

@media (min-width: 1024px) {
    .wt-mobile-nav {
        display: none;
    }
}

/* FABELLI header search: readable text and on-demand mobile search. */
#masthead input[type="search"], #search-dropdown input[type="search"], .mobile-search-bar input[type="search"] {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000;
}
@media (max-width: 1023px) {
    #masthead .header-search-field, .mobile-search-bar { display: none !important; }
    body.fabelli-mobile-search-open .mobile-search-bar {
        display: flex !important; align-items: center; gap: 8px;
        position: fixed; top: var(--fabelli-search-top, 90px); left: 12px; right: 12px;
        width: auto; margin: 0; padding: 10px; box-sizing: border-box;
        background: #fff; border: 1px solid #ddd; border-radius: 16px;
        box-shadow: 0 6px 24px #00000018; z-index: 10010;
    }
    .mobile-search-bar .mobile-search-form { flex: 1; min-width: 0; margin: 0; }
    .mobile-search-bar .mobile-search-input { min-width: 0; font-size: 16px; }
    .fabelli-mobile-search-close {
        flex: 0 0 32px; width: 32px; height: 40px; padding: 0; border: 0;
        background: transparent; color: #000; font-size: 26px; line-height: 1;
        cursor: pointer; box-shadow: none;
    }
}

/* Keep the native suggestions below the single mobile input. */
@media (max-width: 1023px) {
    #search-dropdown, #search-overlay-bg { display: none !important; }
    body.fabelli-mobile-search-open #search-dropdown {
        display: block !important; position: fixed !important;
        top: calc(var(--fabelli-search-top, 90px) + var(--fabelli-search-height, 74px) + 6px) !important;
        left: 12px !important; right: 12px !important; bottom: auto !important;
        width: auto !important; min-width: 0 !important; margin: 0 !important;
        max-height: calc(100dvh - var(--fabelli-search-top, 90px) - var(--fabelli-search-height, 74px) - 100px) !important;
        overflow-y: auto !important; box-sizing: border-box; transform: none !important;
        opacity: 1 !important; visibility: visible !important; z-index: 10009 !important;
        background: #fff; border-radius: 16px; box-shadow: 0 6px 24px #00000018;
    }
    body.fabelli-mobile-search-open #search-dropdown .search-dropdown-form { display: none !important; }
    body.fabelli-mobile-search-open #search-dropdown .search-dropdown-content { padding: 14px !important; }
}

/* Prevent desktop product titles from extending beneath the gallery. */
@media (min-width: 1024px) {
    .single-product .sp-row-1-header .product-title-with-brand {
        box-sizing: border-box; padding-inline-start: 48px; gap: 16px;
        align-items: flex-start; min-width: 0;
    }
    .single-product .sp-row-1-header .product_title {
        flex: 1 1 auto; min-width: 0; max-width: 100%; height: auto;
        white-space: normal; overflow: visible; text-overflow: clip;
        overflow-wrap: anywhere; word-break: normal;
    }
    .single-product .sp-row-1-header .product-brand-display { flex: 0 0 auto; }
}
