/* ==========================================================================
   BLOC 1 : CONTAINER
   ========================================================================== */
.spd-gallery-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: inherit;
    box-sizing: border-box;
}
.spd-gallery-container * { box-sizing: border-box; }


/* ==========================================================================
   BLOC 2 : SCÈNE PRINCIPALE
   ========================================================================== */
.spd-stage {
    width: 100%;
    position: relative;
    background: #fff;
    border: 0px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spd-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
    z-index: 1; 
}


/* ==========================================================================
   BLOC 3 : BADGES DYNAMIQUES
   ========================================================================== */
.spd-badges-layer {
    position: absolute;
    top: 15px; 
    left: 15px;
    z-index: 100 !important; 
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    pointer-events: none;
}

.spd-badge {
    display: inline-block !important; 
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    line-height: 1;
    visibility: visible !important; 
    opacity: 1 !important;
}

.spd-badge-stock.spd-b-in { background-color: #27ae60; }   
.spd-badge-stock.spd-b-out { background-color: #c0392b; }  
.spd-badge-stock.spd-b-back { background-color: #f39c12; } 
.spd-badge-promo { background-color: #e74c3c; font-size: 13px; }


/* ==========================================================================
   BLOC 4 : CARROUSEL PRINCIPAL
   ========================================================================== */
.spd-carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: auto;
}

.spd-carousel-wrapper.spd-hide-nav .spd-arrow {
    visibility: hidden;
    pointer-events: none;
}

.spd-track-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 4px 0; 
}

.spd-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    width: 100%; 
}

.spd-thumb {
    flex: 0 0 33.3333%;
    width: 33.3333%;
    max-width: 33.3333%;
    padding: 0 6px;
    cursor: pointer;
    user-select: none;
    position: relative;
    outline: none !important;
}

/* Force la suppression de l'outline sur le focus */
.spd-thumb:focus, .spd-thumb:active {
    outline: none !important;
}

.spd-thumb-inner {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
}

.spd-thumb-inner img { width: 100%; height: 100%; object-fit: contain; display: block; }
.spd-thumb-inner:hover { border-color: #999; }

.spd-thumb.is-active .spd-thumb-inner {
    border-color: #000;
    box-shadow: 0 0 0 1px #000 inset;
}

.spd-thumb.spd-out-of-stock .spd-thumb-inner { opacity: 0.6; }


/* ==========================================================================
   BLOC 5 : ÉLÉMENTS COMMUNS (FLÈCHES)
   ========================================================================== */
.spd-arrow {
    flex: 0 0 36px;
    width: 36px; height: 36px;
    border: 1px solid #ddd; 
    background: #fff; 
    border-radius: 50%;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #333; 
    transition: all 0.2s;
    padding: 0;
    outline: none !important;
}
.spd-arrow:hover { background: #222; color: #fff; border-color: #222; }

/* Style du SVG */
.spd-arrow svg, .syn-var-arrow svg { 
    width: 20px; 
    height: 20px; 
    stroke: currentColor; 
    fill: none; 
    display: block; 
}


/* ==========================================================================
   BLOC 6 : TUILES VARIATIONS (ANTI-FLIP FLAP)
   ========================================================================== */
.syn-var-gallery-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    
    /* FIX : Masqué par défaut le temps du calcul JS */
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Classe ajoutée par JS une fois le calcul fini */
.syn-var-gallery-container.is-ready {
    opacity: 1;
}

.syn-var-viewport { flex-grow: 1; overflow: hidden; }
.syn-var-track { display: flex; gap: 15px; transition: transform 0.4s ease-out; }

.syn-var-tile {
    flex-shrink: 0;
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
    outline: none !important;
}

.syn-var-tile.spd-out-of-stock { opacity: 0.6; }

.syn-var-tile-img {
    width: 100%; 
    aspect-ratio: 1 / 1;
    border: 1px solid #eee; 
    border-radius: 8px;
    overflow: hidden; 
    position: relative; 
    transition: border-color 0.2s, box-shadow 0.2s;
}

.syn-tile-badges { top: 10px; left: 10px; }
.syn-tile-badges .spd-badge { font-size: 11px; padding: 4px 8px; }

.syn-var-tile-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

.syn-var-tile-info { text-align: center; width: 100%; }

/* TITRE H3 */
.syn-var-title { 
    font-size: 15px !important; 
    font-weight: 600; 
    color: #333 !important; 
    margin: 8px 0 0 0; 
    line-height: 1.3;
    text-transform: capitalize;
    display: block !important;
    visibility: visible !important;
    z-index: 10;
}

.syn-var-tile.is-active .syn-var-tile-img {
    border: 2px solid #000; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.syn-var-arrow {
    flex: 0 0 40px; width: 40px; height: 40px;
    border: 1px solid #ccc; background: #fff; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 2;
    outline: none !important;
}
.syn-var-arrow:hover { border-color: #000; background: #000; color: #fff; }

