
.carousel-section {
    --rc-gap: 4px;
    --rc-img-h: 220px;      /* plafond de sécurité, n'est plus la hauteur fixe */
    --rc-img-ratio: 1/1;    /* ratio réel de la vignette, s'adapte à la carte */
    --rc-img-pad: 6px;
    --rc-card-pt: 0px;
    --rc-card-pr: 0px;
    --rc-card-pb: 8px;
    --rc-card-pl: 0px;
    --rc-margin-top: 16px;
    --rc-margin-bottom: 12px;
    --rc-margin-left: 0px;
    --rc-margin-right: 0px;
    --rc-height: auto;         /* hauteur min. DESKTOP (≥768px) */
    --rc-height-mobile: auto;  /* hauteur min. MOBILE (≤767px), indépendante */
    --rc-header-pt: 10px;
    --rc-header-pb: 10px;
    --rc-header-pl: 16px;
    --rc-header-pr: 16px;
    --rc-header-font-size: 1.1rem;
    --rc-header-font-size-mobile: 1rem;

    background: #fff;
    margin: var(--rc-margin-top) var(--rc-margin-right) var(--rc-margin-bottom) var(--rc-margin-left);
    padding: 0;
}

/* ── En-tête ─────────────────────────────────────────────────── */
.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--rc-header-pt) var(--rc-header-pr) var(--rc-header-pb) var(--rc-header-pl);
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    background: #fff;
}

.carousel-header h2 {
    font-size: var(--rc-header-font-size);
    font-weight: 700;
    color: #2E2F32;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    text-align: left;
    word-break: break-word;
}

.carousel-header .see-all-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0071ce;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}


 /* ───────────────────────────────────────────────────────────── */
.rescarousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: var(--rc-height-mobile);
}

.rescarousel-inner {
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s ease;
    min-height: var(--rc-height-mobile);
}

@media (min-width: 768px) {
    .rescarousel {
        min-height: var(--rc-height);
    }
    .rescarousel-inner {
        min-height: var(--rc-height);
    }
}

/* ── Item ────────────────────────────────────────────────────── */
.rescarousel-inner .item {
    flex-shrink: 0;
    padding-left: var(--rc-gap);
    box-sizing: border-box;
}

.rescarousel-inner .item:first-child {
    padding-left: var(--rc-header-pl);
}

.rescarousel-inner .item:last-child {
    padding-right: var(--rc-header-pr);
}

/* ── Carte produit ───────────────────────────────────────────── */
.product-card {
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: var(--rc-card-pt) var(--rc-card-pr) var(--rc-card-pb) var(--rc-card-pl);
}


/* ───────────────────────────────────────────────────────────── */
.product-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: var(--rc-img-ratio);
    max-height: var(--rc-img-h); /* plafond pour éviter des vignettes énormes sur très grand écran */
    padding: var(--rc-img-pad);
    background: #fff;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

/* Badge promo */
.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #007dc6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-badge.badge-rollback { background: #007dc6; }
.product-badge.badge-promo { background: #e53935; }

/* ── Zone texte ──────────────────────────────────────────────── */
.product-info {
    padding: 8px 4px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-price-block {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
}

.product-price-now {
    font-size: 1rem;
    font-weight: 800;
    color: #2E2F32;
}

.product-price-old {
    font-size: 0.78rem;
    text-decoration: line-through;
    color: #74767c;
}

.product-price-save {
    font-size: 0.75rem;
    color: #007dc6;
    font-weight: 600;
}

.product-name {
    font-size: 0.82rem;
    color: #2E2F32;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-stars {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 4px;
}

.product-stars .stars-filled {
    color: #ffc220;
    font-size: 11px;
    letter-spacing: -1px;
}

.product-stars .stars-count {
    font-size: 11px;
    color: #74767c;
}

.product-options-badge {
    font-size: 11px;
    color: #74767c;
    margin-top: 2px;
}

/* ── Boutons navigation ──────────────────────────────────────── */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 28px;
    height: 53px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.carousel-nav-btn.nav-prev {
    left: 0;
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.carousel-nav-btn.nav-next {
    right: 0;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.carousel-nav-btn svg {
    width: 14px;
    height: 14px;
    stroke: #1a1a1a;
    stroke-width: 2.2;
    fill: none;
}

.carousel-nav-btn.is-hidden { display: none; }

/* ═══════════════════════════════════════════════════════════════
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .carousel-nav-btn { display: none !important; }
}

/* ── Mobile (≤ 767px) ────────────────────────────────────────── */
@media (max-width: 767px) {
    .carousel-header {
        padding: 8px 16px 5px 8px;
        gap: 8px;
    }

    .carousel-header h2 {
        font-size: 1.1rem;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left;
    }

    .carousel-header .see-all-link {
        font-size: 0.83rem;
    }

    .rescarousel-inner .item:first-child {
        padding-left: 10px;
    }

    .rescarousel-inner .item:last-child {
        padding-right: 16px;
    }

    .product-name { font-size: 0.83rem; }

    .product-price-now {
        font-size: 1rem;
        font-weight: 800;
        color: #2E2F32;
    }
}

/* ── Très petit mobile (≤ 400px) ─────────────────────────────── */
@media (max-width: 400px) {
    .carousel-header {
        padding: 8px 12px 8px 12px;
        gap: 4px;
    }

    .carousel-header h2 {
        font-size: 0.9rem;
        margin: 0 !important;
        padding: 0 !important;
    }

    .carousel-header .see-all-link {
        font-size: 0.7rem;
    }

    .rescarousel-inner .item:first-child {
        padding-left: 12px;
    }

    .rescarousel-inner .item:last-child {
        padding-right: 12px;
    }

    .product-name { font-size: 0.82rem; }
    .product-price-now { font-size: 0.9rem; }
}

@media (max-width: 575px) {
    .rescarousel-inner .item { width: calc(100% / 2.4); }
}

@media (min-width: 576px) and (max-width: 767px) {
    .rescarousel-inner .item { width: calc(100% / 3.2); }
}

@media (min-width: 768px) and (max-width: 991px) {
    .rescarousel-inner .item { width: 25%; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .rescarousel-inner .item { width: 20%; }
}

@media (min-width: 1200px) {
    .rescarousel-inner .item { width: 16.666%; }
}