/*
 Theme Name:   S2M Child
 Template:     s2m
 Version:      1.1.0
*/

/* -----------------------------------------------------------
   1. HEADER & MENU
----------------------------------------------------------- */

/* Rimuove la sottolineatura dai link del menu nell'header */
.pagelayer-header a {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Rimuove la sottolineatura anche in hover/focus */
.pagelayer-header a:hover,
.pagelayer-header a:focus,
.pagelayer-header a:active {
    text-decoration: none !important;
}

/* -----------------------------------------------------------
   2. LISTA PRODOTTI (SHOP PAGE)
----------------------------------------------------------- */

/* Disabilita i link ai prodotti nella lista (non cliccabili) */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    pointer-events: none !important;
    cursor: default !important;
}

/* TASTO AGGIUNGI AL CARRELLO: EFFETTO HOVER */
.woocommerce ul.products li.product a.button.add_to_cart_button:hover {
    background-color: #dd971f !important; /* Colore arancio come checkout */
    color: #ffffff !important;
    transition: all 0.3s ease !important;
    transform: translateY(-2px); /* Feedback visivo di sollevamento */
}

/* BOTTONE "VISUALIZZA CARRELLO": STRETTO E SU RIGA NUOVA */
.woocommerce ul.products li.product a.added_to_cart {
    display: table !important;         /* Va a capo ma resta stretto */
    margin: 10px 0 0 !important;       /* Allineato a sinistra sotto il primo tasto */
    background-color: #28a745 !important; /* Verde successo */
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: bold !important;
    text-transform: uppercase;
    text-decoration: none !important;
    line-height: 1 !important;
}

/* Effetto Hover "Visualizza Carrello" */
.woocommerce ul.products li.product a.added_to_cart:hover {
    background-color: #218838 !important;
    color: #ffffff !important;
}

/* STATO AGGIUNTO: Cambia il tasto principale in grigio e disabilita hover */
.woocommerce ul.products li.product a.button.added {
    background-color: #666 !important;
    opacity: 0.7;
    cursor: default;
}

.woocommerce ul.products li.product a.button.added:hover {
    transform: none !important; /* Rimuove lo scatto se è già aggiunto */
}

/* -----------------------------------------------------------
   3. PAGINA CARRELLO
----------------------------------------------------------- */

/* BOTTONE PROCEDI ALL'ORDINE */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    background-color: #fc2500 !important;
    color: #ffffff !important;
    padding: 20px 30px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    border-radius: 5px !important;
    display: block !important;
    text-align: center !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #dd971f !important;
    opacity: 0.9;
}

/* CAMPO COUPON: Più largo */
.woocommerce table.cart td.actions .coupon .input-text,
.woocommerce-page table.cart td.actions .coupon .input-text,
.woocommerce #content table.cart td.actions .input-text {
    width: 180px !important;
    min-width: 160px !important; 
    height: auto !important;
    margin-right: 10px !important;
    padding: 10px !important;
}

.woocommerce table.cart td.actions .coupon {
    display: flex !important;
    align-items: center;
}

/* RIMOZIONE COLONNA QUANTITÀ E TASTO AGGIORNA */
.woocommerce-cart table.cart th.product-quantity,
.woocommerce-cart table.cart td.product-quantity,
.woocommerce-cart table.cart button[name="update_cart"],
.woocommerce-cart table.cart input[name="update_cart"] {
    display: none !important;
}

.woocommerce-cart table.cart td.product-name {
    width: 50%;
}

/* PAGINA CARRELLO VUOTO */

/* Nasconde il pulsante "Ritorna al negozio" */
.woocommerce-cart .return-to-shop {
    display: none !important;
}

/* Centra e corregge il messaggio "Il carrello è vuoto" */
.woocommerce-cart .cart-empty {
    text-align: center !important;
    font-size: 24px !important;
    font-weight: bold !important;
    margin-top: 50px !important;
    color: #404040 !important;
    list-style: none !important; /* Rimuove l'icona del punto elenco se presente */
}

/* Rimuove eventuali icone di avviso accanto al testo */
.woocommerce-cart .cart-empty::before {
    display: none !important;
}

/* -----------------------------------------------------------
   4. PAGINA CHECKOUT
----------------------------------------------------------- */

/* BOTTONE EFFETTUA ORDINE */
.woocommerce-checkout #payment #place_order {
    background-color: #fc2500 !important;
    color: #ffffff !important;
    padding: 15px 30px !important;
    font-size: 20px !important;
    font-weight: bold !important;
    border-radius: 5px !important;
    width: 100% !important;
}

.woocommerce-checkout #payment #place_order:hover {
    background-color: #dd971f !important;
}

/* RIMOZIONE SEZIONI EXTRA E TITOLI */
.woocommerce-additional-fields, 
.woocommerce-additional-fields__heading,
.woocommerce-billing-fields h3 {
    display: none !important;
}

/* --- RIMOZIONE AREA GRIGIA CHECKOUT --- */

/* Rimuove lo sfondo grigio e i bordi dal contenitore pagamenti */
.woocommerce-checkout #payment, 
.woocommerce-checkout #payment ul.payment_methods {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Rimuove il box d'ombra o il beccuccio sopra il tasto (se presente) */
.woocommerce-checkout #payment div.payment_box {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
}

/* Rimuove lo sfondo della zona finale dell'ordine */
.woocommerce-checkout #payment div.form-row {
    background: none !important;
    padding: 0 !important;
}

/* -----------------------------------------------------------
   5. MESSAGGI DI SISTEMA (ZITTIRE ERRORI)
----------------------------------------------------------- */

/* Nasconde i banner di errore/avviso (gestiti via PHP) */
.woocommerce-error, .woocommerce-message, .woocommerce-info {
    display: none !important;
}

/* -----------------------------------------------------------
   6. SCROLL UP
----------------------------------------------------------- */

#custom-scroll-up {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #fc2500 !important;
    color: #ffffff !important;
    border-radius: 50%;
    text-align: center;
    z-index: 9999;
    display: none;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    /* RIMUOVE IL BORDO GRIGIO AL CLICK */
    outline: none !important;
    -webkit-tap-highlight-color: transparent; /* Per mobile */
}

/* Stile della freccia interna */
#custom-scroll-up span {
    font-size: 20px;
    line-height: 48px; /* Centra la freccia verticalmente */
    display: block;
    user-select: none;
}

#custom-scroll-up:hover {
    background-color: #dd971f !important;
    transform: translateY(-5px);
    color: #ffffff !important;
    outline: none !important;
}

/* Rimuove il bordo blu/grigio di focus su Chrome/Safari */
#custom-scroll-up:focus {
    outline: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}

