/* ============================================
   SPEZIERIA MOBILE BAR - CSS FRONTEND
   v1.1.6
   Prefisso: #spz-mobile-bar, .spz-
   Solo mobile (max-width: 768px)
   ============================================ */

/* Nascosta su desktop */
#spz-mobile-bar {
    display: none;
}

@media (max-width: 768px) {

    /* === NASCONDI BARRA MOBILE NATIVA XSTORE === */
    .et-mobile-panel,
    .et_b_mobile-panel,
    body .etheme-sticky-cart {
        display: none !important;
    }

    /* Compensazione padding body: solo nav = 60px */
    body {
        padding-bottom: 60px !important;
    }

    /* Pagine prodotto con barra verde: padding maggiore */
    body.single-product {
        padding-bottom: 108px !important;
    }

    /* === CONTAINER PRINCIPALE === */
    #spz-mobile-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 99999;
        font-family: 'Lexend', sans-serif;
        -webkit-font-smoothing: antialiased;
    }

    /* === NASCONDE TESTO PREZZO PLUGIN nella barra === */
    #spz-mobile-bar .spz-pricetext {
        display: none;
    }

    /* === RIGA SUPERIORE - PRODOTTO === */
    #spz-bar-product {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 7px 12px;
        transition: all 0.3s ease;
    }

    #spz-bar-product.spz-active {
        background-color: #1a7a3a;
        border-top: 1px solid #22994a;
    }

    /* Prodotto variabile in attesa di selezione */
    #spz-bar-product.spz-variable-waiting {
        background-color: #2a2a2a;
        border-top: 1px solid #3a3a3a;
    }

    /* Messaggio attesa variante (cliccabile) */
    .spz-variable-msg {
        color: #daa520;
        font-size: 11px;
        font-weight: 400;
        letter-spacing: 0.02em;
        text-align: center;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .spz-variable-msg:active {
        color: #f0d060;
    }

    .spz-variable-msg svg {
        stroke: #daa520;
    }

    /* Contenitore attivo variante */
    .spz-variable-active {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    /* Prezzo */
    .spz-product-price {
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        white-space: nowrap;
    }

    .spz-product-price del {
        opacity: 0.5;
        font-size: 11px;
        margin-right: 2px;
    }

    .spz-product-price ins {
        text-decoration: none;
    }

    .spz-product-price .woocommerce-Price-amount {
        color: #fff !important;
    }

    /* Selettore quantita */
    .spz-product-qty {
        display: flex;
        align-items: center;
        background: rgba(0,0,0,0.25);
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
    }

    #spz-mobile-bar .spz-qty-btn {
        background: none;
        border: none;
        color: #fff;
        width: 30px;
        height: 30px;
        font-size: 18px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
        padding: 0;
        margin: 0;
        line-height: 1;
        -webkit-appearance: none;
        appearance: none;
        outline: none;
    }

    #spz-mobile-bar .spz-qty-btn:active {
        background: rgba(255,255,255,0.15);
    }

    #spz-mobile-bar .spz-qty-input,
    #spz-mobile-bar input[type="number"].spz-qty-input {
        width: 26px;
        height: 30px;
        text-align: center;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        font-family: 'Lexend', sans-serif;
        -moz-appearance: textfield;
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
        padding: 0;
        max-width: 26px;
        min-width: 26px;
        outline: none;
        box-shadow: none;
        border-radius: 0;
        opacity: 1;
    }

    #spz-mobile-bar .spz-qty-input::-webkit-inner-spin-button,
    #spz-mobile-bar .spz-qty-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* Pulsante Aggiungi */
    #spz-add-to-cart {
        display: flex;
        align-items: center;
        gap: 5px;
        background: rgba(255,255,255,0.18);
        color: #fff;
        border: none;
        border-radius: 6px;
        padding: 6px 14px;
        font-size: 13px;
        font-weight: 600;
        font-family: 'Lexend', sans-serif;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
        letter-spacing: 0.01em;
        flex-shrink: 0;
    }

    #spz-add-to-cart:active {
        background: rgba(255,255,255,0.3);
        transform: scale(0.97);
    }

    #spz-add-to-cart.spz-adding {
        opacity: 0.6;
        pointer-events: none;
    }

    #spz-add-to-cart.spz-added {
        background: rgba(255,255,255,0.3);
    }

    #spz-add-to-cart svg {
        flex-shrink: 0;
    }

    /* === RIGA INFERIORE - NAVIGAZIONE === */
    #spz-bar-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        background-color: #000;
        border-top: 1px solid #222;
        padding: 5px 0 env(safe-area-inset-bottom, 4px);
    }

    .spz-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        color: #888;
        font-size: 10px;
        font-weight: 400;
        letter-spacing: 0.02em;
        padding: 2px 8px;
        transition: color 0.2s;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .spz-nav-item:active,
    .spz-nav-item:hover {
        color: #FFC600;
        text-decoration: none;
    }

    .spz-nav-item.spz-nav-active {
        color: #FFC600;
    }

    .spz-nav-item svg {
        stroke: currentColor;
    }

    /* Badge carrello */
    .spz-cart-icon-wrap {
        position: relative;
        display: inline-flex;
    }

    .spz-cart-count {
        position: absolute;
        top: -5px;
        right: -8px;
        background: #FFC600;
        color: #000;
        font-size: 9px;
        font-weight: 700;
        min-width: 15px;
        height: 15px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* === FEEDBACK VISIVO === */
    @keyframes spz-pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.15); }
        100% { transform: scale(1); }
    }

    .spz-cart-count.spz-bounce {
        animation: spz-pulse 0.4s ease;
    }

} /* fine media query */
