/* ============================================================
   SERVICE DÉTAIL – Adé Education
   ============================================================ */

:root {
    --sd-bg:         #f0f6f8;
    --sd-navy:       #1a2e4a;
    --sd-teal:       #4ecdc4;
    --sd-teal-light: rgba(166, 219, 215, 0.40);
    --sd-text:       #3a4a5a;
    --sd-bubble:     rgba(78, 205, 196, 0.12);
    --sd-bubble-2:   rgba(26, 46, 74, 0.07);
    --sd-radius:     18px;
    --sd-transition: 0.25s ease;
}

/* ============================================================
   STRUCTURE
   ============================================================ */
.service-detail {
    position: relative;
    padding: 4rem 0 6rem;
    overflow: hidden;
}

.service-detail::before,
.service-detail::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.service-detail::before {
    width: 360px; height: 360px;
    background: var(--sd-bubble);
    top: -80px; right: -80px;
}
.service-detail::after {
    width: 220px; height: 220px;
    background: var(--sd-bubble-2);
    bottom: 100px; left: -60px;
}

.service-detail__container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;          /* padding latéral suffisant sur mobile */
    display: flex;
    flex-direction: column;
    gap: 3rem;
    box-sizing: border-box;
    width: 100%;
}

/* ============================================================
   EN-TÊTE
   ============================================================ */
.sd-header {
    text-align: center;
}

.sd-header__title {
    font-family: 'Kidmania', 'Nunito', sans-serif;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    font-weight: 700;
    color: var(--sd-navy);
    margin-bottom: 0.6rem;
    line-height: 1.2;
    word-break: break-word;     /* évite le débordement sur mobile */
}

.sd-header__subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.88rem, 2.5vw, 1rem);
    color: var(--sd-text);
    max-width: 640px;
    margin: 0 auto 1.5rem;
    line-height: 1.65;
}

/* ============================================================
   TARIFS & FRAIS DE DÉPLACEMENT
   ============================================================ */
.sd-tarifs {
    text-align: center;
}

.sd-tarifs__title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--sd-navy);
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-bottom: 0.5rem;
}

.sd-tarifs__duree {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--sd-text);
    margin-bottom: 1.2rem;
}

.sd-tarifs__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    max-width: 560px;
    margin: 0 auto 1.5rem auto;
}

.sd-tarifs__grid--single {
    grid-template-columns: 1fr;
    max-width: 280px;
}

.sd-tarif-pill {
    background: var(--sd-teal-light);
    border-radius: 50px;
    padding: 0.65rem 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--sd-navy);
    text-align: center;
}

.sd-tarif-pill strong { font-weight: 700; }

/* Conteneur principal des frais (alignement en ligne) */
.sd-tarifs__frais {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.sd-frais__title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sd-navy);
}

.sd-frais-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sd-frais-pill {
    background: #ffffff;
    border: 1.5px solid var(--sd-teal);
    border-radius: 50px;
    padding: 0.35rem 0.85rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sd-navy);
    box-shadow: 0 2px 6px rgba(26, 46, 74, 0.05);
}

/* ============================================================
   BLOC PHOTO + TEXTE
   Desktop : 2 colonnes | Mobile : 1 colonne
   ============================================================ */
.sd-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;         /* start évite l'étirement vertical */
}

/* Image à droite sur desktop */
.sd-block--img-right .sd-block__img { order: 1; }

.sd-block__img {
    display: flex;
    justify-content: center;
}

.sd-block__photo {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 4 / 3;       /* 4/3 plus adapté aux photos portrait/paysage */
    object-fit: cover;
    border-radius: var(--sd-radius);
    box-shadow: 0 8px 32px rgba(26, 46, 74, 0.12);
}

.sd-block__text {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;               /* crucial pour éviter le débordement en grid */
}

.sd-block__title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 800;
    color: var(--sd-teal);
    line-height: 1.3;
    word-break: break-word;     /* clé : empêche le "?" de tomber à la ligne */
    overflow-wrap: break-word;
    hyphens: auto;
}

.sd-block__text p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--sd-text);
    text-align: center;
    min-width: 0;
}

.sd-block__list {
    list-style: disc;
    padding-left: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sd-block__list li {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--sd-text);
    line-height: 1.5;
}

/* ============================================================
   DÉROULEMENT
   ============================================================ */
.sd-deroulement {
    text-align: center;
}

.sd-deroulement__title {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 800;
    color: var(--sd-navy);
    margin-bottom: 0.75rem;
}

.sd-deroulement__intro {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--sd-text);
    max-width: 680px;
    margin: 0 auto 2rem;
}

/* ---- Cartes étapes ---- */
.sd-etapes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.sd-etape {
    background: var(--sd-teal-light);
    border-radius: var(--sd-radius);
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.sd-etape svg {
    width: 28px; height: 28px;
    stroke: var(--sd-navy);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.sd-etape__name {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sd-navy);
}

.sd-etape__desc {
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    color: var(--sd-text);
    line-height: 1.5;
}

.sd-deroulement__note {
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-style: italic;
    color: var(--sd-text);
    margin-top: 1.5rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   BOUTON RETOUR
   ============================================================ */
.sd-back {
    display: flex;
    justify-content: center;
}

.sd-back__btn {
    display: inline-block;
    padding: 0.65rem 1.8rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: var(--sd-navy);
    border-radius: 50px;
    text-decoration: none;
    transition: background var(--sd-transition), transform var(--sd-transition);
}

.sd-back__btn:hover,
.sd-back__btn:focus-visible {
    background: var(--sd-teal);
    color: var(--sd-navy);
    transform: translateX(-3px);
    outline: none;
}

/* ============================================================
   RESPONSIVE — TABLETTE (max 768px)
   ============================================================ */
@media (max-width: 768px) {

    .service-detail {
        padding: 2.5rem 0 4rem;
    }

    .service-detail__container {
        gap: 2rem;
        padding: 0 1.2rem;
    }

    /* Bloc photo+texte → colonne unique */
    .sd-block {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Sur mobile l'image passe toujours en premier */
    .sd-block--img-right .sd-block__img { order: 0; }

    .sd-block__photo {
        aspect-ratio: 16 / 9;
        max-width: 100%;
    }

    /* Texte aligné à gauche sur mobile pour meilleure lisibilité */
    .sd-block__text p {
        text-align: left;
    }

    /* Tarifs en colonne sur très petit écran */
    .sd-tarifs__grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    /* Étapes en 2 colonnes max sur mobile */
    .sd-etapes {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {

    .service-detail__container {
        padding: 0 1rem;
    }

    .sd-block__title {
        font-size: 1rem;
    }

    /* 1 seule colonne pour les étapes sur très petit écran */
    .sd-etapes {
        grid-template-columns: 1fr;
    }

    .sd-back__btn {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sd-back__btn { transition: none; }
}