/**
 * Widget Products Dix - Styles
 *
 * Styles pour la grille de produits WooCommerce personnalisée
 *
 * @package Widget_Dix_Elementor
 * @since 1.0.0
 */

/* ===========================
   CONTENEUR PRINCIPAL
   =========================== */

.products-dix-wrapper {
    width: 100%;
}

/* ===========================
   GRILLE DE PRODUITS
   =========================== */

.products-dix-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 20px;
    row-gap: 30px;
}

/* Responsive par défaut */
@media (max-width: 1024px) {
    .products-dix-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-dix-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 15px;
        row-gap: 20px;
    }
}

@media (max-width: 480px) {
    .products-dix-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   CARTE PRODUIT
   =========================== */

.product-dix-item {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-dix-item:hover {
    transform: translateY(-5px);
}

/* ===========================
   IMAGE PRODUIT
   =========================== */

.product-dix-item .product-image {
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.product-dix-item .product-image a {
    display: block;
    position: relative;
}

.product-dix-item .product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Image principale */
.product-dix-item .product-image .product-main-image {
    position: relative;
    z-index: 1;
}

/* Image de galerie (hover) - cachée par défaut */
.product-dix-item .product-image .product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
}

/* Au hover : cacher l'image principale et afficher l'image de galerie */
.product-dix-item:hover .product-image .product-main-image {
    opacity: 0;
}

.product-dix-item:hover .product-image .product-hover-image {
    opacity: 1;
}

/* Effet zoom au hover */
.product-dix-item:hover .product-image img {
    transform: scale(1.05);
}

/* Badges WooCommerce (Sale, etc.) */
.product-dix-item .product-image .onsale {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

/* Badge cadeau offert */
.product-dix-item .product-image .free-gift-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    line-height: 1.2;
    max-width: calc(100% - 20px);
    text-align: center;
}

/* Badge produit disponible (offert maintenant) */
.product-dix-item .product-image .free-gift-available {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Badge seuil pas encore atteint */
.product-dix-item .product-image .free-gift-threshold {
    background: linear-gradient(135deg, rgba(255, 179, 102, 0.95) 0%, rgba(255, 159, 67, 0.95) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 159, 67, 0.3);
}

/* Badge livraison offerte (X2 = Livraison offerte) */
.product-dix-item .product-image .free-shipping-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    line-height: 1.2;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Afficher le badge au hover */
.product-dix-item:hover .product-image .free-shipping-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Style pour badge livraison déjà atteinte */
.product-dix-item .product-image .free-shipping-badge.shipping-achieved {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

/* Espacement entre quantité et texte dans le badge */
.product-dix-item .product-image .free-shipping-badge .shipping-badge-quantity {
    margin-right: 4px;
    font-weight: 700;
}

/* ===========================
   BADGES STATUT STOCK
   =========================== */

/* Badge statut stock (réapprovisionnement ou rupture) */
.product-dix-item .product-image .stock-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 3;
    line-height: 1.3;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: calc(100% - 20px);
}

/* Badge réapprovisionnement en cours */
.product-dix-item .product-image .backorder-badge {
    background: linear-gradient(135deg, #ffb366 0%, #ff9f43 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 159, 67, 0.4);
}

.product-dix-item .product-image .backorder-badge .stock-badge-title {
    font-weight: 700;
}

.product-dix-item .product-image .backorder-badge .stock-badge-notice {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.9;
}

/* Badge rupture de stock */
.product-dix-item .product-image .outofstock-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.product-dix-item .product-image .outofstock-badge .stock-badge-title {
    font-weight: 700;
}

/* Responsive pour badges stock */
@media (max-width: 768px) {
    .product-dix-item .product-image .stock-status-badge {
        font-size: 9px;
        padding: 6px 10px;
    }

    .product-dix-item .product-image .backorder-badge .stock-badge-notice {
        font-size: 8px;
    }
}

/* ===========================
   CONTENU PRODUIT
   =========================== */

.product-dix-item .product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ===========================
   TITRE PRODUIT
   =========================== */

.product-dix-item .product-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.product-dix-item .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-dix-item .product-title a:hover {
    color: #0066cc;
}

/* ===========================
   RATING PRODUIT
   =========================== */

.product-dix-item .product-rating {
    margin-bottom: 8px;
}

.product-dix-item .product-rating .star-rating {
    font-size: 14px;
}

/* ===========================
   PRIX PRODUIT
   =========================== */

.product-dix-item .product-price {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.product-dix-item .product-price del {
    opacity: 0.5;
    font-weight: 400;
    margin-right: 5px;
    font-size: 14px;
}

.product-dix-item .product-price ins {
    text-decoration: none;
    color: #ff6b6b;
}

/* ===========================
   BOUTON AJOUT PANIER
   =========================== */

.product-dix-item .product-add-to-cart {
    margin-top: auto;
}

.product-dix-item .product-add-to-cart .button {
    width: 100%;
    display: block;
    text-align: center;
    padding: 10px 20px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
    cursor: pointer;
}

.product-dix-item .product-add-to-cart .button:hover {
    background: #0052a3;
}

.product-dix-item .product-add-to-cart .added_to_cart {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #0066cc;
    text-decoration: none;
}

/* Bouton produit déjà ajouté */
.product-dix-item .product-add-to-cart .added {
    background: #28a745;
}

.product-dix-item .product-add-to-cart .added:hover {
    background: #218838;
}

/* ===========================
   MESSAGES VIDES
   =========================== */

.products-dix-wrapper > p {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ===========================
   LOADING STATE
   =========================== */

.products-dix-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===========================
   RESPONSIVE MOBILE
   =========================== */

@media (max-width: 768px) {
    .product-dix-item .product-title {
        font-size: 14px;
    }

    .product-dix-item .product-price {
        font-size: 16px;
    }

    .product-dix-item .product-add-to-cart .button {
        padding: 8px 15px;
        font-size: 13px;
    }
}
