/* ===================================================
   Webee Carousel v2.0.8 - Full width + edge arrows
   + scrollbar-aware (no horizontal overflow)
   =================================================== */

/* ==================================================================
   FALLBACK CSS-PUR pour --wcar-sbw (largeur scrollbar verticale)
   100vw = viewport total (incluant scrollbar)
   100% sur :root = largeur réelle visible (sans scrollbar)
   Différence = largeur de la scrollbar (0 si absente)
   Le carousel.js override cette valeur pour précision sur resize.
   ================================================================== */
:root {
    --wcar-sbw: calc(100vw - 100%);
}

/* SECTION : prend toute la largeur du viewport */
.wcar-section {
    padding: 50px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    /* Breakout du container parent (.container 1140px) → largeur visible (sans scrollbar) */
    /* --wcar-sbw est défini par carousel.js (largeur de la scrollbar verticale, 0 si absente) */
    width: calc(100vw - var(--wcar-sbw, 0px));
    max-width: calc(100vw - var(--wcar-sbw, 0px));
    margin-left: calc((100% - 100vw + var(--wcar-sbw, 0px)) / 2);
    margin-right: calc((100% - 100vw + var(--wcar-sbw, 0px)) / 2);
    position: relative;
    overflow: hidden;
}
.wcar-section + .wcar-section { padding-top: 0; }

/* HEADER (titre) : reste à largeur normale, centré */
.wcar-header {
    max-width: 1280px;
    margin: 0 auto 28px;
    padding: 0 var(--wcar-pad, 80px);
    display: flex;
    align-items: center;
}
.wcar-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 10px;
}
.wcar-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

/* TRACK CONTAINER : pleine largeur + flèches absolute aux bords */
.wcar-track-container {
    position: relative;
    padding: 0 var(--wcar-pad, 80px);
}

.wcar-track-wrap {
    overflow: hidden;
}

.wcar-track {
    display: flex;
    gap: 18px;
    padding: 8px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.wcar-track::-webkit-scrollbar { display: none; }

/* FLÈCHES : positionnées aux bords, par-dessus les cards */
.wcar-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.wcar-prev { left: max(8px, calc(var(--wcar-pad, 80px) / 2 - 26px)); }
.wcar-next { right: max(8px, calc(var(--wcar-pad, 80px) / 2 - 26px)); }

.wcar-arrow:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 28px rgba(102,126,234,0.5);
    transform: translateY(-50%) scale(1.06);
}
.wcar-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* CARD */
.wcar-card {
    flex: 0 0 auto;
    width: 230px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}
.wcar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.10);
    border-color: transparent;
}
.wcar-img-link { display: block; text-decoration: none; }
.wcar-img-wrap {
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    overflow: hidden;
    position: relative;
}
.wcar-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.wcar-card:hover .wcar-img-wrap img { transform: scale(1.06); }
.wcar-no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; background: #f3f4f6;
}

.wcar-badge-variants {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(102,126,234,0.35);
}

.wcar-info {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wcar-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
    text-decoration: none;
    transition: color 0.15s;
}
.wcar-name:hover { color: #667eea; text-decoration: none; }

.wcar-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}
.wcar-price {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    flex: 1;
}

.wcar-cta {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    position: relative;
    overflow: hidden;
}
.wcar-cta:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(102,126,234,0.5); }
.wcar-cta:active { transform: scale(0.95); }

.wcar-cta-icon, .wcar-cta-check {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.25s, transform 0.25s;
}
.wcar-cta-check { opacity: 0; transform: scale(0.5); }
.wcar-cta.wcar-loading .wcar-cta-icon { animation: wcar-spin 0.8s linear infinite; }
.wcar-cta.wcar-success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}
.wcar-cta.wcar-success .wcar-cta-icon { opacity: 0; transform: scale(0.5); }
.wcar-cta.wcar-success .wcar-cta-check { opacity: 1; transform: scale(1); }

@keyframes wcar-spin { to { transform: rotate(360deg); } }

/* ============= MODAL VARIANTES ============= */
.wcar-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.wcar-modal.wcar-show { display: flex; animation: wcar-modal-in 0.25s ease-out; }
@keyframes wcar-modal-in { from { opacity: 0; } to { opacity: 1; } }

.wcar-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.wcar-modal-box {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    animation: wcar-modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wcar-modal-pop { from { transform: scale(0.92) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.wcar-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 2;
}
.wcar-modal-close:hover { background: #ef4444; color: #fff; }

.wcar-modal-header {
    padding: 28px 28px 18px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.wcar-modal-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    background: #f9fafb;
    flex-shrink: 0;
}
.wcar-modal-img:not([src]), .wcar-modal-img[src=""] { display: none; }
.wcar-modal-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    padding-right: 30px;
}
.wcar-modal-link {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
}
.wcar-modal-link:hover { text-decoration: underline; }

.wcar-modal-body {
    padding: 22px 28px;
    flex: 1;
}
.wcar-modal-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wcar-modal-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.wcar-opt {
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.wcar-opt:hover { border-color: #667eea; color: #667eea; }
.wcar-opt.wcar-active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

.wcar-modal-footer {
    padding: 18px 28px 24px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fafbfc;
    border-radius: 0 0 18px 18px;
}
.wcar-modal-price {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wcar-modal-add {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(102,126,234,0.35);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wcar-modal-add:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(102,126,234,0.5);
}
.wcar-modal-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
.wcar-modal-add.wcar-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcar-spin 0.7s linear infinite;
    margin-left: 4px;
}

/* TOAST */
.wcar-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #111827;
    color: #fff;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 99999;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
    opacity: 0;
    pointer-events: none;
    max-width: 90vw;
}
.wcar-toast.wcar-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.wcar-toast.wcar-success-toast { background: linear-gradient(135deg, #10b981, #059669); }
.wcar-toast.wcar-error-toast { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .wcar-header { padding: 0 60px; }
    .wcar-track-container { padding: 0 60px; }
}
@media (max-width: 768px) {
    .wcar-section { padding: 35px 0; }
    .wcar-title { font-size: 20px; }
    .wcar-card { width: 175px; }
    .wcar-arrow { width: 42px; height: 42px; }
    .wcar-prev { left: 6px; }
    .wcar-next { right: 6px; }
    .wcar-header { padding: 0 60px; }
    .wcar-track-container { padding: 0 60px; }
    .wcar-cta { width: 34px; height: 34px; }
    .wcar-price { font-size: 15px; }
    .wcar-modal-box { max-width: 100%; }
    .wcar-modal-header { flex-direction: column; gap: 12px; padding: 22px; }
    .wcar-modal-body { padding: 18px 22px; }
    .wcar-modal-footer { padding: 16px 22px 20px; flex-direction: column; }
    .wcar-modal-add { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
    .wcar-card { width: 155px; }
    .wcar-info { padding: 11px 13px 13px; }
    .wcar-name { font-size: 13px; min-height: 36px; }
    .wcar-arrow { width: 38px; height: 38px; }
    .wcar-prev { left: 4px; }
    .wcar-next { right: 4px; }
    .wcar-header { padding: 0 50px; }
    .wcar-track-container { padding: 0 48px; }
}
