/**
 * YITH Wishlist - Custom Styling
 * Miglioramenti grafici per PC e Mobile
 * Data: 9 gennaio 2026
 */

/* ========================================
   STILI GENERALI WISHLIST
======================================== */

.wishlist_table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #fff;
}

/* Intestazioni tabella */
.wishlist_table thead th {
    background: #63C262 !important;
    color: #fff !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 13px !important;
    letter-spacing: 0.5px;
    padding: 16px 12px !important;
    border: none !important;
}

.wishlist_table thead th span {
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

/* Righe tabella */
.wishlist_table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.wishlist_table tbody tr:hover {
    background-color: #f5fef5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 194, 98, 0.15);
}

.wishlist_table tbody td {
    padding: 20px 12px;
    vertical-align: middle;
    border: none;
}

/* Immagine prodotto */
.wishlist_table .product-thumbnail img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    max-width: 100px;
    height: auto;
}

.wishlist_table .product-thumbnail img:hover {
    transform: scale(1.05);
}

/* Nome prodotto */
.wishlist_table .product-name a {
    color: #333;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.wishlist_table .product-name a:hover {
    color: #63C262;
}

/* Prezzo */
.wishlist_table .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #63C262;
}

.wishlist_table .product-price del {
    color: #999;
    font-size: 14px;
    margin-right: 8px;
}

/* Stato stock */
.wishlist-in-stock {
    color: #27ae60;
    font-weight: 600;
    padding: 6px 12px;
    background: #e8f8f0;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
}

.wishlist-out-of-stock {
    color: #e74c3c;
    font-weight: 600;
    padding: 6px 12px;
    background: #fdeaea;
    border-radius: 20px;
    font-size: 13px;
    display: inline-block;
}

/* Pulsante rimuovi */
.wishlist_table .product-remove a {
    color: #e74c3c;
    font-size: 24px;
    font-weight: 300;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
}

.wishlist_table .product-remove a:hover {
    background: #fdeaea;
    color: #c0392b;
    transform: rotate(90deg);
}

/* Pulsante Add to Cart */
.wishlist_table .add_to_cart_button,
.wishlist_table .product_type_simple {
    background: #63C262 !important;
    color: #fff !important;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 194, 98, 0.3);
}

.wishlist_table .add_to_cart_button:hover,
.wishlist_table .product_type_simple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 194, 98, 0.4);
    background: #4fb04e !important;
}

/* Input quantità */
.wishlist_table input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.wishlist_table input[type="number"]:focus {
    border-color: #63C262;
    outline: none;
}

/* Messaggio lista vuota */
.wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
    font-weight: 500;
}

/* Data aggiunta */
.wishlist_table .dateadded {
    color: #999;
    font-size: 12px;
    display: block;
    margin-bottom: 8px;
}

/* ========================================
   STILI MOBILE - LAYOUT CARD
======================================== */

@media (max-width: 768px) {
    /* Nascondi tabella desktop su mobile */
    .wishlist_table.traditional {
        display: none;
    }
    
    /* Lista mobile */
    .wishlist_table.mobile {
        list-style: none;
        padding: 0;
        margin: 0;
        background: transparent;
        box-shadow: none;
    }
    
    /* Card prodotto mobile */
    .wishlist_table.mobile > li {
        background: #fff;
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 20px 16px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        position: relative;
    }
    
    .wishlist_table.mobile > li:hover {
        box-shadow: 0 4px 20px rgba(99, 194, 98, 0.15);
        transform: translateY(-2px);
    }
    
    /* Wrapper contenuto */
    .wishlist_table.mobile .item-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    /* Thumbnail mobile */
    .wishlist_table.mobile .product-thumbnail {
        width: 100%;
        text-align: center;
    }
    
    .wishlist_table.mobile .product-thumbnail a {
        display: inline-block;
    }
    
    .wishlist_table.mobile .product-thumbnail img {
        width: 100%;
        max-width: 200px;
        height: auto;
        object-fit: cover;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
    
    /* Dettagli prodotto */
    .wishlist_table.mobile .item-details {
        width: 100%;
        padding: 0 8px;
    }
    
    /* Nome prodotto mobile - OTTIMIZZATO */
    .wishlist_table.mobile .product-name {
        margin-bottom: 12px;
        margin-top: 0;
        text-align: center;
    }
    
    .wishlist_table.mobile .product-name h3 {
        margin: 0 0 10px 0;
        font-size: 16px;
        line-height: 1.5;
        font-weight: 600;
    }
    
    .wishlist_table.mobile .product-name h3 a {
        color: #333;
        text-decoration: none;
        display: block;
        transition: color 0.3s ease;
        word-wrap: break-word;
    }
    
    .wishlist_table.mobile .product-name h3 a:hover {
        color: #63C262;
    }
    
    /* Tabella dettagli mobile */
    .wishlist_table.mobile .item-details-table {
        width: 100%;
        margin-top: 12px;
        margin-bottom: 4px;
        font-size: 14px;
        border-spacing: 0;
    }
    
    .wishlist_table.mobile .item-details-table tr {
        border: none;
    }
    
    .wishlist_table.mobile .item-details-table td {
        padding: 6px 0;
        border: none;
    }
    
    .wishlist_table.mobile .item-details-table td.label {
        color: #999;
        font-weight: 500;
        width: 90px;
        padding-right: 12px;
        text-align: left;
    }
    
    .wishlist_table.mobile .item-details-table td.value {
        color: #333;
        font-weight: 600;
        text-align: left;
    }
    
    /* Prezzo mobile */
    .wishlist_table.mobile .item-details-table td.value .amount {
        font-size: 18px;
        color: #63C262;
        font-weight: 700;
    }
    
    /* Info aggiuntive mobile */
    .wishlist_table.mobile .additional-info-wrapper {
        border-top: 1px solid #f0f0f0;
        padding-top: 16px;
        margin-top: 16px;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .wishlist_table.mobile .additional-info {
        width: 100%;
        margin-bottom: 16px;
    }
    
    .wishlist_table.mobile .additional-info td {
        padding: 8px 0;
        font-size: 14px;
    }
    
    .wishlist_table.mobile .additional-info td.label {
        color: #999;
        font-weight: 500;
        width: 90px;
        text-align: left;
    }
    
    /* Input quantità mobile */
    .wishlist_table.mobile .product-quantity input[type="number"] {
        width: 60px;
        padding: 6px;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
    }
    
    /* Stato stock mobile */
    .wishlist_table.mobile .wishlist-in-stock,
    .wishlist_table.mobile .wishlist-out-of-stock {
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 15px;
        display: inline-block;
    }
    
    /* Pulsante Add to Cart mobile */
    .wishlist_table.mobile .product-add-to-cart {
        margin-bottom: 12px;
        padding: 0 8px;
    }
    
    .wishlist_table.mobile .add_to_cart_button,
    .wishlist_table.mobile .product_type_simple {
        width: 100%;
        display: block;
        text-align: center;
        padding: 14px 24px;
        background: #63C262 !important;
        color: #fff !important;
        border: none;
        border-radius: 25px;
        font-weight: 600;
        font-size: 15px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 12px rgba(99, 194, 98, 0.3);
        transition: all 0.3s ease;
    }
    
    .wishlist_table.mobile .add_to_cart_button:hover,
    .wishlist_table.mobile .product_type_simple:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(99, 194, 98, 0.4);
        background: #4fb04e !important;
    }
    
    /* Pulsante rimuovi mobile */
    .wishlist_table.mobile .product-remove {
        text-align: center;
        padding: 0 8px;
        margin-top: 8px;
    }
    
    .wishlist_table.mobile .product-remove a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 24px;
        background: transparent;
        color: #e74c3c;
        border: none;
        border-radius: 20px;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.3s ease;
    }
    
    .wishlist_table.mobile .product-remove a:hover {
        background: #fdeaea;
        color: #c0392b;
    }
    
    .wishlist_table.mobile .product-remove a i {
        font-size: 14px;
    }
    
    /* Checkbox mobile */
    .wishlist_table.mobile .product-checkbox {
        position: absolute;
        top: 12px;
        right: 12px;
    }
    
    .wishlist_table.mobile .product-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }
    
    /* Messaggio vuoto mobile */
    .wishlist-empty {
        padding: 40px 20px;
        font-size: 16px;
    }
}

/* ========================================
   RESPONSIVE TABLET
======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .wishlist_table.mobile {
        display: none;
    }
    
    .wishlist_table tbody td {
        padding: 16px 10px;
    }
    
    .wishlist_table .product-name a {
        font-size: 14px;
    }
    
    .wishlist_table .product-thumbnail img {
        max-width: 80px;
    }
}

/* ========================================
   RESPONSIVE DESKTOP LARGE
======================================== */

@media (min-width: 1025px) {
    .wishlist_table.mobile {
        display: none;
    }
    
    .wishlist_table.traditional {
        display: table;
    }
}

/* ========================================
   PAGINAZIONE
======================================== */

.wishlist-pagination {
    margin-top: 30px;
    text-align: center;
}

.wishlist-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wishlist-pagination .page-numbers li {
    display: inline-block;
}

.wishlist-pagination .page-numbers a,
.wishlist-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wishlist-pagination .page-numbers a:hover {
    background: #63C262;
    color: #fff;
    transform: translateY(-2px);
}

.wishlist-pagination .page-numbers .current {
    background: #63C262;
    color: #fff;
}

/* ========================================
   ANIMAZIONI
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wishlist_table tbody tr,
.wishlist_table.mobile > li {
    animation: fadeIn 0.5s ease forwards;
}

.wishlist_table tbody tr:nth-child(1),
.wishlist_table.mobile > li:nth-child(1) {
    animation-delay: 0.1s;
}

.wishlist_table tbody tr:nth-child(2),
.wishlist_table.mobile > li:nth-child(2) {
    animation-delay: 0.2s;
}

.wishlist_table tbody tr:nth-child(3),
.wishlist_table.mobile > li:nth-child(3) {
    animation-delay: 0.3s;
}

.wishlist_table tbody tr:nth-child(4),
.wishlist_table.mobile > li:nth-child(4) {
    animation-delay: 0.4s;
}

.wishlist_table tbody tr:nth-child(5),
.wishlist_table.mobile > li:nth-child(5) {
    animation-delay: 0.5s;
}

/* ========================================
   UTILITY CLASSES
======================================== */

.yith-wcwl-wishlist-new {
    padding: 20px;
}

.yith-wcwl-wishlist-new .wishlist-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Loading state */
.wishlist_table.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus states */
.wishlist_table a:focus,
.wishlist_table button:focus,
.wishlist_table input:focus {
    outline: 2px solid #63C262;
    outline-offset: 2px;
}

/* ========================================
   CONDIVISIONE SOCIAL
======================================== */

.yith-wcwl-share {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
}

.yith-wcwl-share-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.yith-wcwl-share ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

.yith-wcwl-share ul li.share-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

/* Nascondi il secondo pulsante WhatsApp (mobile version) se presente */
.yith-wcwl-share ul li.share-button:nth-of-type(6) {
    display: none !important;
}

/* FIX: Nascondi elementi HTML malformati/duplicati dentro i link share */
.yith-wcwl-share ul li.share-button a p,
.yith-wcwl-share ul li.share-button a > a,
.yith-wcwl-share ul li.share-button p,
.yith-wcwl-share ul li.share-button > p {
    display: none !important;
}

/* FIX: Nascondi link duplicati che appaiono dopo l'SVG */
.yith-wcwl-share ul li.share-button a + p,
.yith-wcwl-share ul li.share-button a + a {
    display: none !important;
}

.yith-wcwl-share ul li.share-button a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 2px solid #e0e0e0 !important;
    color: #666 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    line-height: 1 !important;
    font-size: 0 !important; /* Nasconde eventuali spazi/testi */
}

.yith-wcwl-share ul li.share-button a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Colori specifici per ogni social */
.yith-wcwl-share ul li.share-button a.facebook {
    border-color: #1877f2 !important;
    color: #1877f2 !important;
}

.yith-wcwl-share ul li.share-button a.facebook:hover {
    background: #1877f2 !important;
    color: #fff !important;
}

.yith-wcwl-share ul li.share-button a.twitter {
    border-color: #000 !important;
    color: #000 !important;
}

.yith-wcwl-share ul li.share-button a.twitter:hover {
    background: #000 !important;
    color: #fff !important;
}

.yith-wcwl-share ul li.share-button a.pinterest {
    border-color: #e60023 !important;
    color: #e60023 !important;
}

.yith-wcwl-share ul li.share-button a.pinterest:hover {
    background: #e60023 !important;
    color: #fff !important;
}

.yith-wcwl-share ul li.share-button a.email {
    border-color: #63C262 !important;
    color: #63C262 !important;
}

.yith-wcwl-share ul li.share-button a.email:hover {
    background: #63C262 !important;
    color: #fff !important;
}

.yith-wcwl-share ul li.share-button a.whatsapp {
    border-color: #25d366 !important;
    color: #25d366 !important;
}

.yith-wcwl-share ul li.share-button a.whatsapp:hover {
    background: #25d366 !important;
    color: #fff !important;
}

/* Icone SVG */
.yith-wcwl-share ul li.share-button a svg,
.yith-wcwl-share ul li.share-button a .yith-wcwl-icon-svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

/* Rimuovi i br indesiderati dentro i link - FIX ALLINEAMENTO */
.yith-wcwl-share ul li.share-button a br {
    display: none !important;
    content: none !important;
    line-height: 0 !important;
    height: 0 !important;
    width: 0 !important;
}

/* Mobile */
@media (max-width: 768px) {
    .yith-wcwl-share {
        padding: 16px;
        margin-top: 20px;
    }
    
    .yith-wcwl-share ul {
        gap: 10px !important;
    }
    
    .yith-wcwl-share ul li.share-button a {
        width: 40px !important;
        height: 40px !important;
    }
    
    .yith-wcwl-share ul li.share-button a svg,
    .yith-wcwl-share ul li.share-button a .yith-wcwl-icon-svg {
        width: 16px !important;
        height: 16px !important;
    }
}
