/**
 * Product Display Weeben - Styles
 * Version: 1.0.0
 * Author: Weeben
 */

/* ========================================
   CONTENEUR PRINCIPAL
======================================== */
.pdw-container {
    margin: 20px 0;
    width: 100%;
}

/* ========================================
   SECTION FILTRES
======================================== */
.pdw-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    align-items: flex-end;
}

.pdw-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 180px;
}

.pdw-filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.pdw-filter-group select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.pdw-filter-group select:hover {
    border-color: #0073aa;
}

.pdw-filter-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.pdw-filter-btn, 
.pdw-reset-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: auto;
}

.pdw-filter-btn {
    background: #0073aa;
    color: white;
}

.pdw-filter-btn:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.pdw-reset-btn {
    background: #e0e0e0;
    color: #333;
}

.pdw-reset-btn:hover {
    background: #d0d0d0;
}

/* ========================================
   GRILLE DE PRODUITS
======================================== */
.pdw-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

.pdw-columns-2 { 
    grid-template-columns: repeat(2, 1fr); 
}

.pdw-columns-3 { 
    grid-template-columns: repeat(3, 1fr); 
}

.pdw-columns-4 { 
    grid-template-columns: repeat(4, 1fr); 
}

.pdw-columns-5 { 
    grid-template-columns: repeat(5, 1fr); 
}

/* ========================================
   CARTE PRODUIT
======================================== */
.pdw-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pdw-product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
    border-color: #0073aa;
}

/* ========================================
   IMAGE PRODUIT
======================================== */
.pdw-product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
}

.pdw-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.pdw-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdw-product-card:hover .pdw-product-image img {
    transform: scale(1.08);
}

/* ========================================
   BADGES
======================================== */
.pdw-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdw-badge-sale {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.pdw-badge-stock {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    top: 50px;
}

/* ========================================
   ACTIONS RAPIDES
======================================== */
.pdw-product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.pdw-product-card:hover .pdw-product-actions {
    opacity: 1;
    transform: translateX(0);
}

.pdw-product-actions button, 
.pdw-product-actions a {
    width: 42px;
    height: 42px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #666;
    text-decoration: none;
}

.pdw-product-actions button:hover, 
.pdw-product-actions a:hover {
    background: #0073aa;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.pdw-product-actions button.active {
    background: #e74c3c;
    color: white;
}

.pdw-product-actions button.active svg {
    fill: currentColor;
}

.pdw-product-actions svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   CONTENU PRODUIT
======================================== */
.pdw-product-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pdw-product-title {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.pdw-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pdw-product-title a:hover {
    color: #0073aa;
}

.pdw-product-rating {
    margin-bottom: 10px;
}

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

.pdw-product-price {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
    margin: 10px 0 15px;
}

.pdw-product-price del {
    font-size: 16px;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

.pdw-product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* ========================================
   BOUTON AJOUTER AU PANIER
======================================== */
.pdw-product-cart {
    margin-top: auto;
}

.pdw-product-cart button,
.pdw-product-cart a.button {
    width: 100%;
    padding: 12px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.pdw-product-cart button:hover,
.pdw-product-cart a.button:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.pdw-product-cart button.added {
    background: #27ae60;
}

.pdw-product-cart button.loading {
    opacity: 0.7;
    cursor: wait;
}

/* ========================================
   CAROUSEL SWIPER
======================================== */
.pdw-carousel {
    padding: 0 0 50px 0;
    margin-bottom: 30px;
}

.pdw-carousel .swiper-slide {
    height: auto;
    display: flex;
}

.pdw-carousel .swiper-slide .pdw-product-card {
    width: 100%;
    height: 100%;
}

/* Boutons de navigation Swiper */
.pdw-carousel .swiper-button-prev,
.pdw-carousel .swiper-button-next {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    color: #0073aa;
}

.pdw-carousel .swiper-button-prev:after,
.pdw-carousel .swiper-button-next:after {
    font-size: 18px;
    font-weight: 900;
}

.pdw-carousel .swiper-button-prev:hover,
.pdw-carousel .swiper-button-next:hover {
    background: #0073aa;
    color: white;
}

.pdw-carousel .swiper-button-prev.swiper-button-disabled,
.pdw-carousel .swiper-button-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Pagination Swiper */
.pdw-carousel .swiper-pagination {
    bottom: 10px;
}

.pdw-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #0073aa;
    opacity: 0.3;
    transition: all 0.3s;
}

.pdw-carousel .swiper-pagination-bullet-active {
    opacity: 1;
    width: 30px;
    border-radius: 5px;
}

/* ========================================
   BOUTON LOAD MORE
======================================== */
.pdw-load-more-wrapper {
    text-align: center;
    margin: 40px 0 20px;
}

.pdw-load-more-btn {
    padding: 14px 40px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    min-width: 200px;
}

.pdw-load-more-btn:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.pdw-load-more-btn:disabled,
.pdw-load-more-btn.loading {
    opacity: 0.6;
    cursor: wait;
    background: #999;
}

.pdw-load-more-btn.loading {
    position: relative;
}

.pdw-load-more-btn.loading:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pdw-spin 0.8s linear infinite;
}

/* ========================================
   LOADING / SPINNER
======================================== */
.pdw-loading {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.9);
    position: relative;
}

.pdw-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: pdw-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes pdw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MESSAGE AUCUN PRODUIT
======================================== */
.pdw-no-products {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
    background: #f8f8f8;
    border-radius: 8px;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes pdw-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pdw-wishlist.pulse {
    animation: pdw-pulse 0.3s ease-in-out;
}

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

.pdw-product-card {
    animation: fadeIn 0.5s ease-out;
}

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

/* Tablettes */
@media (max-width: 1024px) {
    .pdw-columns-4, 
    .pdw-columns-5 { 
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .pdw-filters {
        gap: 12px;
    }
    
    .pdw-filter-group {
        min-width: 150px;
    }
    
    .pdw-carousel .swiper-button-prev,
    .pdw-carousel .swiper-button-next {
        width: 40px;
        height: 40px;
    }
}

/* Tablettes portrait */
@media (max-width: 768px) {
    .pdw-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .pdw-filters {
        padding: 15px;
        gap: 10px;
    }
    
    .pdw-filter-group {
        flex: 1 1 45%;
        min-width: 120px;
    }
    
    .pdw-filter-btn, 
    .pdw-reset-btn {
        flex: 1 1 100%;
    }
    
    .pdw-product-title {
        font-size: 14px;
    }
    
    .pdw-product-price {
        font-size: 18px;
    }
    
    .pdw-carousel .swiper-button-prev {
        left: 5px;
    }
    
    .pdw-carousel .swiper-button-next {
        right: 5px;
    }
    
    .pdw-load-more-btn {
        min-width: 160px;
        padding: 12px 30px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .pdw-grid { 
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pdw-filters {
        flex-direction: column;
        padding: 12px;
    }
    
    .pdw-filter-group {
        width: 100%;
        min-width: auto;
    }
    
    .pdw-filter-btn, 
    .pdw-reset-btn {
        width: 100%;
    }
    
    .pdw-product-content {
        padding: 15px;
    }
    
    .pdw-product-title {
        font-size: 15px;
    }
    
    .pdw-product-actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .pdw-carousel .swiper-button-prev,
    .pdw-carousel .swiper-button-next {
        width: 35px;
        height: 35px;
    }
    
    .pdw-carousel .swiper-button-prev:after,
    .pdw-carousel .swiper-button-next:after {
        font-size: 16px;
    }
    
    .pdw-load-more-btn {
        width: 100%;
        min-width: auto;
    }
}

/* ========================================
   ACCESSIBILITÉ
======================================== */
.pdw-filter-btn:focus,
.pdw-reset-btn:focus,
.pdw-load-more-btn:focus,
.pdw-product-actions button:focus,
.pdw-product-actions a:focus,
.pdw-product-cart button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   COMPATIBILITÉ WOOCOMMERCE
======================================== */
.pdw-product-card .woocommerce-loop-product__title {
    font-size: inherit;
    margin: 0;
}

.pdw-product-card .price {
    margin: 0;
}

.pdw-product-card .star-rating {
    margin: 0;
}

.pdw-product-card .added_to_cart {
    margin-top: 10px;
    display: inline-block;
}

/* ========================================
   UTILITAIRES
======================================== */
.pdw-hidden {
    display: none !important;
}

.pdw-text-center {
    text-align: center;
}