/* --- CSS GLOBAL & STRUCTURE --- */

body.site {
    background-image: url(../images/bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: 50% 0;
}

body {
    background-image: url('../images/bg.jpg') !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-position: center center !important;
}

.container {
    position: relative;
    z-index: 1;
}

/* Force la largeur totale pour le contenu principal */
#sp-main-body, 
#sp-component, 
.container, 
.row {
    max-width: 100% !important; 
    width: 100% !important;
    background: transparent !important;
}

/* Supprime les fonds blancs du template */
.body-innerwrapper, .item-page, .article-details {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* --- HEADER & MENU --- */
#sp-header {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    width: 100% !important;
    z-index: 9999 !important;
}

#sp-header.header-sticky {
    position: sticky;
    top: 0;
    height: auto !important;
    padding: 0 !important;
    z-index: 9999 !important;
}

#sp-header, 
#sp-header .container, 
#sp-header .row {
    height: auto !important;
    min-height: 40px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Uniformise les boutons du menu */
.sp-megamenu-parent > li > a,
.sp-megamenu-parent > li > span,
.sp-megamenu-parent > li.active > a,
.sp-megamenu-parent > li:hover > a {
    background-color: #0345BF !important;
    color: #ffffff !important;
    padding: 5px 15px !important;
    margin: 5px !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    line-height: 20px !important;
    text-decoration: none !important;
}

#sp-logo {
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
}

#sp-menu {
    display: flex;
    align-items: center;
    flex: 1 1 auto !important;
    justify-content: flex-start !important;
}

#sp-header .container > .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
}

ul.sp-menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

ul.sp-menu > li {
    margin: 0 2px !important;
}

/* Déroulement du menu langue sur ordinateur et mobile */
@media (hover: hover) {
    .mod-languages__select.dropdown:hover .dropdown-menu,
    .mod-languages__select.btn-group:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.mod-languages .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    z-index: 9999 !important;
}

/* --- PAGE DÉTAILS GÎTE --- */
.gite-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    font-family: Arial, sans-serif;
}

.gite-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px;
}

.gite-box {
    background: rgba(255, 255, 153, 0.75);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.gite-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    background-color: rgba(241, 235, 175, 0.8);
    padding: 15px;
    border-radius: 10px;
}

.gite-row.reverse {
    flex-direction: row-reverse;
}

.gite-col {
    flex: 1 1 45%;
    font-size: 20px;
}

.gite-col-img {
    flex: 1;
}

.gite-col-text {
    flex: 1.2;
    font-size: 1.1rem;
    line-height: 1.6;
}

.gite-col img, .gite-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.gite-col img.fade-out {
    opacity: 0;
}

.gite-text h3 {
    margin-top: 0;
}

.gite-text ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.gite-text li {
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.gite-text li:last-child {
    border-bottom: none;
}

.gite-text a {
    display: block;
    padding: 12px 15px;
    background-color: rgba(250, 249, 239, 0.6);
    border-radius: 6px;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
}

.gite-text a::after {
    content: "➜";
    position: absolute;
    right: 15px;
    transition: 0.3s;
}

.gite-text a:hover {
    background-color: rgba(255, 223, 0, 0.7);
    transform: translateX(5px);
}

.gite-text a:hover::after {
    right: 10px;
}

/* Logos harmonisés */
.gite-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gite-logos a {
    display: inline-block;
}

.gite-logos img {
    height: 70px;
    width: auto;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.1));
    transition: all 0.35s ease;
}

.gite-logos a:hover img {
    transform: scale(1.3) rotate(5deg);
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
}

/* Boutons d'accès gîte */
.gite-button {
    display: inline-block;
    padding: 12px 20px;
    background-color: #2c5e1a;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    margin: 5px 0;
}

.gite-button:hover {
    background-color: #169179;
    transform: translateY(-2px);
}

.gite-button .gite-name {
    color: white !important;
    text-decoration: none !important;
    display: block;
    margin-bottom: 4px;
}

.gite-button .gite-capacity {
    color: #ffd700 !important;
    font-weight: bold;
    display: block;
}

/* --- CARROUSEL PERSO --- */
.slider-container {
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
    height: 45vh;
    min-height: 250px;
    max-height: 450px;
    overflow: hidden;
    border-radius: 12px;
    border: 4px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.slider-container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider-container img.active {
    opacity: 1;
}

.slider-title {
    position: absolute;
    left: 50%;
    bottom: 10%;
    transform: translateX(-50%);
    padding: 10px 28px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px outset #ffffff;
    color: #ffffff;
    font-family: 'Dancing Script', cursive, sans-serif;
    font-size: 2.2rem;
    text-align: center;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
}

/* --- TARIFS --- */
.tarifs-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background-color: rgba(241, 235, 175, 0.8);
    border-radius: 12px;
}

.section {
    margin: 20px 0;
}

.prices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.price-box {
    flex: 1 1 200px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.footer {
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
}

/* 1. RÈGLE PAR DÉFAUT (Pour ordinateurs & grands écrans) */
.titre-mobile-only {
    display: none !important; /* Masque le titre sur ordinateur */
}

/* 2. OPTIMISATION MOBILE (Uniquement pour écrans <= 768px) */
@media (max-width: 768px) {
    #sp-header { width: 100% !important; }
    
    #sp-diaporama,
    .slider-container,
    #sp-slideshow,
    .n2-section-smartslider {
        display: none !important;
    }

    .titre-mobile-only {
        display: block !important; /* L'affiche uniquement sur mobile */
        padding: 40px 20px;
        text-align: center;
        background: rgba(3, 69, 91, 0.8);
        color: #ffffff;
        margin: 0;
    }

    .titre-mobile-only h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
        color: #FFDF00;
    }

    .gite-col {
        flex: 1 1 100%;
    }

    .gite-row, .gite-row.reverse {
        flex-direction: column !important;
        gap: 15px;
    }

    .gite-box {
        padding: 15px;
    }

    .gite-logos img {
        height: 50px;
    }

    .gite-button {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}
    /* Offcanvas mobile */
    .offcanvas-menu .offcanvas-inner .menu-child {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .offcanvas-menu .menu-toggler {
        display: none !important;
    }

    .offcanvas-menu .menu-child li a {
        padding-left: 25px !important;
    }
}

.offcanvas-menu a,
.offcanvas-menu .menu-child li a {
    font-size: 18px !important;
    line-height: 1.4 !important;
}

.article-featured-video .video-featured,
.article-details .badge.bg-danger,
.badge-featured,
.featured-article-badge,
.article-featured,
.page-header h2 span.icon-featured {
    display: none !important;
}

/* Correctif d'affichage des images lazyload pour Safari */
img.lazyload, img.gite-image {
    min-height: 1px;
    opacity: 1 !important;
    visibility: visible !important;
}

img[data-src] {
    display: block;
}
/* --- STYLE GALERIE & CARTES (piecesdesejour.html) --- */
.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  font-size: 38px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  text-decoration: none;
  margin: 0 auto 25px auto;
  transition: 0.3s;
}

.back-link:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  overflow: hidden;
  padding: 10px;
  flex: 1 1 calc(50% - 20px);
  max-width: calc(50% - 20px);
}

.card:nth-child(3) {
  flex: 1 1 100%;
  max-width: 600px;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.card p {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
/* --- REGLES SPÉCIFIQUES AUX GALERIES (piecesdesejour.html) --- */
.gallery .card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 12px;
    flex: 1 1 calc(45% - 20px);
    max-width: 420px !important; /* Limite la largeur max des cartes */
}

.gallery .card:nth-child(3) {
    flex: 1 1 100%;
    max-width: 500px !important;
}

.gallery .card img {
    width: 100%;
    height: 220px !important;    /* Hauteur fixe et propre pour les images */
    object-fit: cover !important;
    border-radius: 8px;
}
/* --- PASSAGE STRICT EN COLONNE POUR MOBILE & TABLETTE --- */
@media (max-width: 900px) {
    #sp-main-body .gallery {
        display: flex !important;
        flex-direction: column !important; /* Force l'empilement vertical */
        align-items: center !important;
        width: 100% !important;
        gap: 20px !important;
    }

    #sp-main-body .gallery .card,
    #sp-main-body .gallery .card:nth-child(-n+2),
    #sp-main-body .gallery .card:nth-child(3) {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important; /* Annule les largeurs calculées à 48% et 75% */
        box-sizing: border-box !important;
    }
}