/**
 * Product Shell — tab FP + tabelle (layout = tema Salient/WooCommerce).
 * Selettori su body.fpwoo-product-shell (non dipendono da classi --shell in HTML).
 */
body.fpwoo-product-shell.single-product {
    --fpwoo-shell-accent: #2563eb;
    --fpwoo-shell-accent-hover: #1d4ed8;
    --fpwoo-shell-border: #e2e8f0;
    --fpwoo-shell-surface: #f8fafc;
    --fpwoo-shell-text: #0f172a;
    --fpwoo-shell-muted: #64748b;
    --fpwoo-shell-radius: 12px;
    --fpwoo-shell-radius-sm: 8px;
}

/* Tab FP */
body.fpwoo-product-shell.single-product .woocommerce-tabs.fpwoo-product-tabs,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs {
    margin-top: 2rem;
    margin-bottom: 2rem;
    clear: both;
}

body.fpwoo-product-shell.single-product .woocommerce-tabs ul.tabs:not(.fpwoo-product-tabs__nav) {
    display: none !important;
}

body.fpwoo-product-shell.single-product .fpwoo-product-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    border: none !important;
}

body.fpwoo-product-shell.single-product .fpwoo-product-tabs__nav::before,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__nav::after {
    display: none !important;
}

body.fpwoo-product-shell.fpwoo-product-shell--hide-meta.single-product .product_meta,
body.fpwoo-product-shell.fpwoo-product-shell--hide-meta.single-product .woocommerce-product-meta {
    display: none !important;
}

body.fpwoo-product-shell.single-product .fpwoo-product-tabs__tab {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

body.fpwoo-product-shell.single-product .woocommerce-tabs .fpwoo-product-tabs__nav li a,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__tab a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    padding: 0.65rem 1.35rem !important;
    padding-left: 1.35rem !important;
    padding-right: 1.35rem !important;
    border-radius: 999px !important;
    border: 1px solid var(--fpwoo-shell-border) !important;
    background: #fff !important;
    color: var(--fpwoo-shell-text) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    letter-spacing: normal !important;
}

body.fpwoo-product-shell.single-product .woocommerce-tabs .fpwoo-product-tabs__nav li.active a,
body.fpwoo-product-shell.single-product .woocommerce-tabs .fpwoo-product-tabs__nav li.is-active a,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__tab.active a,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__tab.is-active a,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__tab a[aria-selected="true"] {
    background: var(--fpwoo-shell-accent) !important;
    border-color: var(--fpwoo-shell-accent) !important;
    color: #fff !important;
}

body.fpwoo-product-shell.single-product .fpwoo-product-tabs__panel {
    padding: 1.5rem 1.75rem !important;
    background: #fff;
    border: 1px solid var(--fpwoo-shell-border);
    border-radius: var(--fpwoo-shell-radius);
    color: var(--fpwoo-shell-text);
    line-height: 1.65;
    box-sizing: border-box;
}

/* Niente titolo duplicato sotto il tab (es. «Scheda tecnica» nel pannello) */
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__panel .fpwoo-product-table__title,
body.fpwoo-product-shell.single-product .fpwoo-product-tabs__panel > h2:first-child {
    display: none !important;
}

/* Celle tabella: padding leggibile (override tema ~10px) */
body.fpwoo-product-shell.single-product .fpwoo-product-table__grid th,
body.fpwoo-product-shell.single-product .fpwoo-product-table__grid td {
    padding: 0.85rem 1.2rem !important;
}

/* Tabella inline in summary */
body.fpwoo-product-shell.single-product .fpwoo-product-table--inline {
    margin: 1rem 0 1.25rem;
    padding: 1.1rem 1.25rem !important;
    border: 1px solid var(--fpwoo-shell-border);
    border-radius: var(--fpwoo-shell-radius-sm);
    background: var(--fpwoo-shell-surface);
    box-sizing: border-box;
}

body.fpwoo-product-shell.single-product .fpwoo-product-table--inline .fpwoo-product-table__title {
    margin: 0 0 0.65rem;
    padding: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fpwoo-shell-muted);
    border: none !important;
}

body.fpwoo-product-shell.single-product .fpwoo-product-table--tab {
    margin: 0;
}

/* ATC — riga quantità + CTA a tutta larghezza summary */
body.fpwoo-product-shell.single-product .summary form.cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin: 1.25rem 0 0 !important;
    padding: 0 !important;
    clear: both;
}

/*
 * Prodotti VARIABILI — form variazioni in colonna:
 *   1) dropdown attributi (es. «Lingua») su riga propria, full width
 *   2) sotto: quantità + «Aggiungi al carrello» su stessa riga
 * Override esplicito del flex-row sopra (form.cart) per i form.variations_form.
 */
body.fpwoo-product-shell.single-product .summary form.variations_form.cart {
    display: block !important;
    flex-wrap: initial;
    align-items: initial;
    gap: 0;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations {
    width: 100%;
    margin: 0 0 1.5rem;
    border: 0;
    border-collapse: collapse;
    background: transparent;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations tbody,
body.fpwoo-product-shell.single-product .summary form.variations_form table.variations tr {
    display: block;
    width: 100%;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations th.label,
body.fpwoo-product-shell.single-product .summary form.variations_form table.variations td.value {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: left;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations th.label {
    margin: 0 0 0.6rem;
    color: var(--fpwoo-shell-text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations th.label label {
    margin: 0;
    padding: 0;
    font-weight: 700;
    color: inherit;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations td.value {
    position: relative;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations td.value + th.label,
body.fpwoo-product-shell.single-product .summary form.variations_form table.variations tr + tr th.label {
    margin-top: 1.1rem;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations td.value select {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0.65rem 2.25rem 0.65rem 0.85rem;
    border: 1px solid var(--fpwoo-shell-border);
    border-radius: var(--fpwoo-shell-radius-sm);
    background-color: #fff;
    color: var(--fpwoo-shell-text);
    font-size: 0.95rem;
    line-height: 1.35;
    box-sizing: border-box;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--fpwoo-shell-muted) 50%), linear-gradient(135deg, var(--fpwoo-shell-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

body.fpwoo-product-shell.single-product .summary form.variations_form table.variations td.value select:focus {
    outline: 2px solid var(--fpwoo-shell-accent);
    outline-offset: 1px;
    border-color: var(--fpwoo-shell-accent);
}

body.fpwoo-product-shell.single-product .summary form.variations_form .reset_variations {
    display: inline-block;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--fpwoo-shell-muted);
}

body.fpwoo-product-shell.single-product .summary form.variations_form .single_variation_wrap {
    display: block;
    width: 100%;
    margin: 0;
}

body.fpwoo-product-shell.single-product .summary form.variations_form .single_variation {
    margin: 0 0 0.85rem;
}

body.fpwoo-product-shell.single-product .summary form.variations_form .single_variation:empty {
    margin: 0;
}

body.fpwoo-product-shell.single-product .summary form.variations_form .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin: 0 !important;
    padding: 0 !important;
}

body.fpwoo-product-shell.single-product .summary form.cart .quantity {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 0;
    width: auto !important;
    max-width: none;
    margin: 0 !important;
    float: none !important;
}

body.fpwoo-product-shell.single-product .summary form.cart .quantity .minus,
body.fpwoo-product-shell.single-product .summary form.cart .quantity .plus {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 48px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--fpwoo-shell-border) !important;
    border-radius: var(--fpwoo-shell-radius-sm) !important;
    background: #fff !important;
    color: var(--fpwoo-shell-text) !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer;
    box-shadow: none !important;
}

body.fpwoo-product-shell.single-product .summary form.cart .quantity .qty {
    width: 3.25rem !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0.5rem 0.35rem !important;
    border: 1px solid var(--fpwoo-shell-border) !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: var(--fpwoo-shell-text) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-align: center;
    box-shadow: none !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

body.fpwoo-product-shell.single-product .summary form.cart .quantity .qty::-webkit-outer-spin-button,
body.fpwoo-product-shell.single-product .summary form.cart .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.fpwoo-product-shell.single-product .summary .single_add_to_cart_button.button,
body.fpwoo-product-shell.single-product .summary form.cart .button.single_add_to_cart_button {
    flex: 1 1 12rem;
    width: auto !important;
    max-width: none;
    min-width: 0;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0.85rem 1.5rem !important;
    border-radius: var(--fpwoo-shell-radius-sm) !important;
    border-width: 1px !important;
    border-style: solid !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: normal !important;
    text-align: center;
    text-transform: none !important;
    box-sizing: border-box;
    box-shadow: none !important;
    cursor: pointer;
    background-color: var(--fpwoo-shell-accent) !important;
    border-color: var(--fpwoo-shell-accent) !important;
    color: #fff !important;
}

body.fpwoo-product-shell.single-product .summary .single_add_to_cart_button.button:hover,
body.fpwoo-product-shell.single-product .summary form.cart .button.single_add_to_cart_button:hover {
    background-color: var(--fpwoo-shell-accent-hover) !important;
    border-color: var(--fpwoo-shell-accent-hover) !important;
    color: #fff !important;
}

body.fpwoo-product-shell.single-product .summary .price,
body.fpwoo-product-shell.single-product .summary .price .woocommerce-Price-amount {
    color: var(--fpwoo-shell-accent);
}

/* Sticky mobile */
.fpwoo-sticky-cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* Sotto i banner di consenso cookie/privacy (z-index molto alti): la barra
       non deve coprire il consenso né il pulsante impostazioni privacy. */
    z-index: 9990;
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--fpwoo-shell-border, #e2e8f0);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.1);
}

.fpwoo-sticky-cart__inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fpwoo-sticky-cart__price {
    flex: 1;
    /* Lascia spazio a sinistra per il pulsante flottante consenso/privacy
       (cog in basso a sinistra), così non copre il prezzo. */
    padding-left: 3.5rem;
    font-weight: 700;
    color: var(--fpwoo-shell-accent, #2563eb);
}

.fpwoo-sticky-cart__btn {
    flex: 0 1 auto;
    min-height: 48px;
    padding: 0.75rem 1.35rem;
    border: none;
    border-radius: var(--fpwoo-shell-radius-sm, 8px);
    background: var(--fpwoo-shell-accent, #2563eb);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
}

@media (max-width: 768px) {
    body.fpwoo-product-shell.single-product .summary form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    body.fpwoo-product-shell.single-product .summary form.cart .quantity {
        justify-content: center;
        width: 100% !important;
    }

    body.fpwoo-product-shell.single-product .summary .single_add_to_cart_button.button,
    body.fpwoo-product-shell.single-product .summary form.cart .button.single_add_to_cart_button {
        flex: 1 1 100%;
        width: 100% !important;
    }

    body.fpwoo-product-shell.single-product .summary form.variations_form .woocommerce-variation-add-to-cart {
        flex-direction: column;
        align-items: stretch;
    }

    body.fpwoo-product-shell.single-product .summary form.variations_form .woocommerce-variation-add-to-cart .quantity {
        justify-content: center;
        width: 100% !important;
    }

    body.fpwoo-product-shell.single-product .fpwoo-product-tabs--accordion .fpwoo-product-tabs__nav {
        flex-direction: column;
    }

    body.fpwoo-product-shell.single-product .fpwoo-product-tabs--accordion .fpwoo-product-tabs__tab a {
        width: 100%;
        justify-content: flex-start;
    }

    body.fpwoo-product-shell.single-product {
        padding-bottom: 4.5rem;
    }
}

@media (min-width: 769px) {
    .fpwoo-sticky-cart {
        display: none !important;
    }
}

/* Nasconde il bottone social/share flottante di Salient sulla pagina prodotto
   (`div.nectar-social.fixed.woo`, position:fixed in basso a destra): si
   sovrappone alla CTA "Spesso acquistati insieme"/sticky e non serve al funnel. */
body.fpwoo-product-shell .nectar-social.fixed,
body.fpwoo-product-shell .nectar-social.fixed.woo {
    display: none !important;
}

/* Notices WooCommerce sulla pagina prodotto (es. «… è stato aggiunto al tuo
   carrello» con link "Visualizza Carrello"). Lo stile dei notice vive nello
   store shell (body.fpwoo-store-shell), che NON è presente sul prodotto:
   senza queste regole l'avviso ricade sul default Salient e appare "rotto"
   (link incollato al testo, niente bottone). Qui lo rendiamo coerente. */
body.fpwoo-product-shell .woocommerce-notices-wrapper {
    margin: 0 0 1.25rem;
}

body.fpwoo-product-shell .woocommerce-message,
body.fpwoo-product-shell .woocommerce-info,
body.fpwoo-product-shell .woocommerce-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.9rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1.1rem !important;
    border: 1px solid transparent !important;
    border-radius: var(--fpwoo-shell-radius-sm, 10px) !important;
    background-color: var(--fpwoo-shell-accent, #c8a24a) !important;
    color: #fff !important;
    font-size: 0.98rem;
    line-height: 1.45;
    box-shadow: none !important;
    list-style: none;
}

body.fpwoo-product-shell .woocommerce-message::before,
body.fpwoo-product-shell .woocommerce-info::before,
body.fpwoo-product-shell .woocommerce-error::before {
    display: none !important;
    content: none !important;
}

/* Il testo riempie lo spazio, il bottone "Visualizza Carrello" va in coda */
body.fpwoo-product-shell .woocommerce-message > a.button,
body.fpwoo-product-shell .woocommerce-message > a.wc-forward {
    order: 2;
    margin: 0 0 0 auto !important;
    float: none !important;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1.15rem !important;
    border: 0 !important;
    border-radius: var(--fpwoo-shell-radius-sm, 10px) !important;
    background: #fff !important;
    color: var(--fpwoo-shell-accent, #c8a24a) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

body.fpwoo-product-shell .woocommerce-message > a.button:hover,
body.fpwoo-product-shell .woocommerce-message > a.wc-forward:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--fpwoo-shell-accent-hover, var(--fpwoo-shell-accent, #c8a24a)) !important;
}

@media (max-width: 600px) {
    body.fpwoo-product-shell .woocommerce-message,
    body.fpwoo-product-shell .woocommerce-info,
    body.fpwoo-product-shell .woocommerce-error {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    body.fpwoo-product-shell .woocommerce-message > a.button,
    body.fpwoo-product-shell .woocommerce-message > a.wc-forward {
        order: 2;
        width: 100%;
        margin: 0.2rem 0 0 0 !important;
    }
}
