/* --------------------------------------------------------------------------
   Variables CSS par défaut (surchargées via style="" dans les templates)
   -------------------------------------------------------------------------- */
:root {
    --jlcw-border-color: #2fb5d2;
    --jlcw-border-width: 3px;
    --jlcw-title-color: #333;
    --jlcw-gap: 16px;
    --jlcw-cols-mobile: 1;
    --jlcw-cols-tablet: 2;
    --jlcw-cols-desktop: 3;
}

/* --------------------------------------------------------------------------
   Commun à tous les widgets
   -------------------------------------------------------------------------- */
.jlcw-widget {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.jlcw-widget.jlcw-grid {
  position: relative;
  width: 100%;
  display: block;
}

.jlcw-is-static .swiper-button-prev,
.jlcw-is-static .swiper-button-next {
    display: none !important;
}

.jlcw-is-static .swiper-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    transform: none !important;
}

.jlcw-is-static .swiper-slide {
    width: auto !important;
}

.video-thumb-card {
    cursor: pointer;
    text-align: center;
    position: relative;
}

.jlcw-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease;
    border-radius: inherit;
}

.video-thumb-card:hover .jlcw-play-overlay {
    background: rgba(0, 0, 0, 0.45);
}

.jlcw-play-overlay i {
    color: #fff;
    font-size: 28px;
}

.jlcw-item-title {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: #333;
    font-weight: 500;
    margin-top: 6px;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   Picto Shoppable
   -------------------------------------------------------------------------- */
.jlcw-shoppable-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.jlcw-shoppable-badge svg {
    width: 13px;
    height: 13px;
    fill: var(--jlcw-border-color, #2fb5d2);
}

/* --------------------------------------------------------------------------
   Stories
   -------------------------------------------------------------------------- */
.jlcw-stories .swiper-slide {
    /* width: auto !important; */
    /* Supprimé pour respecter le nombre de slides configuré */
}

.jlcw-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90px;
}

.jlcw-story-thumb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: var(--jlcw-border-width, 3px) solid var(--jlcw-border-color, #2fb5d2);
    overflow: hidden;
    position: relative;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 4px;
    /* Plus d'espace interne comme demandé */
    margin: 8px auto;
    /* Plus de marge pour le scale sans clipping */
}

.jlcw-story-item:hover .jlcw-story-thumb {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jlcw-story-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.jlcw-story-thumb .jlcw-play-overlay {
    border-radius: 50%;
}

.jlcw-story-label {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    color: var(--jlcw-title-color, #333);
    text-align: center;
    margin-top: 5px;
    max-width: 80px;
    word-break: break-word;
}


.jlcw-stories .swiper-button-prev,
.jlcw-stories .swiper-button-next {
    color: var(--jlcw-border-color, #2fb5d2) !important;
    background: #fff;
    /* Totalement opaque */
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    top: 58px !important;
    transform: none !important;
    margin-top: 0 !important;
    z-index: 10;
  position : static;
}

.jlcw-stories .swiper-button-prev {
    left: 10px !important;
}

.jlcw-stories .swiper-button-next {
    right: 10px !important;
}

.jlcw-stories .swiper-button-prev:after,
.jlcw-stories .swiper-button-next:after {
    font-size: 14px !important;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   Carrousel
   -------------------------------------------------------------------------- */
.jlcw-carousel .swiper {
    padding: 0px;
}

.jlcw-carousel-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    background: #111;
}

.jlcw-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.jlcw-carousel-item:hover .jlcw-carousel-thumb img {
    transform: scale(1.04);
}

.jlcw-carousel .swiper-button-prev,
.jlcw-carousel .swiper-button-next {
    color: #2fb5d2 !important;
    background: #fff;
    /* Totalement opaque */
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.jlcw-carousel .swiper-button-prev {
    left: 4px !important;
}

.jlcw-carousel .swiper-button-next {
    right: 4px !important;
}

.jlcw-carousel .swiper-button-prev:after,
.jlcw-carousel .swiper-button-next:after {
    font-size: 16px !important;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   Grille
   -------------------------------------------------------------------------- */
.jlcw-grid-inner {
    display: grid;
    grid-template-columns: repeat(var(--jlcw-cols-desktop, 3), 1fr);
    gap: var(--jlcw-gap, 16px);
}

@media (max-width: 991px) {
    .jlcw-grid-inner {
        grid-template-columns: repeat(var(--jlcw-cols-tablet, 2), 1fr);
    }
}

@media (max-width: 575px) {
    .jlcw-grid-inner {
        grid-template-columns: repeat(var(--jlcw-cols-mobile, 1), 1fr);
    }
}

.jlcw-grid-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    padding-top: 177.77%;
    /* Aspect ratio 9:16 (16/9 = 1.777) */
    background: #111;
}

.jlcw-grid-thumb>*:not(.jlcw-play-overlay):not(.jlcw-shoppable-badge) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jlcw-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.jlcw-grid-card:hover .jlcw-grid-thumb img {
    transform: scale(1.04);
}

.jlcw-direct-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}

.jlcw-direct-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.jlcw-direct-iframe-container iframe,
.jlcw-direct-iframe-container blockquote {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    max-width: 100% !important;
    border: none !important;
}

.jlcw-iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: transparent;
}

/* --------------------------------------------------------------------------
   Modal popup
   -------------------------------------------------------------------------- */
.jlcw-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    overflow: hidden;
}

.jlcw-modal-content {
    background: #fff;
    margin: 4% auto;
    width: 84%;
    max-width: 1050px;
    height: 82vh;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.jlcw-close {
    position: absolute;
    top: -34px;
    right: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
}

.jlcw-close:hover {
    color: #fff;
}

.jlcw-video-layout {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.jlcw-video-layout.no-products .jlcw-video-player-container {
    width: 100%;
}

.jlcw-video-layout.no-products .jlcw-product-sidebar {
    display: none;
}

.jlcw-video-player-container {
    width: 65%;
    height: 100%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#jlcw-player-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#jlcw-player-wrapper iframe,
#jlcw-player-wrapper video {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: 100%;
    object-fit: contain;
    border: none;
}

.jlcw-instagram-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.jlcw-instagram-wrapper .instagram-media,
.jlcw-instagram-wrapper iframe {
    width: 100% !important;
    max-height: 100% !important;
    max-width: 450px !important;
    /* Optimisé pour le ratio 9:16 */
    margin: 0 auto !important;
    aspect-ratio: 9 / 16;
    object-fit: contain;
}

/* Boutons navigation */
.jlcw-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.82);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.jlcw-nav-btn:hover {
    background: #fff;
}

.jlcw-prev-btn {
    left: 10px;
}

.jlcw-next-btn {
    right: 10px;
}

.jlcw-nav-btn i {
    font-size: 24px;
    color: #333;
}

/* Sidebar produits */
.jlcw-product-sidebar {
    width: 35%;
    height: 100%;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e8e8e8;
}

.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.jlcw-product-item {
    display: flex;
    margin-bottom: 14px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.jlcw-product-item img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
}

.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
}

.product-price {
    color: var(--jlcw-border-color, #2fb5d2);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 13px;
}

.jlcw-add-to-cart-container select {
    width: 100%;
    margin-bottom: 6px;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.jlcw-fake-btn {
    background: var(--jlcw-border-color, #2fb5d2);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    transition: opacity 0.2s;
}

.jlcw-fake-btn:hover {
    opacity: 0.88;
}

.jlcw-fake-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.jlcw-fake-btn.added {
    background: #3db76a;
}

.jlcw-fake-btn i {
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Responsive modal
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .jlcw-modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .jlcw-video-layout {
        flex-direction: column;
    }

    .jlcw-video-player-container {
        width: 100%;
        height: 60vh;
        /* Plus de place pour le format vertical */
        min-height: 60vh;
    }

    .jlcw-product-sidebar {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }

    .jlcw-close {
        top: 10px;
        right: 14px;
        background: rgba(0, 0, 0, 0.35);
        border-radius: 50%;
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
    }

    .jlcw-story-item {
        width: 70px;
    }

    .jlcw-story-thumb {
        width: 64px;
        height: 64px;
    }
}

/* ==========================================================================
   RGPD / GDPR Glassmorphism Placeholders
   ========================================================================== */
.jlcw-gdpr-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: #ffffff;
    font-family: inherit;
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
    z-index: 10;
}

.jlcw-gdpr-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    animation: jlcwFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jlcw-gdpr-icon {
    font-size: 32px !important;
    color: #2fb5d2;
    background: rgba(47, 181, 210, 0.15);
    border: 1px solid rgba(47, 181, 210, 0.3);
    padding: 12px;
    border-radius: 50%;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(47, 181, 210, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jlcw-gdpr-placeholder:hover .jlcw-gdpr-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(47, 181, 210, 0.4);
}

.jlcw-gdpr-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.jlcw-gdpr-text {
    font-size: 11px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 16px 0;
}

.jlcw-gdpr-btn {
    background: linear-gradient(135deg, #2fb5d2 0%, #1e8fa8 100%);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(47, 181, 210, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.jlcw-gdpr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(47, 181, 210, 0.5);
    filter: brightness(1.1);
}

.jlcw-gdpr-btn:active {
    transform: translateY(0);
}

/* Adjustments for direct-video iframe container when blocked */
.jlcw-gdpr-placeholder-container {
    position: relative;
    background: #111;
    overflow: hidden;
}

/* Specific styling for story circle placeholder - minimalist view */
.jlcw-story-thumb .jlcw-gdpr-placeholder {
    padding: 4px;
}

.jlcw-story-thumb .jlcw-gdpr-inner {
    max-width: 100%;
}

.jlcw-story-thumb .jlcw-gdpr-icon {
    font-size: 18px !important;
    padding: 6px;
    margin-bottom: 0;
}

.jlcw-story-thumb .jlcw-gdpr-title,
.jlcw-story-thumb .jlcw-gdpr-text,
.jlcw-story-thumb .jlcw-gdpr-btn {
    display: none;
}

@keyframes jlcwFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swiper.jlcw-stories-track,
.swiper.jlcw-carousel-swiper {
  width: calc(100% - 90px);
}
