/* ============================================================
 * CHILD THEME - REGOLE GLOBALI
 * ============================================================ */

a.button.secondary.testo-scuro,
a.checkout-button.testo-scuro {
    color: #2d3436 !important;
}

/* ============================================================
 * FAQ - ACCORDION FLATSOME (.waffle-faq)
 * Stile isolato: si applica solo agli accordion dentro .waffle-faq.
 * ============================================================ */
.waffle-faq .accordion {
    margin: 0;
}

.waffle-faq .accordion-item {
    margin: 0 0 10px;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.waffle-faq .accordion-title {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52px;
    margin: 0;
    padding: 13px 48px 13px 16px;
    border: 0 !important;
    background: #fff;
    color: #2d3436;
    font-weight: 400;
    line-height: 1.45;
    text-decoration: none;
    transition: background-color .18s ease;
}

.waffle-faq .accordion-title:hover,
.waffle-faq .accordion-title.active {
    background: #fff;
    color: #2d3436;
}

/* Nasconde l'icona circolare/chevron nativa a sinistra. */
.waffle-faq .accordion-title .icon-angle-down {
    display: none !important;
}

/* Chevron sottile a destra, come nel riferimento. */
.waffle-faq .accordion-title::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 18px;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid #667085;
    border-bottom: 1.5px solid #667085;
    transform: rotate(45deg);
    transition: transform .2s ease, margin-top .2s ease;
}

.waffle-faq .accordion-title.active::after {
    margin-top: -1px;
    transform: rotate(225deg);
}

.waffle-faq .accordion-inner {
    padding: 2px 16px 16px;
    border: 0 !important;
    background: #fff;
    color: #2d3436;
    line-height: 1.65;
}

.waffle-faq .accordion-inner > :last-child {
    margin-bottom: 0;
}

/* Titoli delle categorie FAQ. */
.waffle-faq h2,
.waffle-faq h3,
.waffle-faq h4 {
    margin: 30px 0 12px;
    color: #2d3436;
}

.waffle-faq h2:first-child,
.waffle-faq h3:first-child,
.waffle-faq h4:first-child {
    margin-top: 0;
}

@media (max-width: 549px) {
    .waffle-faq .accordion-item {
        margin-bottom: 8px;
        border-radius: 8px;
    }

    .waffle-faq .accordion-title {
        min-height: 50px;
        padding: 12px 44px 12px 14px;
    }

    .waffle-faq .accordion-title::after {
        right: 16px;
    }

    .waffle-faq .accordion-inner {
        padding: 2px 14px 14px;
    }
}

/* ============================================================
 * HEADER FLATSOME - ACCOUNT GUEST + CART HOVER
 * ============================================================ */
.header .account-item .waffle-header-account-part {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.header .account-item .waffle-header-account-separator {
    display: inline-block;
    margin: 0 8px;
    opacity: .55;
}

.header .account-item .waffle-header-account-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 16px;
}

/* ============================================================
 * FLATSOME LIVE SEARCH - DROPDOWN DESKTOP
 * ============================================================ */
@media (min-width: 850px) {
    /* Il dropdown resta agganciato al bordo destro del form e si estende verso sinistra. */
    .header .search-form {
        position: relative;
    }

    .header .search-form .live-search-results {
        left: auto !important;
        right: 0 !important;
        width: 540px;
        min-width: 540px;
    }

    .header .search-form .autocomplete-suggestions {
        left: auto !important;
        right: 0 !important;
        width: 540px !important;
        min-width: 540px !important;
    }
}

.header .search-form .autocomplete-suggestion {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 8px 12px;
    overflow: hidden;
}

.header .search-form .autocomplete-suggestion img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    margin: 0 12px 0 0;
    border-radius: 6px;
    object-fit: cover;
}

.header .search-form .autocomplete-suggestion .search-name {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.header .search-form .autocomplete-suggestion .search-name b {
    font-weight: inherit;
}

.header .search-form .autocomplete-suggestion .search-price {
    flex: 0 0 auto;
    margin: 0 0 0 16px;
    padding: 0;
    white-space: nowrap;
}

@media (max-width: 849px) {
    .header .search-form .live-search-results {
        width: 100%;
        max-width: calc(100vw - 30px);
    }
}

/* ============================================================
 * FLATSOME LIVE SEARCH - MOSTRA SOLO PRODOTTI
 * ============================================================
 * I prodotti restituiti dalla live search contengono .search-image.
 * Le pagine e gli altri risultati privi di immagine vengono nascosti
 * esclusivamente via CSS, senza modificare AJAX, query o DOM.
 */
.header .search-form .autocomplete-suggestion:not(:has(.search-image)) {
    display: none !important;
}

/* ============================================================
 * PRODOTTO GIA' ACQUISTATO - SCARICA ORA
 * ============================================================ */
.single-product .gian-owned-product-download {
    margin: 1em 0;
}

.single-product .gian-owned-product-download-button,
.single-product .gian-owned-product-download-button:hover,
.single-product .gian-owned-product-download-button:focus,
.single-product .gian-owned-product-download-button:active {
    background-color: #00b894 !important;
    border-color: #00b894 !important;
    color: #fff !important;
    border-radius: 5px !important;
}

.single-product .gian-owned-product-download-note {
    margin: .6em 0 0;
}


/* ============================================================
 * COLORE BRAND - LABEL PERCENTUALE DI SCONTO
 * ============================================================
 * Mantiene il testo bianco e allinea esclusivamente lo sfondo
 * verde del label sconto al verde funzionale Waffle.
 */
.gian-discount,
.single-product .gian-discount,
body.post-type-archive-product .products .product .gian-discount,
body.tax-product_cat .products .product .gian-discount,
body.tax-product_tag .products .product .gian-discount,
body.tax-product_brand .products .product .gian-discount,
.gian-product-grid .gian-discount,
.gr-variation-card-price .gian-discount,
.gr-variation-cards .gr-variation-card .gian-discount {
    background: #00b894 !important;
    background-color: #00b894 !important;
    color: #ffffff !important;
}


/* ============================================================
 * ICONE PULSANTI PRODOTTO - REV. 14.82
 * ============================================================ */
.single-product .single_add_to_cart_button,
.single-product .gian-owned-product-download-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.single-product .single_add_to_cart_button .gian-cart-icon {
    font-size: 16px;
    line-height: 1;
    margin: 0;
}

.single-product .gian-owned-product-download-button .gian-button-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
 * CHECKOUT - SALVA METODO DI PAGAMENTO - REV. 15.04
 * Checkbox centrata rispetto al testo, indipendente dagli stili inline WooPayments.
 * ============================================================ */
.woocommerce-checkout .woocommerce-SavedPaymentMethods-saveNew {
    position: relative !important;
    display: block !important;
    margin: 10px 0 0 !important;
    padding: 0 !important;
}

.woocommerce-checkout .woocommerce-SavedPaymentMethods-saveNew input[type="checkbox"] {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    bottom: auto !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-50%) !important;
    vertical-align: initial !important;
}

.woocommerce-checkout .woocommerce-SavedPaymentMethods-saveNew label {
    position: static !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 0 0 26px !important;
    line-height: 1.35 !important;
    transform: none !important;
}
