/* Smart Listino Plus - Ultra Premium UI (2026 Edition) */
:root {
    --sl-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --sl-glass: blur(15px) saturate(180%);
    --slp-z-cart: 100000;
    --slp-z-stack: 100010;
}

/* Scoped to Standalone App Only */
body.slp-standalone * {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #e5e5ea transparent;
}

body.slp-standalone *::-webkit-scrollbar:horizontal {
    display: none;
}

body.slp-standalone {
    overflow-x: clip !important;
}

/* Re-enable vertical scroll for containers that need it */
.modal-scroll {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body.slp-standalone {
    background: var(--sl-body-bg, #f5f5f7) !important;
    color: #1c1c1e;
    margin: 0;
    padding: 0;
    font-family: var(--sl-font);
    -webkit-font-smoothing: antialiased;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    overflow-x: clip;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    /* Modern way to hide horizontal without breaking sticky */
}

html {
    width: 100%;
    overflow-x: clip;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

body.slp-modal-open {
    overflow: hidden !important;
    height: 100vh;
}

@media (min-width: 1024px) {
    body.slp-modal-open.slp-standalone {
        overflow: auto !important;
        height: auto;
    }
}

/* Splash Screen (Animated) */
#slp-splash {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    /* Non bloccare click al catalogo sotto (login overlay pass-through + splash stack) */
    pointer-events: none;
}

#slp-splash.slp-splash-hidden {
    display: none !important;
    pointer-events: none;
}

#slp-splash img {
    width: 300px;
    max-width: 80%;
    height: auto;
    background: #000000;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slpBreath 1.00s infinite ease-in-out;
}

@keyframes slpBreath {

    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Premium Header */
.slp-header {
    background: var(--sl-head-bg);
    color: var(--sl-head-txt);
    padding: 10px 20px;
    /* Reduced from 15px */
    padding-top: calc(10px + env(safe-area-inset-top));
    /* Supporto Notch */
    text-align: center;
    border-bottom: 2px solid var(--sl-head-border);
}

.slp-header img {
    height: 35px;
    /* Slightly smaller logo too if needed */
    cursor: pointer;
    transition: transform 0.2s;
    touch-action: manipulation;
    /* Disabilita Zoom Double-Tap */
}

.slp-header img:active {
    transform: scale(0.9);
}

.slp-header h1 {
    display: none;
    /* Hide 'Smartphone Italia Srl' text */
}

.listino-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    margin-top: 10px;
}

.header-status {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dot-pulse {
    width: 8px;
    height: 8px;
    background: #34A853;
    border-radius: 50%;
    display: inline-block;
    animation: slpPulse 1.55s infinite;
}

/* Pulse Semplificato (Opacity Fade) */
@keyframes slpPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.slp-phones-bar {
    max-width: 600px;
    margin: 0 auto 8px;
    padding: 0 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.slp-phones-home.icon-home {
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 122, 255, 0.15);
}

.slp-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #111;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 122, 255, 0.15);
    pointer-events: auto;
}

.slp-phone-num {
    color: #007aff;
}

/* Modern Toolbar */
.slp-toolbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--sl-shadow);
}

.tb-flex {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px 0;
}

.tb-col {
    display: flex;
    align-items: center;
}

.tb-col.left {
    flex: 0 0 auto;
    order: 1;
}

.tb-col.center {
    flex: 1 0 100%;
    order: 2;
    justify-content: center;
}

.tb-col.right {
    flex: 0 0 auto;
    order: 3;
    justify-content: flex-end;
}

@media (min-width: 600px) {
    .tb-flex {
        max-width: 1000px;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 10px;
    }

    .tb-col.left,
    .tb-col.right,
    .tb-col.center {
        flex: 0 0 auto;
        padding: 0;
    }

    .tb-col.center {
        width: 400px;
        /* Mantieni una dimensione solida per la ricerca */
    }
}

.btn-modern-toggle {
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 8px 14px;
    background: #fff;
    color: #1c1c1e;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: inline-block;
    letter-spacing: 0.5px;
}

.btn-modern-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-modern-toggle:active {
    transform: scale(0.95);
}

.slp-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.slp-toolbar-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    text-decoration: none;
    color: #fff;
    border: 1px solid transparent;
}

.btn-pdf {
    background: #cf2626;
    border-color: #cf2626;
}

.btn-excel {
    background: #0e9f6e;
    border-color: #0e9f6e;
}

.btn-export-icon {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .slp-toolbar-actions {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    .slp-toolbar-tools {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        gap: 6px;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-right: 2px;
    }

    .slp-toolbar-tools::-webkit-scrollbar {
        display: none;
    }

    .slp-toolbar-tools > .btn-toggle-all,
    .slp-toolbar-tools > .btn-export {
        flex-shrink: 0;
        height: 36px;
        min-height: 36px;
        box-sizing: border-box;
    }

    .slp-phones-home.icon-home {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .slp-phones-home.icon-home svg {
        width: 16px;
        height: 16px;
    }

    .tb-col.left {
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    #btn-toggle-all.btn-toggle-all {
        padding: 0 !important;
        min-width: 36px !important;
        width: 36px !important;
        max-width: 36px !important;
        font-size: 16px !important;
        letter-spacing: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
    }

    .btn-export {
        padding: 5px 8px !important;
        min-width: 0 !important;
        width: auto !important;
        gap: 4px !important;
        font-size: 9px !important;
        justify-content: center;
    }

    .btn-export-icon {
        width: 12px;
        height: 12px;
    }

    .btn-export .btn-export-label {
        display: inline;
        font-size: 9px;
        letter-spacing: 0;
    }

    .mini-cart {
        flex: 0 0 auto;
        width: max-content;
        max-width: none;
        min-width: max-content;
        margin-left: 0;
        height: 36px;
        padding: 6px 10px !important;
        justify-content: center;
        box-sizing: border-box;
    }

    .mini-cart .icon-cart {
        font-size: 14px;
        margin-right: 4px;
        flex-shrink: 0;
    }

    #slp-cart-total {
        font-size: 11px;
        max-width: none !important;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mini-cart .badge-num {
        flex-shrink: 0;
        margin-right: 4px;
    }
}

@media (max-width: 480px) {

    .btn-modern-toggle:not(.btn-export),
    .mini-cart {
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: normal;
    }

    .mini-cart {
        border-radius: 20px;
    }
}

.tb-col.center {
    justify-content: center;
}

.tb-col.right {
    justify-content: flex-end;
}

.icon-home {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-decoration: none;
    background: #fff;
    border-radius: 19px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.icon-home:active {
    transform: scale(0.9);
}

.tb-title {
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 2px;
    color: #8e8e93;
    text-transform: uppercase;
    white-space: nowrap;
    /* Prevent wrapping */
}

@media (max-width: 480px) {
    .tb-title {
        font-size: 10px;
        letter-spacing: 0.5px;
        /* Tighter on mobile */
    }
}

.mini-cart {
    background: var(--bg-cart);
    color: var(--txt-cart);
    padding: 6px 12px;
    /* Reduced button padding */
    border-radius: 18px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    /* Prevent wrapping */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.badge-num {
    background: var(--bg-cart-badge);
    color: var(--txt-cart-badge);
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 50%;
    margin-right: 8px;
}

#slp-cart-total {
    font-weight: var(--w-total);
    font-size: 14px;
}

/* Product List (Modern Cards) */
.slp-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 0 80px;
    /* Removed side padding to use full width */
    width: 100%;
    background: #ffffff;
}

#slp-main-list {
    background: #ffffff;
}

.icon-cart {
    font-size: 14px;
    /* Reduced size as requested */
    margin-right: 5px;
}

.cat-item {
    margin-bottom: 12px;
    border-radius: 20px;
    /* overflow: hidden; Removed to fix sticky/covering issues */
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrap */
    margin-bottom: 5px;
    padding: 5px 5px;
}

.modal-total span:first-child {
    font-size: 14px;
    font-weight: 700;
    color: #8e8e93;
}

#modal-tot-val {
    font-size: 20px;
    font-weight: 900;
    color: #1c1c1e;
}

/* Modal Cart Rows & Controls (.modal-cart-row = riga prodotto drawer) */
.modal-cart-row,
.modal-p-row {
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f7;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) auto auto;
    grid-template-areas: "img info sub controls trash";
    gap: 4px 6px;
    align-items: center;
}

.modal-p-img {
    grid-area: img;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
    border: 1px solid #f2f2f7;
    flex-shrink: 0;
}

.modal-p-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-p-info {
    grid-area: info;
    min-width: 0;
}

.modal-p-name {
    font-weight: 800;
    font-size: 12px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.modal-p-meta {
    font-size: 10px;
    color: #8e8e93;
    font-weight: 600;
}

.modal-p-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    background: #f2f2f7;
    padding: 2px;
    border-radius: 12px;
    flex-shrink: 0;
}

.m-qty-btn {
    width: 26px;
    /* Leggermente pi첫 grande per tocco */
    height: 26px;
    border-radius: 50%;
    /* Cerchio completo */
    border: 1px solid #c7c7cc;
    /* Bordo pi첫 scuro richiesto */
    background: #fff;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #000;
}

.m-qty-btn.plus {
    background: var(--sl-accent);
    color: #fff;
    border: none;
    /* Il plus colorato non necessita bordo */
}

.m-qty-val {
    min-width: 28px;
    height: 28px;
    background: #f2f2f7;
    /* Grigio chiaro sfondo */
    border-radius: 50%;
    /* Cerchio */
    text-align: center;
    line-height: 28px;
    /* Centratura verticale */
    font-size: 13px;
    font-weight: 800;
    margin: 0 6px;
    /* Spaziatura dai tasti */
}

.modal-p-sub {
    grid-area: sub;
    font-weight: 900;
    font-size: 11px;
    min-width: 0;
    max-width: 100%;
    text-align: right;
    color: #1c1c1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.modal-p-trash {
    grid-area: trash;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
    width: 30px;
    justify-self: end;
    align-self: center;
    line-height: 0;
}

/* MOBILE OPTIMIZED CART ROW (GRID) */
@media (max-width: 480px) {
    .modal-cart-row,
    .modal-p-row {
        grid-template-columns: 40px minmax(0, 1fr) auto auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "img info info info"
            "img sub controls trash";
        gap: 2px 4px;
        align-items: center;
        padding: 5px 0 !important;
    }

    .modal-p-img {
        grid-area: img;
        width: 40px;
        height: 40px;
        align-self: center;
    }

    .modal-p-info {
        grid-area: info;
        min-width: 0;
        padding-top: 0;
        margin-bottom: 2px;
        padding-left: 5px;
    }

    .modal-p-name {
        font-size: 13px;
        white-space: normal;
        line-height: 1.2;
    }

    .modal-p-controls {
        grid-area: controls;
        background: transparent;
        padding: 0;
        justify-self: end;
        /* Spingo a destra */
    }

    .modal-p-sub {
        grid-area: sub;
        text-align: right;
        font-size: 10px;
        white-space: nowrap;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        justify-self: stretch;
    }

    .modal-p-trash {
        grid-area: trash;
        margin: 0 !important;
        align-self: center;
        justify-self: end;
        padding: 4px;
        flex-shrink: 0;
        width: 28px;
    }

    /* Nascondo meta info su mobile per pulizia, se necessario? No, lascio */
}

/* Drawer desktop sidebar — sovrascrive inline view.tpl per prezzo lungo + cestino */
@media (min-width: 1024px) {
    #slp-modal .modal-cart-row,
    #slp-modal .modal-p-row {
        grid-template-columns: 60px minmax(0, 1fr) auto auto !important;
        grid-template-areas:
            "info info info info"
            "img sub controls trash" !important;
        gap: 4px 6px !important;
    }

    #slp-modal .modal-p-sub {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        font-size: 11px !important;
        justify-self: stretch !important;
    }

    #slp-modal .modal-p-controls,
    #slp-modal .modal-p-trash {
        flex-shrink: 0 !important;
    }

    #slp-modal .modal-p-trash {
        width: 30px !important;
        justify-self: end !important;
    }
}

.modal-scroll {
    height: 35vh;
    /* Altezza FISSA per evitare salti durante la cancellazione */
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 15px;
    overscroll-behavior: contain;
    /* Evita scroll della pagina sotto */
}

/* Custom Scrollbar for Cart */
.modal-scroll::-webkit-scrollbar {
    width: 4px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #e5e5ea;
    border-radius: 10px;
}

.cat-header {
    padding: var(--pad-cat, 15px) 20px;
    background: var(--bg-cat);
    /* Mantengo colore configurato ma a card */
    color: var(--txt-cat);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 122, 255, 0.15);
    pointer-events: auto;
    /* Card Style Global */
    margin: var(--marg-cat, 10px) 10px 5px 10px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cat-icon::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--txt-cat);
    border-bottom: 2px solid var(--txt-cat);
    transform: rotate(45deg);
    transition: transform 0.3s;
    margin-right: 5px;
}

.cat-header.active .cat-icon::after {
    transform: rotate(-135deg);
}


.cat-header.active {
    border: 1px solid var(--bg-cat);
    /* iOS-like glass when user taps a category */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
    border-radius: 16px;
    /* Restored Rounded */
    margin: 0 10px;
    /* Reduced vertical margins completely */
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #1c1c1e;
    position: sticky;
    top: var(--sl-cat-sticky-top, 60px);
    z-index: 900;
    margin-top: 0;
    width: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.30);
    border-right: 1px solid rgba(255, 255, 255, 0.30);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cat-header.active.is-stuck {
    margin: 0 80px;
    /* Riduzione Pillola (Match Close Btn) */
    border-radius: 50px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.34);
    /* Come la marca: testo centrato, icona a destra assoluta */
    justify-content: center;
    padding-left: 20px;
    padding-right: 45px; /* spazio per icona a destra */
}

/* Blocca icona a destra quando la categoria diventa "pillola" */
.cat-header.active.is-stuck .cat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.cat-header.active.is-stuck .cat-name {
    width: 100%;
    text-align: center;
    font-size: calc(var(--ft-cat, 14px) + 2px);
}

/* Forza colore icona quando attivo su sfondo bianco */
.cat-header.active .cat-icon::after {
    border-color: #1c1c1e;
}

.cat-name {
    font-weight: var(--w-cat);
    font-size: var(--ft-cat);
}

.cat-meta {
    display: none;
    /* Hidden as requested */
}

.brand-item {
    border-top: none;
}

.brand-header {
    padding: var(--pad-brnd, 15px) 20px;
    background: var(--bg-brnd);
    color: var(--txt-brnd);
    font-weight: var(--w-brnd);
    font-size: var(--ft-brand);
    display: flex;
    justify-content: center;
    /* CENTRATO */
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    /* Necessario per icona assoluta */
    /* Card Style Global */
    margin: var(--marg-brnd, 5px) 10px;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Icona Brand Posizionata Assolutamente a Destra */
.brand-icon {
    position: absolute;
    right: 20px;
    display: flex;
    /* Assicura allineamento verticale */
    align-items: center;
}

.brand-icon::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--txt-brnd);
    border-bottom: 2px solid var(--txt-brnd);
    transform: rotate(45deg);
    transition: transform 0.3s;
}

.brand-header.active {
    /* iOS-like glass when user taps a brand */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
    border: 1px solid var(--bg-brnd);
    border-radius: 16px;
    /* Restored Rounded */
    margin: 0 10px 5px 10px;
    /* Side margins, 0 top to attach */
    color: #1c1c1e;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.30);
    -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
    opacity: 1;

    /* STICKY BEHAVIOR RICHIESTO - Adjusted to account for sticky search bar below toolbar */
    position: sticky;
    top: var(--sl-brand-sticky-top, 60px);
    z-index: 890;
    margin-top: 0;
    /* Force touch */
    width: auto;
    border-left: 1px solid var(--bg-brnd);
    border-right: 1px solid var(--bg-brnd);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.brand-header.active.is-stuck {
    margin: 0 80px;
    /* Riduzione Pillola (Match Close Btn) */
    border-radius: 50px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.brand-header.active.is-stuck {
    font-size: calc(var(--ft-brand, 14px) + 2px);
}

.brand-header.last-visited {
    animation: slpHighlight 2s ease-out;
}

@keyframes slpHighlight {
    0% {
        background: rgba(255, 255, 255, 0.22);
    }

    100% {
        background: rgba(255, 255, 255, 0.10);
    }
}

.cat-header.last-visited {
    animation: slpHighlightCat 2s ease-out;
}

@keyframes slpHighlightCat {
    0% {
        background: rgba(255, 255, 255, 0.22);
    }

    100% {
        background: rgba(255, 255, 255, 0.10);
    }
}

.brand-header.active .brand-icon::after {
    transform: rotate(-135deg);
    border-color: #1c1c1e;
}

/* Product Row (Premium) */
.slp-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    /* Natural fit */
}

.p-row {
    transition: all 0.2s;
    background: var(--sl-prod-bg, #ffffff);
    /* Stile Card iOS Globale */
    margin: 8px 10px;
    border-radius: 16px;
    border: 1px solid #f2f2f7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.p-row.selected {
    background: var(--bg-in-cart) !important;
    border: 2px solid var(--bg-in-cart);
    border-radius: 16px;
    margin: 6px 10px;
    /* GLOW VIVIDO */
    box-shadow: 0 0 15px var(--bg-in-cart);
    z-index: 10;
    position: relative;
    border-left: none;
    width: auto;
}

/* Sold-out / terminato */
.p-row--soldout {
    opacity: 0.72;
    background: #f5f5f7 !important;
}

.p-row--soldout .p-img-box img {
    filter: grayscale(0.4);
    opacity: 0.8;
}

.p-row--soldout .p-name,
.p-row--soldout .p-price--soldout {
    color: #8e8e93 !important;
}

.slp-soldout-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 5px;
    background: #ff3b30;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.p-img-box {
    position: relative;
}

.p-qty--soldout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
}

.slp-soldout-inline {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.p-row .q-btn.plus.slp-qty--disabled,
.p-row .q-btn.minus.slp-qty--disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.p-row .q-btn.plus.slp-qty--site-blocked {
    opacity: 0.55 !important;
    cursor: help !important;
    pointer-events: auto;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.25);
}

.p-row--site-reserved .p-qty {
    border-color: #f5c2c7;
    background: #fff8f8;
}

.slp-onsite-hint {
    display: block;
    margin-top: 4px;
    margin-left: auto;
    max-width: 130px;
    text-align: right;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    color: #c62828;
    letter-spacing: 0.01em;
}

.p-row--site-reserved .slp-onsite-hint {
    color: #b71c1c;
}



.p-cell {
    padding: var(--pad-prod, 10px) 6px;
    vertical-align: middle;
}

.p-img-box {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 15px;
    border-radius: 12px;
    background: #f8f8f8;
    overflow: hidden;
    border: 1px solid #eee;
    position: relative;
}

.p-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.p-img-box img.slp-quickview-trigger {
    cursor: pointer;
    touch-action: manipulation;
}

/* Product quick view modal */
.slp-quickview-overlay {
    position: fixed;
    inset: 0;
    z-index: 2050;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 10px;
    backdrop-filter: blur(3px);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.slp-quickview-card {
    background: #fff;
    width: 100%;
    max-width: 680px;
    height: clamp(500px, 58dvh, 640px);
    min-height: 500px;
    max-height: 60dvh;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    touch-action: manipulation;
}

.slp-quickview-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    font-size: 24px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}

.slp-quickview-media {
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f1f1f1;
    background: #fafafa;
}

.slp-quickview-media img {
    width: auto;
    max-width: 100%;
    max-height: clamp(165px, 30vh, 280px);
    height: auto;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
    filter: none;
    image-rendering: auto;
}

.slp-quickview-main {
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.slp-qv-name {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: #111;
}

.slp-qv-price {
    color: var(--sl-accent);
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
}

.slp-qv-characteristics {
    background: #f8f8f8;
    border: 1px solid #ececf1;
    border-radius: 14px;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 0;
    flex: 0 0 auto;
    min-height: 0;
    max-height: 24vh;
    overflow: auto;
}

.slp-qv-spec-title {
    font-size: 12px;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.slp-qv-spec {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid #ececf1;
}

.slp-qv-characteristics::-webkit-scrollbar {
    width: 5px;
}

.slp-qv-characteristics::-webkit-scrollbar-thumb {
    background: #d5d5dd;
    border-radius: 8px;
}

.slp-qv-spec:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.slp-qv-spec span {
    color: #666;
    font-weight: 700;
    flex: 0 0 42%;
}

.slp-qv-spec strong {
    color: #111;
    font-weight: 800;
    text-align: right;
    flex: 1 1 auto;
    word-break: break-word;
}

.slp-qv-empty {
    font-size: 13px;
    color: #777;
    text-align: center;
    padding: 4px 0;
}

.slp-qv-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
    position: static;
    touch-action: manipulation;
}

.slp-qv-qty-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slp-qv-qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.slp-qv-qty-btn.plus {
    background: var(--bg-plus);
    color: var(--txt-plus);
    border-color: transparent;
}

.slp-qv-qty-val {
    min-width: 46px;
    height: 40px;
    border-radius: 20px;
    background: #f2f2f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
}

.slp-qv-add-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    height: 46px;
    background: var(--bg-cart);
    color: var(--txt-cart);
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}

.slp-qv-login-note {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    background: #f6f6f6;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

@media (max-width: 600px) {
    .slp-quickview-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .slp-quickview-card {
        max-width: none;
        width: 100%;
        border-radius: 18px 18px 0 0;
        height: clamp(460px, 56dvh, 620px);
        min-height: 460px;
        max-height: 60dvh;
    }

    .slp-quickview-media img {
        max-height: clamp(170px, 31vh, 270px);
    }

    .slp-qv-name {
        font-size: 20px;
    }

    .slp-qv-price {
        font-size: 24px;
    }

    .slp-qv-characteristics {
        max-height: 22vh;
    }
}

html.slp-quickview-open,
body.slp-standalone.slp-modal-open.slp-quickview-open {
    overflow: hidden !important;
}

.p-name {
    font-weight: var(--w-prod);
    font-size: var(--ft-prod);
    color: #1c1c1e;
    line-height: 1.4;
}

.p-ref {
    font-size: 10px;
    color: #aeaeb2;
    margin-top: 4px;
    font-weight: 600;
}

.p-price--login {
    font-size: 11px;
    font-weight: 700;
    color: #c62828;
    line-height: 1.25;
    max-width: 118px;
}

.p-name.slp-quickview-trigger {
    cursor: pointer;
}

.slp-qv-price--login {
    font-size: 15px;
    color: #c62828;
    line-height: 1.3;
}

.slp-qv-login-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f6f6f6;
    color: #333;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
}

.p-price {
    font-weight: var(--w-price);
    font-size: var(--ft-price);
    color: var(--sl-accent);
    /* Vibrant Red */
    margin-bottom: 8px;
    text-align: center;
    margin-left: auto;
    min-width: 100px;
    /* Centers over Qty buttons */
}

.p-qty {
    display: flex;
    align-items: center;
    background: #fff;
    /* SFONDO QUANTITA BIANCO */
    border: 1px solid #f0f0f0;
    /* Bordo sottile per definirlo */
    border-radius: 20px;
    padding: 3px;
    max-width: 100px;
    margin-left: auto;
    gap: 2px;
}

.q-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-minus);
    color: var(--txt-minus);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    touch-action: manipulation;
    /* DISABILITA IL DOUBLE-TAP TO ZOOM */
}

.q-btn.plus {
    background: var(--bg-plus);
    color: var(--txt-plus);
}

.q-val {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    min-width: 30px;
}



/* Sticky Close */
.btn-close {
    padding: 12px;
    text-align: center;
    font-size: var(--ft-close);
    font-weight: var(--w-close);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    color: var(--txt-close);
    background: var(--bg-close);
    border: 1px solid #ddd;
    position: sticky;
    bottom: 0;
    top: auto;
    clear: both;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    margin: 10px 80px 0 80px;
    /* Flush bottom */
    border-radius: 50px;
    /* Pillola */
    z-index: 880;
    /* Minore di Category (900) e Brand (890) */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-close.cat-close {
    position: relative;
    bottom: auto;
    border-top: none;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Account/profile drawer — same pattern as cart (bottom sheet mobile, sidebar desktop) */
.slp-account-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 11000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
}

.slp-account-panel {
    background: #fff;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    padding: 12px 15px 15px;
    max-height: 88%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}

.slp-account-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.slp-account-header .slp-account-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #1c1c1e;
}

.slp-account-header .slp-close-x {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    font-weight: 300;
    border: none;
    background: transparent;
    padding: 0 4px;
}

.slp-account-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.slp-account-profile-hero {
    text-align: center;
    margin-bottom: 18px;
}

.slp-account-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #fff;
    box-shadow: 0 10px 20px rgba(118, 75, 162, 0.25);
}

.slp-account-name {
    margin: 0 0 4px;
    font-size: 20px;
    color: #333;
    font-weight: 800;
}

.slp-account-sub {
    margin: 0;
    color: #888;
    font-size: 13px;
}

.slp-account-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slp-account-btn {
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 14px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.slp-account-btn:hover {
    background: #f0f0f2;
}

.slp-account-btn--danger {
    margin-top: 6px;
    background: #fff0f0;
    border-color: #ffcccc;
    color: #d9534f;
    font-weight: 700;
    justify-content: center;
}

.slp-account-btn-main {
    font-size: 15px;
}

.slp-account-btn-sub {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

/* Legacy centered overlays (login sub-flows fallback) */
.slp-nav-safe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box;
}

/* Modal (Premium) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
}

.modal-inner {
    background: #fff;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    /* Slightly smaller radius */
    padding: 10px 15px 10px;
    /* Ultra-Reduced vertical padding */
    transform: translateY(0);
    animation: slideUp 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.btn-confirm {
    width: 100%;
    padding: 8px;
    /* Ultra-Reduced padding */
    border-radius: 10px;
    border: none;
    background: #007aff;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 3px;
    /* Ultra-Reduced margin */
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.15);
    cursor: pointer;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-continue {
    width: 100%;
    padding: 8px;
    /* Ultra-Reduced padding */
    border-radius: 10px;
    border: none;
    background: #f2f2f7;
    color: #000000;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    /* Ultra-Reduced margin */
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
}

.btn-continue:hover {
    background: #e5e5ea;
    color: #1c1c1e;
}

.btn-wa {
    width: 100%;
    padding: 8px;
    /* Ultra-Reduced padding */
    border-radius: 10px;
    border: none;
    background: #34c759;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(52, 199, 89, 0.15);
    margin-bottom: 3px;
    /* Ultra-Reduced margin */
    cursor: pointer;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(52, 199, 89, 0.2);
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

@media (max-width: 991px) {
    #slp-modal.modal-overlay {
        z-index: var(--slp-z-cart, 100000);
        top: 0;
        left: 0;
        right: 0;
        bottom: var(--si-bottom-nav-offset, calc(56px + env(safe-area-inset-bottom, 0px)));
    }

    #slp-modal .modal-inner {
        display: flex;
        flex-direction: column;
        max-height: 100%;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    #slp-modal .modal-scroll,
    #slp-modal #modal-list {
        height: auto;
        flex: 1 1 auto;
        min-height: 100px;
        max-height: none;
    }

    #slp-modal .modal-footer {
        flex-shrink: 0;
    }

    .slp-account-overlay,
    #slp-profile-modal,
    #slp-login-modal,
    #slp-register-modal,
    #slp-pwd-modal,
    .slp-nav-safe-overlay {
        bottom: var(--si-bottom-nav-offset, calc(56px + env(safe-area-inset-bottom, 0px))) !important;
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .slp-account-panel,
    .slp-account-overlay > .slp-account-panel,
    #slp-profile-modal > .slp-account-panel,
    #slp-login-modal > .slp-account-panel,
    #slp-register-modal > .slp-account-panel,
    #slp-pwd-modal > .slp-account-panel {
        width: 100%;
        max-width: none;
        max-height: 100%;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }

    .slp-nav-safe-overlay > div,
    #slp-register-modal > div:not(.slp-account-panel) {
        width: 100%;
        max-width: none;
        max-height: 100%;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }

    #slp-quickview-overlay.slp-quickview-overlay {
        z-index: var(--slp-z-cart, 100000);
        bottom: var(--si-bottom-nav-offset, calc(56px + env(safe-area-inset-bottom, 0px)));
    }

    .slp-quickview-card {
        max-height: 100%;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* WA flow + stock errors must sit above open cart drawer */
    #slp-payment-modal,
    #slp-agent-modal,
    #slp-error-modal,
    #slp-success-modal,
    #slp-wa-success-modal {
        z-index: var(--slp-z-stack, 100010) !important;
    }
}

@media (min-width: 1024px) {
    .slp-account-overlay,
    #slp-profile-modal,
    #slp-login-modal,
    #slp-register-modal,
    #slp-pwd-modal {
        background: transparent !important;
        pointer-events: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        top: 20px !important;
        right: 20px !important;
        bottom: 20px !important;
        left: auto !important;
        width: 360px !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .slp-account-panel,
    .slp-account-overlay > .slp-account-panel,
    #slp-profile-modal > .slp-account-panel,
    #slp-login-modal > .slp-account-panel,
    #slp-register-modal > .slp-account-panel,
    #slp-pwd-modal > .slp-account-panel {
        pointer-events: auto !important;
        position: fixed !important;
        right: 20px !important;
        top: 20px !important;
        bottom: 20px !important;
        width: 360px !important;
        max-width: none !important;
        max-height: none !important;
        height: auto !important;
        margin: 0 !important;
        border-radius: 20px !important;
        border: 1px solid #e0e0e0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    }
}

/* Login (Modern) — overlay scuro, listino visibile sotto */
#slp-login {
    background: rgba(0, 0, 0, 0.55);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    z-index: 20000;
    overflow-y: auto;
    pointer-events: none;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#slp-login .login-inner {
    pointer-events: auto;
}

.l-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    /* BLOCCO NERO RICHIESTO */
    background: #000;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.login-inner {
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-inner input {
    width: 100%;
    height: 60px;
    border-radius: 18px;
    background: #f2f2f7;
    border: 1px solid #eee;
    margin-bottom: 15px;
    padding: 0 20px;
    font-size: 17px;
    outline: none;
}

.login-inner button {
    width: 100%;
    height: 60px;
    border-radius: 18px;
    background: #000;
    color: #fff;
    font-weight: 900;
    border: none;
    cursor: pointer;
}

/* Flatten Mode (attiva su Apri Tutto) — header restano cliccabili per chiudere/aprire singole cat */
body.slp-view-flattened .brand-header,
body.slp-view-flattened .cat-header {
    display: flex !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

body.slp-view-flattened .brand-item {
    border-top: none;
}

body.slp-view-flattened .brand-body {
    display: block !important;
}

body.slp-view-flattened .btn-close:not(.cat-close) {
    display: none !important;
}

/* PERFORMANCE OPTIMIZATION */
.cat-body,
.brand-body {
    content-visibility: auto;
    /* Browser skips rendering off-screen content */
    contain-intrinsic-size: 1px 500px;
    /* Placeholder size guess */
}

/* FLUID INTERACTIONS */
.p-row {
    will-change: background-color;
    /* Hint to browser */
}

.modal-inner {
    will-change: transform, opacity;
}

/* Hardware accelerated animations for smooth feel */
.btn-modern-toggle,
.mini-cart,
.btn-confirm,
.btn-wa {
    transform: translateZ(0);
}

/* SEARCH RESULTS CONTAINER */
#slp-search-results {
    background: #fff;
    min-height: 100vh;
}

.search-results-header {
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
    color: var(--sl-primary);
    position: sticky;
    top: 55px;
    /* Sotto la toolbar */
    z-index: 1002;
}

body.slp-search-active .slp-main {
    padding-top: 0;
}

/* Rimosse vecchie regole slp-search-active che creavano confusione */
body.slp-search-active .btn-close {
    display: none !important;
}

/* Keep list readability stable even when sticky pills are active */
body.slp-under-pill-dim .p-row,
body.slp-under-pill-dim .p-name,
body.slp-under-pill-dim .p-price,
body.slp-under-pill-dim .p-price span,
body.slp-under-pill-dim .q-val {
    opacity: 1;
}

/* Banner promozionale ritardato */
.slp-delay-banner-overlay {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.slp-delay-banner-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 28px 22px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    text-align: center;
    font-family: var(--sl-font, -apple-system, system-ui, sans-serif);
}

.slp-delay-banner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.slp-delay-banner-close:active {
    transform: scale(0.95);
}

.slp-delay-banner-img-wrap {
    margin: 0 auto 16px;
}

.slp-delay-banner-img {
    max-width: 360px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

.slp-delay-banner-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: #111;
}

.slp-delay-banner-msg {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
    color: #444;
    white-space: pre-wrap;
}

.slp-delay-banner-btn {
    display: inline-block;
    padding: 14px 22px;
    background: var(--sl-primary, #34A853);
    color: #fff;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.slp-delay-banner-btn:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .slp-delay-banner-card {
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .slp-delay-banner-title {
        font-size: 18px;
    }

    .slp-delay-banner-msg {
        font-size: 14px;
    }
}