/**
 * Product of Week Styles
 * Version: 3.3.0
 */

/* ==========================================================================
   Badge Produit de la Semaine (dans les catégories/listings)
   ========================================================================== */

.wcpd-week-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulseGlow 2s infinite;
}

.wcpd-week-product-badge .wcpd-week-icon {
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.wcpd-week-product-badge .wcpd-week-text {
    letter-spacing: 0.5px;
}

.wcpd-week-product-badge .wcpd-week-discount {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-size: 11px;
}

/* Animation pulse/glow pour le badge */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.6);
    }
    100% {
        box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    }
}

/* Badge inline sur les pages produit */
.wcpd-week-badge-inline {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   Shortcode Container Principal
   ========================================================================== */

.wcpd-product-of-week-container {
    margin: 40px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 0;
}

.wcpd-pow-content {
    display: flex;
    gap: 40px;
    align-items: center;
    border: 1px solid;
}

/* Layout responsive */
@media (max-width: 768px) {
    .wcpd-pow-content {
        flex-direction: column;
    }
}

/* ==========================================================================
   Colonne Gauche (Infos Produit)
   ========================================================================== */

.wcpd-pow-left {
    flex: 1 1 60%;
    min-width: 0;
    padding:20px;
}

.wcpd-pow-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0 0 20px 0;
    border-bottom: 3px solid linear-gradient(90deg, #FFD700, #FFA500);
    position: relative;
}

.wcpd-pow-description {
    margin-bottom: 30px;
    color: #666;
    line-height: 1.8;
}

.wcpd-pow-description p {
    margin-bottom: 15px;
}

.wcpd-pow-product-info {
    /* background: #f9f9f9; */
    /* padding: 25px; */
}

.wcpd-pow-product-name {
    font-size: 24px;
    margin: 0 0 20px 0;
}

.wcpd-pow-product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.wcpd-pow-product-name a:hover {
    color: #FFA500;
}

/* ==========================================================================
   Section Prix
   ========================================================================== */

.wcpd-pow-pricing {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.wcpd-pow-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.wcpd-pow-price-row:last-child {
    border-bottom: none;
}

.wcpd-pow-label {
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcpd-pow-price {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.wcpd-pow-regular-price {
    text-decoration: line-through;
    color: #999;
    font-weight: normal;
}

.wcpd-pow-week-discount .wcpd-pow-price {
    color: black;
}

.wcpd-pow-progressive-discount .wcpd-pow-price {
    color: black;
}

.wcpd-pow-final-price {
    font-size: 24px;
    color: black;
}

.wcpd-pow-badge {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.wcpd-pow-week-discount .wcpd-pow-badge {
    background: black;
}

.wcpd-pow-progressive-discount .wcpd-pow-badge {
    background: black;
}

/* Section Économies */
.wcpd-pow-savings {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 6px;
    border: 1px solid #4caf50;
    text-align: center;
    font-size: 18px;
    color: #2e7d32;
}

.wcpd-pow-savings strong {
    font-weight: bold;
}

.wcpd-pow-total-badge {
    display: inline-block;
    background: black;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: bold;
}

/* ==========================================================================
   Variations et sélecteurs
   ========================================================================== */

.wcpd-pow-variations-form {
    margin-top: 20px;
}

.wcpd-pow-variations-wrapper {
    margin-bottom: 20px;
}

.wcpd-pow-variation-row {
    margin-bottom: 15px;
}

.wcpd-pow-variation-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

/* Sélecteur de tailles en boutons */
.wcpd-pow-size-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcpd-pow-size-button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    border-radius: 0;
    min-width: 50px;
    text-align: center;
}

.wcpd-pow-size-button:hover:not(:disabled) {
    border-color: #333;
    background: #f9f9f9;
}

.wcpd-pow-size-button.selected {
    background: #333;
    color: #fff;
    border-color: #333;
}

.wcpd-pow-size-button.out-of-stock,
.wcpd-pow-size-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.wcpd-pow-stock-label {
    font-size: 10px;
    display: block;
}

/* Select pour autres variations */
.wcpd-pow-variation-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    border-radius: 0;
}

/* Quantité */
.wcpd-pow-quantity-row {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wcpd-pow-quantity-row label {
    font-weight: bold;
    margin: 0;
}

.wcpd-pow-quantity {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 16px;
}

/* Affichage du prix de la variation */
.wcpd-pow-price-display {
    margin: 15px 0;
    font-size: 18px;
    font-weight: bold;
}

.wcpd-pow-variation-price {
    color: #333;
}

/* ==========================================================================
   Boutons d'action
   ========================================================================== */

.wcpd-pow-actions {
    margin-top: 25px;
}

.wcpd-pow-button {
    display: inline-block;
    padding: 14px 30px;
    background: black;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 16px;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.wcpd-pow-button:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.wcpd-pow-add-to-cart-form {
    display: inline-block;
}

.wcpd-pow-out-of-stock {
    color: #dc3545;
    font-weight: bold;
    font-size: 16px;
}

/* ==========================================================================
   Colonne Droite (Slider Images)
   ========================================================================== */

.wcpd-pow-right {
    flex: 1 1 40%;
    min-width: 0;
    position: sticky;
    top: 20px;
}

.wcpd-pow-slider-container {
    border-radius: 8px;
    padding: 20px;
}

.wcpd-pow-slider {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.wcpd-pow-slides {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.wcpd-pow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.wcpd-pow-slide.active {
    opacity: 1;
}

.wcpd-pow-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* Navigation du slider */
.wcpd-pow-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.wcpd-pow-slider-prev,
.wcpd-pow-slider-next {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcpd-pow-slider-prev:hover,
.wcpd-pow-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Dots du slider */
.wcpd-pow-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.wcpd-pow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wcpd-pow-dot.active {
    background: black;
    transform: scale(1.3);
}

.wcpd-pow-dot:hover {
    background: #999;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
    .wcpd-pow-content {
        gap: 30px;
    }
    
    .wcpd-pow-title {
        font-size: 28px;
    }
    
    .wcpd-pow-product-name {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .wcpd-product-of-week-container {
        padding: 15px;
        margin: 20px auto;
    }
    
    .wcpd-pow-right {
        position: relative;
        top: auto;
    }
    
    .wcpd-pow-title {
        font-size: 24px;
    }
    
    .wcpd-pow-pricing {
        padding: 15px;
    }
    
    .wcpd-pow-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wcpd-pow-price {
        font-size: 18px;
    }
    
    .wcpd-pow-button {
        width: 100%;
        text-align: center;
    }
    
    .wcpd-week-product-badge {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .wcpd-week-product-badge .wcpd-week-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wcpd-pow-title {
        font-size: 20px;
    }
    
    .wcpd-pow-product-name {
        font-size: 18px;
    }
    
    .wcpd-pow-savings {
        font-size: 16px;
    }
}

/* ==========================================================================
   Compatibilité avec les thèmes
   ========================================================================== */

/* S'assurer que le badge est visible même avec des z-index élevés */
.woocommerce ul.products li.product .wcpd-week-product-badge,
.products .product .wcpd-week-product-badge {
    z-index: 999;
}

/* Ajustements pour certains thèmes populaires */
.storefront-full-width-content .wcpd-product-of-week-container {
    max-width: 100%;
    padding: 20px 40px;
}

.astra-woocommerce-container .wcpd-week-product-badge {
    z-index: 9999;
}

/* Fix pour les images de produits avec overlay */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    position: relative;
}