/* ==========================================================================
   Galerie 3 images -> carrousel plein écran (desktop uniquement)
   A placer dans /assets/css/rolex-gallery-carousel.css du thème enfant
   ========================================================================== */

/* --- Marges du carrousel + centrage du bloc dans la section --- */
.rolex-gallery {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 86px;
    padding-right: 86px;
}

/* --- Miniatures (ligne de 3 images) --- */
.rolex-gallery__row {
    margin: 0;
}

.rolex-gallery__row .rolex-gallery__item {
    flex: 0 0 auto;
    width: 380px;
    max-width: 380px;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #F9F7F5;
}

.rolex-gallery__picture,
.rolex-gallery__img {
    width: 100%;
    height: 100%;
    display: block;
}

.rolex-gallery__img {
    object-fit: cover;
    transition: transform 0.35s ease;
}

.rolex-gallery__item:hover .rolex-gallery__img {
    transform: scale(1.03);
}

/* --- Modal plein écran --- */
.rolex-gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #F9F7F5;
}

.rolex-gallery-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.rolex-gallery-modal-open {
    overflow: hidden;
}

/* --- Croix de fermeture : bouton rond (comme les flèches) --- */
.rolex-gallery-modal__close {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    line-height: 0;
}

.rolex-gallery-modal__close:hover {
    background-color: #d4d4d4;
}

.rolex-gallery-modal__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    padding: 0 40px;
}

.rolex-gallery-modal__swiper {
    width: 100%;
    max-width: 900px;
}

.rolex-gallery-modal__swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rolex-gallery-modal__swiper .swiper-slide img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.rolex-gallery-modal__pagination {
    position: relative;
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* --- Bullets : pilules arrondies (au lieu de points), l'active est plus large --- */
.rolex-gallery-modal__pagination .swiper-pagination-bullet {
    width: 28px;
    height: 4px;
    background-color: rgb(212, 212, 212);
    opacity: 1;
    border-radius: 999px;
    margin: 0 !important;
    transition: background-color 0.25s ease, width 0.25s ease;
}

.rolex-gallery-modal__pagination .swiper-pagination-bullet-active {
    width: 40px;
    background-color: #127749;
}

/* --- Flèches prev/next : boutons ronds --- */
.rolex-gallery-modal__arrow {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #d4d4d4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rolex-gallery-modal__arrow:hover {
    background-color: #d4d4d4;
}

/* --- Desktop uniquement (breakpoints projet : desktop >= 1025px) --- */
@media (max-width: 1024.98px) {
    .rolex-gallery__row,
    .rolex-gallery-modal {
        display: none !important;
    }
}

/* --- Masque la gallerie sur les appareils tactiles - tablet - mobile --- */
@media (max-width: 1024.98px), (hover: none), (pointer: coarse) {
    .rolex-gallery__row,
    .rolex-gallery-modal { display: none !important; }
}

/* ============================================================ */
/* Carrousel mobile galerie Rolex                                 */
/* À AJOUTER À LA SUITE de assets/css/rolex-gallery-carousel.css  */
/* (pas de nouveau fichier : enqueue-assets.php ne déclare        */
/* qu'un seul handle CSS "rolex-gallery-carousel" pour cette      */
/* galerie — un fichier séparé ne serait jamais chargé).          */
/* ============================================================ */

.rolex-gallery-mobile {
    width: 100%;
}

.rolex-gallery-swiper {
    width: 100%;
    padding-bottom: 2rem; /* place pour la pagination */
}

.rolex-gallery-mobile__item {
    width: 100%;
}

.rolex-gallery__picture {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #F9F7F5;
}

/* ------------------------------------------------------------
   FIX : visuel principal rogne en mobile (retour officiel Rolex
   Geneve du 31/08/2026, revue "Model page" - "The main visual
   asset is cropped in mobile layout. Please ensure visuals are
   never cropped or truncated.").
   Cause : conteneur carre (aspect-ratio: 1/1 sur .rolex-gallery__
   picture ci-dessus) + object-fit: cover sur des photos en
   portrait (ex. 800x1180px verifie en direct sur /watches/day-
   date-40/m228238-0042/) -> le haut et le bas de la montre sont
   rognes pour remplir le carre.
   Correction (suit la recommandation Rolex : "reduce the size of
   the main visual") : object-fit: contain -> la photo entiere
   reste toujours visible, simplement reduite pour tenir dans le
   carre (letterbox gauche/droite sur le fond #F9F7F5 deja defini
   dans .rolex-gallery__picture), plus aucun rognage.
   HBJO-WEB - Abder Kinane
   ------------------------------------------------------------ */
.rolex-gallery__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Pagination : mêmes bullets « pilules » que la modale desktop
   (.rolex-gallery-modal__pagination) — gris au repos, vert Rolex actif. */
.rolex-gallery-swiper .swiper-pagination {
    position: relative;
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.rolex-gallery-swiper .swiper-pagination-bullet {
    width: 28px;
    height: 4px;
    background-color: rgb(212, 212, 212);
    opacity: 1;
    border-radius: 999px;
    margin: 0 !important;
    transition: background-color 0.25s ease, width 0.25s ease;
}

.rolex-gallery-swiper .swiper-pagination-bullet-active {
    width: 40px;
    background-color: #127749;
}