/**
 * FWZ Collection Slider - Styles ISOLÉS
 * Version: 1.1.0 - Isolation complète pour éviter les conflits
 */

/* ===================================
   VARIABLES SCOPÉES (uniquement dans le wrapper)
   =================================== */
.fwz-collection-slider-wrapper {
    --fwz-primary-bg: #EDEBE5;
    --fwz-card-bg: #ffffff;
    --fwz-text-primary: #2d2d2d;
    --fwz-text-secondary: #666666;
    --fwz-text-light: #999999;
    --fwz-border-color: #e0e0e0;
    --fwz-progress-bg: #d4cfc4;
    --fwz-progress-fill: #2d2d2d;
    --fwz-error-bg: #fee;
    --fwz-error-border: #fcc;
    --fwz-error-text: #c33;
    --fwz-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   CONTENEUR PRINCIPAL
   =================================== */
.fwz-collection-slider-wrapper {
    background-color: var(--fwz-primary-bg);
    padding: 80px 0;
    margin: 0;
    overflow: hidden;
    max-width: 100% !important;
}

.fwz-collection-slider-wrapper .fwz-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.fwz-collection-slider-wrapper .fwz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
}

@media (min-width: 1024px) {
    .fwz-collection-slider-wrapper .fwz-grid {
        grid-template-columns: 380px 1fr;
        gap: 64px;
    }
    .fwz-collection-slider-wrapper .fwz-content-left {
        padding-top: 15rem;
    }
}

/* En mobile, forcer l'affichage en bloc */
@media (max-width: 1023px) {
    .fwz-collection-slider-wrapper .fwz-grid {
        display: block;
    }
    
    .fwz-collection-slider-wrapper .fwz-content-left {
        margin-bottom: 40px;
        padding-top: 0;
    }
    
    .fwz-collection-slider-wrapper .fwz-content-right {
        margin-top: 0;
    }
}

/* ===================================
   COLONNE GAUCHE - CONTENU
   =================================== */
.fwz-collection-slider-wrapper .fwz-content-left {
    position: relative;
}

.fwz-collection-slider-wrapper .fwz-content-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--fwz-text-primary);
}

.fwz-collection-slider-wrapper .fwz-content-sticky {
    position: sticky;
    top: 100px;
    padding-top: 40px;
}

.fwz-collection-slider-wrapper .fwz-collection-title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--fwz-text-primary);
    margin: 0 0 24px 0;
    letter-spacing: -0.02em;
}

.fwz-collection-slider-wrapper .fwz-collection-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--fwz-text-secondary);
    margin: 0;
}

.fwz-collection-slider-wrapper .fwz-collection-description p {
    margin: 0 0 16px 0;
}

.fwz-collection-slider-wrapper .fwz-collection-description p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1023px) {
    .fwz-collection-slider-wrapper .fwz-content-left {
        padding-top: 0;
    }
    
    .fwz-collection-slider-wrapper .fwz-content-sticky {
        position: static !important;
        top: auto !important;
        padding: 2rem 0px;
    }
    
    .fwz-collection-slider-wrapper .fwz-collection-title {
        font-size: 2rem;
        text-align: left;
        margin-bottom: 16px;
    }
    
    .fwz-collection-slider-wrapper .fwz-collection-description {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .fwz-collection-slider-wrapper {
        padding: 48px 0;
    }
    
    .fwz-collection-slider-wrapper .fwz-collection-title {
        font-size: 1.75rem;
    }
    
    .fwz-collection-slider-wrapper .fwz-collection-description {
        font-size: 0.938rem;
    }
}

/* ===================================
   COLONNE DROITE - SLIDER (SWIPER SCOPÉ)
   =================================== */
.fwz-collection-slider-wrapper .fwz-content-right {
    position: relative;
    overflow: visible;
}

.fwz-collection-slider-wrapper .fwz-slider-container {
    position: relative;
    width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    margin-right: -24px;
    padding-right: 24px;
}

/* IMPORTANT : Préfixer tous les sélecteurs Swiper */
.fwz-collection-slider-wrapper .swiper {
    overflow: visible;
    padding: 8px 0 32px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
}

.fwz-collection-slider-wrapper .swiper-wrapper {
    display: flex;
    align-items: stretch;
    height: auto;
}

.fwz-collection-slider-wrapper .swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-shrink: 0 !important;
    width: auto !important;
}

/* ===================================
   CARTE PRODUIT
   =================================== */
.fwz-collection-slider-wrapper .fwz-product-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    transition: var(--fwz-transition);
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    box-shadow: none;
}

.fwz-collection-slider-wrapper .fwz-product-card:hover {
    transform: none;
    box-shadow: none;
}

/* Image du produit - TAILLES FIXES */
.fwz-collection-slider-wrapper .fwz-product-image-wrapper {
    position: relative;
    width: 340px;
    height: 453px;
    background-color: var(--fwz-card-bg);
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--fwz-transition);
}

.fwz-collection-slider-wrapper .fwz-product-card:hover .fwz-product-image-wrapper {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.fwz-collection-slider-wrapper .fwz-product-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    transition: var(--fwz-transition);
    display: block !important;
}

.fwz-collection-slider-wrapper .fwz-product-card:hover .fwz-product-image {
    transform: scale(1.05);
}

/* Responsive - Tailles d'images adaptées */
@media (max-width: 1023px) {
    .fwz-collection-slider-wrapper .fwz-product-image-wrapper {
        width: 300px;
        height: 400px;
    }
}

@media (max-width: 640px) {
    .fwz-collection-slider-wrapper .fwz-product-image-wrapper {
        width: 280px;
        height: 373px;
    }
}

/* Preloader pour lazy loading */
.fwz-collection-slider-wrapper .swiper-lazy-preloader {
    display: none;
}

.fwz-collection-slider-wrapper .swiper-lazy-preloader:after {
    display: none;
}

/* Image non disponible */
.fwz-collection-slider-wrapper .fwz-product-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fwz-card-bg);
}

.fwz-collection-slider-wrapper .fwz-product-no-image svg {
    width: 64px;
    height: 64px;
    color: #ccc;
    stroke-width: 1.5;
}

/* Informations produit */
.fwz-collection-slider-wrapper .fwz-product-info {
    padding: 20px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 0;
    background: transparent;
}

.fwz-collection-slider-wrapper .fwz-product-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--fwz-text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fwz-collection-slider-wrapper .fwz-product-price {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    margin-top: 0;
}

.fwz-collection-slider-wrapper .fwz-price-label {
    font-size: 12px;
    color: var(--fwz-text-primary);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.fwz-collection-slider-wrapper .fwz-product-price .fwz-price-value {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--fwz-text-primary);
}

/* Support des prix WooCommerce */
.fwz-collection-slider-wrapper .fwz-product-price .fwz-price-value .woocommerce-Price-amount {
    font-weight: 500;
}

.fwz-collection-slider-wrapper .fwz-product-price .fwz-price-value del {
    opacity: 0.5;
    font-size: 0.938rem;
    margin-right: 8px;
}

.fwz-collection-slider-wrapper .fwz-product-price .fwz-price-value ins {
    text-decoration: none;
    color: #c33;
}

/* ===================================
   BARRE DE PROGRESSION
   =================================== */
.fwz-collection-slider-wrapper .fwz-progressbar-container {
    width: 100%;
    height: 3px;
    background-color: var(--fwz-progress-bg);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 32px;
}

.fwz-collection-slider-wrapper .fwz-progressbar {
    height: 100%;
    background-color: var(--fwz-progress-fill);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

/* ===================================
   MESSAGE D'ERREUR
   =================================== */
.fwz-collection-slider-wrapper .fwz-error-message {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--fwz-error-bg);
    border: 2px solid var(--fwz-error-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(204, 51, 51, 0.1);
}

.fwz-collection-slider-wrapper .fwz-error-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--fwz-error-text);
}

.fwz-collection-slider-wrapper .fwz-error-content {
    flex: 1;
}

.fwz-collection-slider-wrapper .fwz-error-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fwz-error-text);
    margin: 0 0 8px 0;
}

.fwz-collection-slider-wrapper .fwz-error-text {
    font-size: 0.938rem;
    color: var(--fwz-error-text);
    margin: 0;
    line-height: 1.5;
}

/* ===================================
   ANIMATIONS & TRANSITIONS
   =================================== */
@keyframes fwzFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fwz-collection-slider-wrapper {
    animation: fwzFadeIn 0.6s ease-out;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */
@media (max-width: 640px) {
    .fwz-collection-slider-wrapper .fwz-product-title {
        font-size: 1rem;
    }
    
    .fwz-collection-slider-wrapper .fwz-price-label {
        font-size: 1rem;
    }
    
    .fwz-collection-slider-wrapper .fwz-product-price .fwz-price-value {
        font-size: 1rem;
    }
    
    .fwz-collection-slider-wrapper .fwz-product-info {
        padding: 16px 0 0 0;
    }
}

/* ===================================
   ACCESSIBILITÉ
   =================================== */
.fwz-collection-slider-wrapper .fwz-product-card:focus {
    outline: 2px solid var(--fwz-text-primary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .fwz-collection-slider-wrapper .fwz-product-card,
    .fwz-collection-slider-wrapper .fwz-product-image,
    .fwz-collection-slider-wrapper .fwz-progressbar {
        transition: none;
    }
    
    .fwz-collection-slider-wrapper {
        animation: none;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .fwz-collection-slider-wrapper {
        background: white;
    }
    
    .fwz-collection-slider-wrapper .swiper-slide {
        break-inside: avoid;
    }
}