/* Container principale del widget */
.woobedding-featured-products {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
}

/* Titolo del widget */
.woobedding-featured-products h2 {
    margin-bottom: 20px;
    text-align: center;
}

/* Grid layout per i prodotti */
.woobedding-featured-products-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    justify-items: center;
    grid-template-columns: repeat(4, 1fr); /* Default desktop */
}

/* Singolo prodotto */
.woobedding-featured-product {
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    background-color: #fff;
}

/* Link del prodotto */
.woobedding-featured-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex-grow: 1;
}

/* Hover effect sul prodotto */
.woobedding-featured-product:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Immagine del prodotto */
.woobedding-featured-product-image {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #fff;
}

.woobedding-featured-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.woobedding-featured-product-image .hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    object-fit: cover;
}

.woobedding-featured-product:hover .woobedding-featured-product-image .main-image {
    transform: scale(1.05);
}

.woobedding-featured-product-image:hover .hover-image {
    opacity: 1;
}

/* Bollino sconto */
.woobedding-featured-discount {
    position: absolute;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: bold;
    background-color: #e74c3c;
    color: white;
    border-radius: 4px;
    z-index: 10;
}

.woobedding-featured-discount.top-left {
    top: 10px;
    left: 10px;
}

.woobedding-featured-discount.top-right {
    top: 10px;
    right: 10px;
}

.woobedding-featured-discount.bottom-left {
    bottom: 10px;
    left: 10px;
}

.woobedding-featured-discount.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Icona della stagione */
.woobedding-featured-season-icon {
    position: absolute;
    z-index: 10;
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Posizioni dinamiche per l'icona */
.woobedding-featured-season-icon.top-left {
    top: 10px;
    left: 10px;
}

.woobedding-featured-season-icon.top-right {
    top: 10px;
    right: 10px;
}

.woobedding-featured-season-icon.bottom-left {
    bottom: 10px;
    left: 10px;
}

.woobedding-featured-season-icon.bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Stile immagine all'interno dell'icona */
.woobedding-featured-season-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dettagli prodotto */
.woobedding-featured-product-details {
    flex-grow: 1;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.woobedding-featured-product-details h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.2;
}

.woobedding-featured-product-details .woobedding-featured-category {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.woobedding-featured-product-details .woobedding-featured-heat-points,
.woobedding-featured-product-details .woobedding-featured-filling,
.woobedding-featured-product-details .woobedding-featured-peso {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.woobedding-featured-product-details .woobedding-featured-price {
    font-size: 18px;
    color: #e00000;
    font-weight: bold;
    margin-top: auto;
    padding-top: 10px;
}

/* Stile per prezzo scontato */
.woobedding-featured-sale-price {
    color: #e00000;
    font-weight: bold;
}

.woobedding-featured-regular-price {
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 0.9em;
}

/* Prefisso prezzo variabile */
.woobedding-featured-variable-price-prefix {
    font-size: 14px;
    color: #666;
    font-weight: normal;
    display: block;
    margin-bottom: 5px;
}

/* Wrapper pulsante carrello */
.woobedding-featured-add-to-cart-wrapper {
    padding: 0 15px 15px 15px;
    text-align: center;
}

/* ===================================
   PULSANTI BLU CON ANIMAZIONE CLASSICA
   =================================== */

/* Pulsante Aggiungi al Carrello e Vedi Opzioni */
.woobedding-featured-add-to-cart,
.woobedding-featured-view-options,
.woobedding-featured-products .button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa !important; /* Blu principale */
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #0073aa !important;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* Effetto hover classico - inverte i colori */
.woobedding-featured-add-to-cart:hover,
.woobedding-featured-view-options:hover,
.woobedding-featured-products .button:hover {
    background-color: #ffffff !important;
    color: #0073aa !important;
    border-color: #0073aa !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
}

/* Stato attivo/cliccato */
.woobedding-featured-add-to-cart:active,
.woobedding-featured-view-options:active,
.woobedding-featured-products .button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 115, 170, 0.2);
}

/* Stato loading quando si aggiunge al carrello */
.woobedding-featured-add-to-cart.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Animazione loading */
.woobedding-featured-add-to-cart.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Override per link nel wrapper */
.woobedding-featured-add-to-cart-wrapper a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.woobedding-featured-add-to-cart-wrapper a:hover {
    color: #0073aa !important;
    text-decoration: none !important;
}

/* ===================================
   RESPONSIVE DESIGN - TABLET
   =================================== */
@media (max-width: 1024px) and (min-width: 768px) {
    /* Grid a 3 colonne su tablet landscape */
    .woobedding-featured-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .woobedding-featured-product-details h3 {
        font-size: 16px;
    }

    .woobedding-featured-product-details .woobedding-featured-price {
        font-size: 16px;
    }

    .woobedding-featured-discount {
        font-size: 12px;
        padding: 4px 8px;
    }

    .woobedding-featured-season-icon {
        width: 25px;
        height: 25px;
    }

    .woobedding-featured-add-to-cart,
    .woobedding-featured-view-options {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===================================
   RESPONSIVE DESIGN - TABLET PORTRAIT
   =================================== */
@media (max-width: 767px) and (min-width: 481px) {
    /* Grid a 2 colonne su tablet portrait */
    .woobedding-featured-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .woobedding-featured-product-details {
        padding: 12px;
    }

    .woobedding-featured-product-details h3 {
        font-size: 16px;
    }

    .woobedding-featured-product-details .woobedding-featured-category,
    .woobedding-featured-product-details .woobedding-featured-heat-points,
    .woobedding-featured-product-details .woobedding-featured-filling,
    .woobedding-featured-product-details .woobedding-featured-peso {
        font-size: 13px;
    }

    .woobedding-featured-product-details .woobedding-featured-price {
        font-size: 16px;
    }

    .woobedding-featured-add-to-cart,
    .woobedding-featured-view-options {
        padding: 8px 16px;
        font-size: 12px;
        letter-spacing: 0.3px;
    }

    .woobedding-featured-discount {
        font-size: 12px;
        padding: 3px 6px;
    }

    .woobedding-featured-season-icon {
        width: 25px;
        height: 25px;
    }
}

/* ===================================
   RESPONSIVE DESIGN - MOBILE
   =================================== */
@media (max-width: 480px) {
    /* Grid a 1 colonna su mobile */
    .woobedding-featured-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Limitiamo la larghezza massima su mobile per evitare prodotti troppo grandi */
    .woobedding-featured-product {
        max-width: 400px;
        margin: 0 auto;
    }

    .woobedding-featured-product-details {
        padding: 15px;
    }

    .woobedding-featured-product-details h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .woobedding-featured-product-details .woobedding-featured-category,
    .woobedding-featured-product-details .woobedding-featured-heat-points,
    .woobedding-featured-product-details .woobedding-featured-filling,
    .woobedding-featured-product-details .woobedding-featured-peso {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .woobedding-featured-product-details .woobedding-featured-price {
        font-size: 18px;
        margin-top: 10px;
    }

    .woobedding-featured-add-to-cart,
    .woobedding-featured-view-options {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .woobedding-featured-discount {
        font-size: 13px;
        padding: 4px 8px;
    }

    .woobedding-featured-season-icon {
        width: 28px;
        height: 28px;
    }

    /* Nascondi alcuni elementi su mobile per risparmiare spazio se necessario */
    .woobedding-featured-variable-price-prefix {
        font-size: 12px;
    }
}

/* ===================================
   ULTERIORI OTTIMIZZAZIONI
   =================================== */

/* Supporto per schermi molto piccoli */
@media (max-width: 360px) {
    .woobedding-featured-products-grid {
        gap: 15px;
    }

    .woobedding-featured-product {
        max-width: 100%;
    }

    .woobedding-featured-product-details {
        padding: 12px;
    }

    .woobedding-featured-product-details h3 {
        font-size: 16px;
    }

    .woobedding-featured-add-to-cart,
    .woobedding-featured-view-options {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Supporto per schermi grandi */
@media (min-width: 1200px) {
    .woobedding-featured-products-grid {
        gap: 25px;
    }
}

/* Supporto per schermi molto grandi */
@media (min-width: 1920px) {
    .woobedding-featured-products-grid {
        gap: 30px;
    }

    .woobedding-featured-product {
        max-width: 350px;
    }
}

/* ===================================
   ACCESSIBILITÀ E PERFORMANCE
   =================================== */

/* Focus states per accessibilità */
.woobedding-featured-add-to-cart:focus,
.woobedding-featured-view-options:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.woobedding-featured-product-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Reduced motion per utenti che preferiscono meno animazioni */
@media (prefers-reduced-motion: reduce) {
    .woobedding-featured-product,
    .woobedding-featured-product-image img,
    .woobedding-featured-add-to-cart,
    .woobedding-featured-view-options {
        transition: none;
        animation: none;
    }
}

/* Print styles */
@media print {
    .woobedding-featured-add-to-cart-wrapper,
    .woobedding-featured-discount,
    .woobedding-featured-season-icon {
        display: none;
    }

    .woobedding-featured-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   MESSAGGI WOOCOMMERCE
   =================================== */

/* Stili per i messaggi di successo/errore */
.woocommerce-notices-wrapper {
    margin-bottom: 20px;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.woocommerce-notices-wrapper .woocommerce-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-notices-wrapper .woocommerce-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}