/* Header designs: boutique desktop header + shared mobile header */

@media (max-width: 991.98px) {
    .sf-desktop-header { display: none !important; }
}
@media (min-width: 992px) {
    .sf-mh { display: none !important; }
}

/* ---------- Shared icon / badge ---------- */
.sf-bq-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--bq-color) !important;
    font-size: 20px;
    text-decoration: none !important;
    border-radius: 50%;
    transition: background .15s;
}
.sf-bq-icon:hover { background: rgba(255, 255, 255, .12); }
.sf-bq-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #fff;
    color: var(--bq-bg);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bq-bg);
}
.sf-bq-badge.is-empty { display: none; }

.sf-profile--bar .sf-profile-btn,
.sf-profile--bar .sf-profile-btn.is-auth {
    width: 38px;
    height: 38px;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--bq-color) !important;
    font-size: 19px;
    box-shadow: none !important;
}
.sf-profile--bar .sf-profile-btn.is-auth {
    border-color: var(--bq-color) !important;
    font-size: 15px;
}
/* Match cart/hamburger — no orange sticky hover on dark header bar */
.sf-profile--bar .sf-profile-btn:hover,
.sf-profile--bar .sf-profile-btn:focus,
.sf-profile--bar .sf-profile-btn:active,
.sf-profile.sf-profile--bar.is-open .sf-profile-btn,
.sf-profile.sf-profile--bar.is-open .sf-profile-btn.is-auth {
    background: rgba(255, 255, 255, .12) !important;
    color: var(--bq-color) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
.sf-profile.sf-profile--bar.is-open .sf-profile-btn.is-auth {
    border-color: var(--bq-color) !important;
}

/* ---------- Boutique desktop header ---------- */
.sf-bq { position: relative; z-index: 50; background: #fff; }
.sf-bq-bar { background: var(--bq-bg); color: var(--bq-color); }
.sf-bq-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 76px;
}
.sf-bq-inner::before, .sf-bq-inner::after { display: none !important; }

.sf-bq-nav { position: relative; min-width: 0; display: flex; align-items: center; }
.sf-bq-nav-scroll {
    display: flex;
    align-items: center;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    min-width: 0;
    padding: 6px 0;
}
.sf-bq-nav-scroll::-webkit-scrollbar { display: none; }
.sf-bq-nav-scroll a {
    flex: 0 0 auto;
    color: var(--bq-color) !important;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none !important;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: border-color .15s, opacity .15s;
}
.sf-bq-nav-scroll a:hover, .sf-bq-nav-scroll a.is-active, .sf-bq-nav-scroll a.is-hover { border-bottom-color: var(--bq-color); }
.sf-bq-nav.has-prev .sf-bq-nav-scroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px); mask-image: linear-gradient(90deg, transparent 0, #000 36px); }
.sf-bq-nav.has-next .sf-bq-nav-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); }
.sf-bq-nav.has-prev.has-next .sf-bq-nav-scroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); }
.sf-bq-nav-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 26px;
    height: 26px;
    margin-top: -13px;
    border: 0;
    border-radius: 4px;
    background: var(--bq-color);
    color: var(--bq-bg);
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.sf-bq-nav-prev { left: 0; }
.sf-bq-nav-next { right: 0; }
.sf-bq-nav-arrow[hidden] { display: none; }
/* Mega menu (desktop hover) */
.sf-mega {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.sf-mega[hidden] { display: none; }
.sf-mega { padding: 22px 0 28px; }
.sf-mega .sf-mega-grid { position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.sf-mega .sf-mega-grid::before, .sf-mega .sf-mega-grid::after { display: none !important; }
.sf-mega-side { display: flex; flex-direction: column; border-right: 1px solid #f0f0f0; padding-right: 10px; }
.sf-mega-side a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    color: #222 !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 4px;
}
.sf-mega-side a:hover, .sf-mega-side a.is-active { background: #f7f3f1; color: var(--bq-bg) !important; }
.sf-mega-side a .fa { font-size: 12px; opacity: .6; }
.sf-mega-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-right: 40px; }
.sf-mega-title { font-size: 18px; font-weight: 600; color: #222; }
.sf-mega-all { font-size: 13px; color: #555 !important; text-decoration: none !important; }
.sf-mega-all:hover { color: var(--bq-bg) !important; text-decoration: underline !important; }
.sf-mega-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.sf-mega-card { display: flex; flex-direction: column; gap: 6px; color: #222 !important; text-decoration: none !important; }
.sf-mega-card-img { aspect-ratio: 3 / 4; background: #f5f3f0; overflow: hidden; border-radius: 4px; }
.sf-mega-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.sf-mega-card:hover .sf-mega-card-img img { transform: scale(1.04); }
.sf-mega-card-name { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-mega-card-price { font-size: 13px; font-weight: 700; }
.sf-mega-card-price s { color: #999; font-weight: 400; margin-left: 6px; }
.sf-mega-skel { aspect-ratio: 3 / 4; border-radius: 4px; background: linear-gradient(90deg, #f3f3f3 25%, #e9e9e9 37%, #f3f3f3 63%); background-size: 400% 100%; animation: sfMegaSkel 1.2s ease infinite; }
@keyframes sfMegaSkel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sf-mega-empty { color: #777; font-size: 14px; padding: 30px 0; }
.sf-mega-close { position: absolute; top: -8px; right: 15px; width: 32px; height: 32px; border: 0; background: none; font-size: 26px; line-height: 1; color: #333; cursor: pointer; }

.sf-bq-logo { text-align: center; }
.sf-bq-logo img { max-height: 58px; max-width: 220px; width: auto; display: inline-block; }

.sf-bq-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.sf-bq-search { position: relative; flex: 0 1 240px; min-width: 150px; margin-right: 8px; }
.sf-bq-search form { position: relative; display: flex; align-items: center; margin: 0; }
.sf-bq-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 4px;
    background: rgba(255, 255, 255, .08);
    color: var(--bq-color);
    font-size: 13px;
    outline: none;
}
.sf-bq-search input::placeholder { color: var(--bq-color); opacity: .75; }
.sf-bq-search input:focus { border-color: var(--bq-color); background: rgba(255, 255, 255, .14); }
.sf-bq-search button {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--bq-color);
    padding: 4px 6px;
    cursor: pointer;
}

/* ---------- Category circles (desktop + mobile) ---------- */
.sf-bq-cats { background: #fff; border-bottom: 1px solid #eee; }
.sf-circles { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sf-circles::-webkit-scrollbar { display: none; }
.sf-circles-track { display: flex; gap: 18px; width: max-content; margin: 0 auto; padding: 12px 4px 10px; }
.sf-circle {
    flex: 0 0 auto;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #222 !important;
}
.sf-circle-img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f1ee;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent;
    transition: box-shadow .15s, transform .15s;
}
.sf-circle-img.sf-nav-img--rounded { border-radius: 16px; }
.sf-circle-img.sf-nav-img--square { border-radius: 0; }
.sf-circle-img.sf-nav-img--hexagon,
.sf-circle-img.sf-nav-img--diamond { border-radius: 0; }
.sf-circle-img.sf-nav-img--leaf { border-radius: 0 50%; }
.sf-circle-img.sf-nav-img--oval { width: 76px; height: 52px; border-radius: 50%; }
.sf-circle-img.sf-nav-img--oval-v { width: 50px; height: 70px; border-radius: 50%; }
.sf-circles--text .sf-circles-track { gap: 10px; }
.sf-circles--text .sf-circle { width: auto; }
.sf-circles--text .sf-circle-label {
    display: block; white-space: nowrap; font-size: 13px; font-weight: 600;
    padding: 7px 16px; border: 1px solid #e3e3e3; border-radius: 999px; background: #fff;
    transition: border-color .15s, background .15s;
}
.sf-circles--text .sf-circle:hover .sf-circle-label { border-color: #111; }
.sf-circles--text .sf-circle.is-active .sf-circle-label { background: #111; border-color: #111; color: #fff; }
.sf-circle-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-circle-all { background: var(--bq-bg); color: var(--bq-color); font-size: 22px; }
.sf-circle:hover .sf-circle-img { transform: translateY(-2px); }
.sf-circle.is-active .sf-circle-img { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }
.sf-circle-label {
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

/* ---------- Mobile header ---------- */
.sf-mh { position: relative; z-index: 60; background: #fff; }
.sf-mh-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 64px;
    padding: 6px 10px;
    background: var(--bq-bg);
    color: var(--bq-color);
}
.sf-mh-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: none;
    color: var(--bq-color);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.sf-mh-logo { text-align: center; }
.sf-mh-logo img { max-height: 46px; max-width: 160px; width: auto; display: inline-block; }
.sf-mh-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.sf-mh-actions .sf-profile-menu { right: 0; left: auto; z-index: 1200; }

/* Mobile / touch: never open profile menu via sticky :hover */
@media (max-width: 991.98px), (hover: none), (pointer: coarse) {
    .sf-profile:hover .sf-profile-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
    .sf-profile.is-open .sf-profile-menu {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

.sf-mh-search { position: relative; padding: 10px 12px; border-bottom: 1px solid #eee; background: #fff; }
.sf-mh-search form { position: relative; display: flex; align-items: center; margin: 0; }
.sf-mh-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 44px;
    border: 0;
    border-radius: 8px;
    background: #f5f5f5;
    color: #222;
    font-size: 15px;
    outline: none;
}
.sf-mh-search input:focus { background: #efefef; }
.sf-mh-search button {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: #333;
    font-size: 18px;
    padding: 4px 8px;
}
.sf-mh-cats { border-bottom: 1px solid #eee; background: #fff; }
.sf-mh-cats .sf-circles-track { margin: 0; padding: 12px 12px 10px; gap: 14px; }
.sf-mh-cats .sf-circle { width: 80px; }
.sf-mh-cats .sf-circle-img { width: 70px; height: 70px; }
.sf-mh-cats .sf-circle-img.sf-nav-img--oval { width: 80px; height: 54px; }
.sf-mh-cats .sf-circle-img.sf-nav-img--oval-v { width: 54px; height: 76px; }
.sf-mh-cats .sf-circles--text .sf-circle { width: auto; }
.sf-mh-cats .sf-circle-label { font-size: 13px; color: #333; }

.sf-mh-drawer { position: fixed; inset: 0; z-index: 2000; visibility: hidden; }
.sf-mh-drawer.is-open { visibility: visible; }
.sf-mh-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.sf-mh-drawer.is-open .sf-mh-overlay { opacity: 1; }
.sf-mh-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    background: #fff;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .15);
}
.sf-mh-drawer.is-open .sf-mh-panel { transform: none; }
.sf-mh-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 12px 18px;
    background: var(--bq-bg);
    color: var(--bq-color);
}
.sf-mh-panel-title { font-weight: 700; font-size: 16px; }
.sf-mh-panel-head .sf-mh-btn { font-size: 28px; }
.sf-mh-links { display: flex; flex-direction: column; padding: 6px 0; }
.sf-mh-links + .sf-mh-links { border-top: 1px solid #eee; }
.sf-mh-links a,
.sf-mh-links summary,
.sf-mh-links button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    color: #222 !important;
    font-size: 15px;
    text-decoration: none !important;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}
.sf-mh-links a i, .sf-mh-links button i { width: 18px; color: #888; text-align: center; }
.sf-mh-links summary { justify-content: space-between; list-style: none; }
.sf-mh-links summary::-webkit-details-marker { display: none; }
.sf-mh-links details[open] summary > .fa-angle-down { transform: rotate(180deg); }
.sf-mh-links details a { padding-left: 36px; font-size: 14px; color: #555 !important; }
.sf-mh-cat-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sf-mh-cat-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f3f3f3;
    border: 1px solid #eee;
}
.sf-mh-cat-arrow {
    width: 18px !important;
    color: #999 !important;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}
.sf-mh-links details a .sf-mh-cat-arrow { width: 14px !important; font-size: 13px; }
body.sf-mh-lock { overflow: hidden; }

/* Mobile bottom bar */
.sf-mbb { display: none; }
@media (max-width: 991.98px) {
    .sf-mbb {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        align-items: center;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #fff;
        border-top: 1px solid #eee;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
    }
    .sf-mbb-btn {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 56px;
        border: 0;
        background: none;
        color: #111 !important;
        text-decoration: none !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .sf-mbb-btn svg { width: 26px; height: 26px; }
    .sf-mbb-btn:disabled { color: #bbb !important; cursor: default; }
    .sf-mbb-btn.is-active { color: var(--bq-bg, #7b3522) !important; }
    .sf-mbb-btn:active:not(:disabled) svg { transform: scale(.9); }
    .sf-mbb-badge {
        position: absolute;
        top: 9px;
        left: calc(50% + 6px);
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: #e53935;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
    }
    .sf-mbb-badge.is-empty { display: none; }
    .sf-mbb-badge--dark { background: #111; }
    body.sf-has-mbb { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
    body.sf-has-mbb .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
    body.sf-has-mbb .sf-filter-fab { bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Mobile product grid with 1 / 2 / 4 per-row switch (shop, wishlist) */
@media (max-width: 767.98px) {
    .sf-view-btns { display: flex; gap: 8px; }
    .sf-view-btn { width: 30px; height: 30px; padding: 3px; border: 0; background: none; color: #bbb; cursor: pointer; display: grid; gap: 2px; }
    .sf-view-btn.is-active { color: #111; }
    .sf-view-btn span { background: currentColor; border-radius: 1px; }
    .sf-view-btn[data-cols="1"] span { border: 2px solid currentColor; background: none; }
    .sf-view-btn[data-cols="1"] { grid-template-columns: 1fr; }
    .sf-view-btn[data-cols="2"] { grid-template-columns: repeat(2, 1fr); gap: 3px; }
    .sf-view-btn[data-cols="2"] span { border: 2px solid currentColor; background: none; }
    .sf-view-btn[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }

    .sf-shop-grid.em-product-grid { margin: 0 -4px; }
    .sf-shop-grid.em-product-grid > .em-col { padding: 4px !important; }
    .sf-shop-grid[data-cols="1"] > .em-col { width: 100% !important; }
    .sf-shop-grid[data-cols="2"] > .em-col { width: 50% !important; }
    .sf-shop-grid[data-cols="4"] > .em-col { width: 25% !important; padding: 2px !important; }
    .sf-shop-grid[data-cols="4"] { margin: 0 -2px; }
    .sf-shop-grid[data-cols="4"] .right-block,
    .sf-shop-grid[data-cols="4"] .button-group,
    .sf-shop-grid[data-cols="4"] .sf-badge { display: none !important; }
    .sf-shop-grid[data-cols="4"] .product-item-container,
    .sf-shop-grid[data-cols="4"] .item-inner { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
    .sf-shop-grid .product-image-container { min-height: 0 !important; height: auto !important; }
    .sf-shop-grid .product-image-container img { width: 100% !important; height: auto !important; max-height: none !important; aspect-ratio: 3 / 4; object-fit: cover !important; }
    .sf-shop-grid[data-cols="4"] .product-image-container { background: none !important; }
}
