/**
 * BienHabillé - Elementor Widgets CSS
 * Support Desktop / Tablet / Mobile
 */

/* ============================================== */
/* SLIDER */
/* ============================================== */
.bh-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.bh-slider .swiper-wrapper {
    height: 100%;
}

/* ============================================== */
/* SLIDE */
/* ============================================== */
.bh-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Background */
.bh-slide__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Picture (responsive images) */
.bh-slide__picture {
    display: block;
    width: 100%;
    height: 100%;
}

.bh-slide__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ============================================== */
/* VIDEO */
/* ============================================== */
.bh-slide__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bh-slide__video iframe,
.bh-slide__video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* YouTube/Vimeo - scale pour couvrir */
.bh-slide__video--youtube iframe,
.bh-slide__video--vimeo iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 177.77vh;
    min-height: 56.25vw;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Vidéo Desktop/Mobile switch */
.bh-slide__video-desktop {
    display: block;
}

.bh-slide__video-mobile {
    display: none;
}

@media (max-width: 767px) {
    .bh-slide__video-desktop {
        display: none;
    }
    
    .bh-slide__video-mobile {
        display: block;
    }
}

/* ============================================== */
/* OVERLAY */
/* ============================================== */
.bh-slide__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}

/* ============================================== */
/* CONTENT */
/* ============================================== */
.bh-slide__content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    text-align: center;
    z-index: 3;
    box-sizing: border-box;
}

/* Position horizontale */
.bh-slide__content--left {
    align-items: flex-start;
    text-align: left;
    padding-left: 80px;
}

.bh-slide__content--right {
    align-items: flex-end;
    text-align: right;
    padding-right: 80px;
}

/* Position verticale */
.bh-slide__content--v-top {
    justify-content: flex-start;
    padding-top: 100px;
}

.bh-slide__content--v-bottom {
    justify-content: flex-end;
    padding-bottom: 100px;
}

/* Subtitle */
.bh-slide__subtitle {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 16px 0;
}

/* Title */
.bh-slide__title {
    font-size: 52px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin: 0 0 24px 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Buttons */
.bh-slide__buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: inherit;
}

/* Animation seulement sur desktop */
@media (min-width: 768px) {
    .bh-slide__subtitle {
        opacity: 0;
        transform: translateY(20px);
        animation: bhSlideUp 0.6s ease forwards 0.3s;
    }
    
    .bh-slide__title {
        opacity: 0;
        transform: translateY(30px);
        animation: bhSlideUp 0.6s ease forwards 0.5s;
    }
    
    .bh-slide__buttons {
        opacity: 0;
        transform: translateY(20px);
        animation: bhSlideUp 0.6s ease forwards 0.7s;
    }
    
    /* Reset animation quand slide pas active */
    .swiper-slide:not(.swiper-slide-active) .bh-slide__subtitle,
    .swiper-slide:not(.swiper-slide-active) .bh-slide__title,
    .swiper-slide:not(.swiper-slide-active) .bh-slide__buttons {
        opacity: 0;
        transform: translateY(30px);
        animation: none;
    }
}

.bh-slide__button {
    display: inline-block;
    padding: 16px 40px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: #ffffff;
    color: #000000;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.bh-slide__button:hover {
    background: #000000;
    color: #ffffff;
}

/* Animation */
@keyframes bhSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================== */
/* NAVIGATION - ARROWS */
/* ============================================== */
.bh-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.bh-slider__arrow:hover {
    background: rgba(0, 0, 0, 0.6);
}

.bh-slider__arrow--prev {
    left: 30px;
}

.bh-slider__arrow--next {
    right: 30px;
}

/* ============================================== */
/* NAVIGATION - PAGINATION */
/* ============================================== */
.bh-slider .swiper-pagination {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    z-index: 10;
}

.bh-slider .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    margin: 0 6px;
    transition: all 0.3s ease;
}

.bh-slider .swiper-pagination-bullet-active {
    background: #ffffff;
    transform: scale(1.2);
}

/* ============================================== */
/* RESPONSIVE - TABLET (max 1024px)
/* ============================================== */
@media (max-width: 1024px) {
    .bh-slide__title {
        font-size: 40px;
    }
    
    .bh-slide__content {
        padding: 40px 30px;
    }
    
    .bh-slide__content--left {
        padding-left: 50px;
    }
    
    .bh-slide__content--right {
        padding-right: 50px;
    }
    
    .bh-slider__arrow {
        width: 44px;
        height: 44px;
    }
    
    .bh-slider__arrow--prev {
        left: 20px;
    }
    
    .bh-slider__arrow--next {
        right: 20px;
    }
}

/* ============================================== */
/* RESPONSIVE - MOBILE (max 767px)
/* ============================================== */
@media (max-width: 767px) {
    /* FORCER AFFICHAGE TEXTE SUR MOBILE */
    .bh-slide__content {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100 !important;
        position: absolute !important;
    }
    
    .bh-slide__subtitle,
    .bh-slide__title,
    .bh-slide__buttons,
    .bh-slide__button {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        color: #ffffff !important;
    }
    
    .bh-slide__subtitle,
    .bh-slide__title {
        display: block !important;
    }
    
    .bh-slide__buttons {
        display: flex !important;
    }
    
    .bh-slide__button {
        display: inline-block !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    /* S'assurer que le background ne cache pas le contenu */
    .bh-slide__bg {
        z-index: 1 !important;
    }
    
    .bh-slide__overlay {
        z-index: 2 !important;
    }
    
    .bh-slide__subtitle {
        font-size: 13px;
        letter-spacing: 0.15em;
        margin-bottom: 12px;
    }
    
    .bh-slide__title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .bh-slide__content {
        padding: 30px 20px;
    }
    
    .bh-slide__content--left,
    .bh-slide__content--right {
        align-items: center;
        text-align: center;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .bh-slide__content--v-top {
        padding-top: 60px;
    }
    
    .bh-slide__content--v-bottom {
        padding-bottom: 60px;
    }
    
    .bh-slide__button {
        padding: 14px 30px;
        font-size: 13px;
    }
    
    .bh-slide__buttons {
        justify-content: center;
    }
    
    /* Masquer flèches sur mobile si option activée */
    .bh-slider--hide-arrows-mobile .bh-slider__arrow {
        display: none;
    }
    
    .bh-slider .swiper-pagination {
        bottom: 20px;
    }
    
    .bh-slider .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
    
    /* Masquer contenu sur mobile si option activée */
    .bh-slide--hide-content-mobile .bh-slide__content {
        display: none;
    }
}

/* ============================================== */
/* RESPONSIVE - SMALL MOBILE (max 480px)
/* ============================================== */
@media (max-width: 480px) {
    .bh-slide__title {
        font-size: 24px;
    }
    
    .bh-slide__subtitle {
        font-size: 12px;
    }
    
    .bh-slide__button {
        padding: 12px 24px;
        font-size: 12px;
    }
}

/* ============================================== */
/* ELEMENTOR EDITOR - pas d'animation */
/* ============================================== */
.elementor-editor-active .bh-slide__subtitle,
.elementor-editor-active .bh-slide__title,
.elementor-editor-active .bh-slide__buttons {
    opacity: 1;
    transform: none;
    animation: none;
}

/* ============================================== */
/* CATEGORY BAR - Style Celio */
/* ============================================== */
.bh-catbar {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    overflow: hidden;
}

.bh-catbar__wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 20px;
}

.bh-catbar__wrapper::-webkit-scrollbar {
    display: none;
}

.bh-catbar__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
}

.bh-catbar__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    color: #333333;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bh-catbar__item:hover {
    color: #000000;
    border-color: #000000;
    background: #ffffff;
}

/* Highlight (ex: Soldes en rouge) */
.bh-catbar__item--highlight {
    color: #e53935;
    border-color: #e53935;
}

.bh-catbar__item--highlight:hover {
    color: #ffffff;
    background: #e53935;
    border-color: #e53935;
}

/* Arrows - Style Celio */
.bh-catbar__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    color: #333333;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    z-index: 2;
    opacity: 0.8;
}

.bh-catbar__arrow:hover {
    opacity: 1;
    color: #000000;
}

.bh-catbar__arrow--left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to right, #ffffff 60%, transparent);
    padding-right: 20px;
    width: 50px;
    justify-content: flex-start;
    padding-left: 5px;
}

.bh-catbar__arrow--right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(to left, #ffffff 60%, transparent);
    padding-left: 20px;
    width: 50px;
    justify-content: flex-end;
    padding-right: 5px;
}

/* Hide arrows when not overflowing */
.bh-catbar:not(.bh-catbar--overflowing) .bh-catbar__arrow {
    display: none;
}

/* ============================================== */
/* CATEGORY BAR - RESPONSIVE */
/* ============================================== */
@media (max-width: 1024px) {
    .bh-catbar__wrapper {
        padding: 0 15px;
    }
    
    .bh-catbar__item {
        padding: 7px 14px;
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    .bh-catbar {
        padding: 10px 0;
    }
    
    .bh-catbar__wrapper {
        padding: 0 12px;
    }
    
    .bh-catbar__item {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .bh-catbar__list {
        gap: 6px;
    }
    
    .bh-catbar__arrow {
        display: none;
    }
}

/* ============================================== */
/* CATEGORY GRID - Style Celio */
/* ============================================== */
.bh-catgrid {
    padding: 30px 20px;
    width: 100%;
    box-sizing: border-box;
}

.bh-catgrid__wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.bh-catgrid__list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px 20px !important;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bh-catgrid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
}

.bh-catgrid__image {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    overflow: hidden;
    position: relative;
}

.bh-catgrid__image img {
    max-width: 85%;
    max-height: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Hover effects */
.bh-catgrid--hover-scale .bh-catgrid__item:hover .bh-catgrid__image img {
    transform: scale(1.05);
}

.bh-catgrid--hover-opacity .bh-catgrid__item:hover .bh-catgrid__image img {
    opacity: 0.8;
}

.bh-catgrid__title {
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    text-align: center;
    margin: 15px 0 0 0;
    padding: 0;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Underline on hover */
.bh-catgrid--underline .bh-catgrid__item:hover .bh-catgrid__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================== */
/* CATEGORY GRID - RESPONSIVE */
/* ============================================== */
@media (max-width: 1200px) {
    .bh-catgrid__list {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px 15px !important;
    }
    
    .bh-catgrid__image {
        height: 180px;
    }
}

@media (max-width: 1024px) {
    .bh-catgrid__list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .bh-catgrid__image {
        height: 160px;
    }
    
    .bh-catgrid__title {
        font-size: 14px;
    }
}

/* Mobile - Scroll horizontal style Celio */
@media (max-width: 767px) {
    .bh-catgrid {
        padding: 20px 0;
    }
    
    .bh-catgrid--mobile-scroll {
        overflow: hidden;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 15px;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__list {
        display: grid !important;
        grid-template-columns: repeat(4, 110px) !important;
        grid-template-rows: repeat(2, auto) !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 110px !important;
        gap: 20px 12px !important;
        width: max-content !important;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__item {
        width: 110px;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__image {
        height: 120px;
        width: 100%;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__image img {
        max-width: 90%;
        max-height: 90%;
    }
    
    .bh-catgrid--mobile-scroll .bh-catgrid__title {
        font-size: 12px;
        margin-top: 10px;
        line-height: 1.3;
    }
    
    /* Non-scroll mobile layout */
    .bh-catgrid:not(.bh-catgrid--mobile-scroll) .bh-catgrid__list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px 12px !important;
    }
    
    .bh-catgrid:not(.bh-catgrid--mobile-scroll) .bh-catgrid__image {
        height: 120px;
    }
}