/* ==========================================================================
   DESCOD - Cross-sell UX

   @module     pw6_accessoires
   @author     Descod Gerard Jonathan <jonathangerard57@gmail.com>
   @version    1.0.0
   @copyright  2026 Descod — Tous droits réservés
   @license    Proprietary
   ========================================================================== */

/* ==========================================================================
   Powair6 - Selecteur d'accessoires v1.0 (v12)
   ========================================================================== */

/* ---------- Section ---------- */
.pw6-acc-section {
    margin: 24px 0 32px;
    padding: 24px 0;
    border-top: 2px solid #e8e8e8;
    border-bottom: 2px solid #e8e8e8;
    background: #f7f7f7;
    border-radius: 4px;
}

/* ---------- En-tete ---------- */
.pw6-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

.pw6-acc-icon {
    color: #e63946;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pw6-acc-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.pw6-acc-subtitle {
    font-size: 0.78rem;
    color: #777;
    margin-left: auto;
    white-space: nowrap;
}

/* ==========================================================================
   Carousel : [fleche-prev] [liste scrollable] [fleche-next]
   Les fleches sont des flex-items — jamais dans la zone de scroll.
   ========================================================================== */
.pw6-acc-carousel {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 8px;
}

/* ---------- Fleches ---------- */
.pw6-acc-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, opacity 0.2s, box-shadow 0.15s;
    opacity: 0.75;
    /* Pas de position absolute — c'est un flex item */
}

.pw6-acc-arrow:hover {
    opacity: 1;
    background: #f0f0f0;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
}

.pw6-acc-arrow svg { display: block; }

.pw6-acc-arrow--prev.pw6-hidden,
.pw6-acc-arrow--next.pw6-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

/* ---------- Wrapper liste (entre les deux fleches) ---------- */
.pw6-acc-list-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    /* overflow: hidden retire en v13 — bloquait scrollBy() sur .pw6-acc-list */
}

/* Degrade droite */
.pw6-acc-list-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 100%;
    background: linear-gradient(to right, transparent, #f7f7f7);
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 1;
}

/* Degrade gauche */
.pw6-acc-list-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 40px; height: 100%;
    background: linear-gradient(to left, transparent, #f7f7f7);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1;
}

.pw6-acc-list-wrap.pw6-scrolled-left::before { opacity: 1; }
.pw6-acc-list-wrap.pw6-scrolled-end::after   { opacity: 0; }

/* ---------- Liste ---------- */
.pw6-acc-list {
    display: flex;
    gap: 10px;
    padding: 4px 8px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pw6-acc-list::-webkit-scrollbar { display: none; }

/* ---------- Carte ---------- */
.pw6-acc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff;
    border: 2px solid #e0e0e0;
    min-width: 240px;
    max-width: 300px;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.pw6-acc-card:not(.pw6-acc-card--selected):hover {
    background: #0f1929;
    border-color: #0f1929;
}

.pw6-acc-card:not(.pw6-acc-card--selected):hover .pw6-acc-name  { color: #4ade80; }
.pw6-acc-card:not(.pw6-acc-card--selected):hover .pw6-acc-price { color: #e63946; }
.pw6-acc-card:not(.pw6-acc-card--selected):hover .pw6-acc-img-wrap { background: #1a2a3a; }

.pw6-acc-card--selected {
    background: #111;
    border-color: #111;
    color: #fff;
}

.pw6-acc-card--selected .pw6-acc-name  { color: #fff; }
.pw6-acc-card--selected .pw6-acc-price { color: #4ade80; }

/* ---------- Image ---------- */
.pw6-acc-img-wrap {
    flex-shrink: 0;
    display: block;
    width: 64px; height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}

.pw6-acc-card--selected .pw6-acc-img-wrap { background: #222; }

.pw6-acc-img-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.pw6-acc-img-placeholder { width: 100%; height: 100%; background: #ddd; }

/* ---------- Info ---------- */
.pw6-acc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pw6-acc-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pw6-acc-name:hover { text-decoration: underline; }

.pw6-acc-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e63946;
}

.pw6-acc-stock--out {
    font-size: 0.7rem;
    color: #f59e0b;
}

/* ---------- Toggle Switch ---------- */
.pw6-acc-toggle {
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.pw6-acc-checkbox {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

.pw6-acc-slider {
    display: block;
    width: 46px; height: 26px;
    border-radius: 13px;
    background: #ccc;
    transition: background 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.pw6-acc-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform 0.2s ease;
}

.pw6-acc-checkbox:checked + .pw6-acc-slider              { background: #22c55e; }
.pw6-acc-checkbox:checked + .pw6-acc-slider::after       { transform: translateX(20px); }
.pw6-acc-checkbox:disabled + .pw6-acc-slider             { opacity: 0.4; cursor: not-allowed; }
.pw6-acc-checkbox:focus-visible + .pw6-acc-slider        { outline: 2px solid #e63946; outline-offset: 2px; }

/* ---------- Footer ---------- */
.pw6-acc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px 0;
    margin-top: 14px;
    border-top: 1px solid #e0e0e0;
}

.pw6-acc-total {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.pw6-acc-total-label { color: #555; }

.pw6-acc-total-value {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a1a;
}

.pw6-acc-note {
    font-size: 0.72rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.pw6-acc-note svg { flex-shrink: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .pw6-acc-section    { margin: 16px 0 24px; padding: 18px 0; border-radius: 0; }
    .pw6-acc-header     { padding: 0 14px 12px; }
    .pw6-acc-subtitle   { display: none; }
    .pw6-acc-title      { font-size: 0.9rem; }
    .pw6-acc-carousel   { padding: 0 4px; }
    .pw6-acc-arrow      { width: 30px; height: 30px; }
    .pw6-acc-list       { padding: 4px 6px 8px; gap: 8px; }
    .pw6-acc-card       { min-width: 200px; padding: 10px 12px; gap: 10px; }
    .pw6-acc-img-wrap   { width: 52px; height: 52px; }
    .pw6-acc-footer     { padding: 12px 14px 0; flex-direction: column; align-items: flex-start; }
    .pw6-acc-note       { display: none; }
}
