/* =============================================
   KM Realisations - Carousel pleine largeur
   ============================================= */

.km-real {
    --real-card-h: 320px;
    --real-radius: 16px;
    --real-gap: 16px;
    position: relative;
    width: 100%;
    padding-bottom: 32px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.km-real:active {
    cursor: grabbing;
}

/* =============================================
   Track : flex row, translateX pour défiler
   ============================================= */

.km-real__track {
    display: flex;
    gap: var(--real-gap);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    padding: 20px 0;
}

.km-real--dragging .km-real__track {
    transition: none;
}

/* =============================================
   Slide
   ============================================= */

.km-real__slide {
    flex: 0 0 calc((100% - 4 * var(--real-gap)) / 5);
    height: var(--real-card-h);
    border-radius: var(--real-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

/* Hover overlay */
.km-real__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s ease;
    pointer-events: none;
}

.km-real__overlay svg {
    width: 32px;
    height: 32px;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.km-real__overlay-text {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}

.km-real__slide:hover .km-real__overlay {
    background: rgba(0, 0, 0, 0.45);
}

.km-real__slide:hover .km-real__overlay svg,
.km-real__slide:hover .km-real__overlay-text {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   Image - pleine hauteur
   ============================================= */

.km-real__img {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    pointer-events: none;
}

/* Caption overlay */
.km-real__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

/* =============================================
   Lightbox
   ============================================= */

.km-real-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.km-real-lb--open {
    opacity: 1;
    visibility: visible;
}

.km-real-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.km-real-lb__panel {
    position: relative;
    display: flex;
    background: #fff;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.km-real-lb--open .km-real-lb__panel {
    transform: translateY(0) scale(1);
}

/* Close button */
.km-real-lb__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.km-real-lb__close svg {
    width: 28px;
    height: 28px;
}

.km-real-lb__close:hover {
    background: #fff;
}

/* Gallery side */
.km-real-lb__gallery {
    flex: 0 0 50%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.km-real-lb__image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease;
}

/* Gallery nav arrows */
.km-real-lb__gal-prev,
.km-real-lb__gal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.km-real-lb__gal-prev svg,
.km-real-lb__gal-next svg {
    width: 24px;
    height: 24px;
}

.km-real-lb__gal-prev {
    left: 12px;
}

.km-real-lb__gal-next {
    right: 12px;
}

.km-real-lb__gal-prev:hover,
.km-real-lb__gal-next:hover {
    background: #fff;
}

/* Gallery dots */
.km-real-lb__gal-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.km-real-lb__gal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s ease;
}

.km-real-lb__gal-dot--active {
    background: #fff;
}

/* Hide gallery nav if only 1 image */
.km-real-lb__gallery[data-count="1"] .km-real-lb__gal-prev,
.km-real-lb__gallery[data-count="1"] .km-real-lb__gal-next,
.km-real-lb__gallery[data-count="1"] .km-real-lb__gal-dots {
    display: none;
}

/* Content side */
.km-real-lb__content {
    flex: 1;
    padding: 36px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.km-real-lb__title {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    color: #262626;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.km-real-lb__desc {
    font-family: Lato, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 24px 0;
}

.km-real-lb__products-label {
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 12px;
}

.km-real-lb__products {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Product row */
.km-real-lb__product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: #f8f7f5;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.2s ease;
}

.km-real-lb__product:hover {
    background: #f0eeea;
}

.km-real-lb__product-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.km-real-lb__product-info {
    flex: 1;
    min-width: 0;
}

.km-real-lb__product-name {
    font-family: Lato, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.km-real-lb__product-price {
    font-family: Lato, sans-serif;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

.km-real-lb__product-arrow {
    flex-shrink: 0;
    color: #bbb;
    transition: transform 0.2s ease, color 0.2s ease;
}

.km-real-lb__product:hover .km-real-lb__product-arrow {
    color: #BE9E66;
    transform: translateX(3px);
}

/* =============================================
   Responsive - Tablet
   ============================================= */

@media (max-width: 1024px) {
    .km-real__slide {
        flex: 0 0 calc((100% - 2 * var(--real-gap)) / 3);
    }
}

/* =============================================
   Responsive - Mobile
   ============================================= */

@media (max-width: 768px) {
    .km-real {
        --real-card-h: 240px;
        --real-gap: 10px;
    }

    .km-real__slide {
        flex: 0 0 calc((100% - var(--real-gap)) / 2);
    }

    .km-real__caption {
        font-size: 11px;
        padding: 16px 12px 10px;
    }

    /* Lightbox stacks vertically */
    .km-real-lb__panel {
        flex-direction: column;
        max-height: 90vh;
        width: 95%;
    }

    .km-real-lb__gallery {
        flex: 0 0 240px;
    }

    .km-real-lb__content {
        padding: 24px 20px;
    }

    .km-real-lb__title {
        font-size: 18px;
    }
}

/* =============================================
   Navigation mobile (flèches)
   ============================================= */

.km-real__mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    .km-real__mobile-nav {
        display: flex;
        justify-content: center;
        gap: 16px;
        margin-top: 16px;
    }

    .km-real__mobile-prev,
    .km-real__mobile-next {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 1.5px solid #ccc;
        background: #fff;
        color: #494949;
        cursor: pointer;
        transition: border-color 0.2s, color 0.2s;
    }

    .km-real__mobile-prev:active,
    .km-real__mobile-next:active {
        border-color: #BE9E66;
        color: #BE9E66;
    }
}