/* ============================================================
   TERRA SERVICES CAROUSEL - CSS v4.0.0
   Design : carte centrale grande, latérales petites (pas floues)
   ============================================================ */

:root {
    --terra-primary:       #0066CC;
    --terra-primary-light: #0099CC;
    --terra-active-border: #E8A020;   /* bordure dorée carte active */
    --terra-white:         #ffffff;
    --terra-shadow-md:     0 8px 30px rgba(0,0,0,0.10);
    --terra-shadow-lg:     0 20px 50px rgba(0,0,0,0.22);
    --terra-radius-card:   22px;
    --terra-radius-img:    18px;
    --dot-color:           rgba(255,255,255,0.35);
    --dot-active-color:    #E8A020;
}

/* ── Outer wrapper : context de positionnement des flèches ── */
.terra-sc-outer {
    position: relative;
    width: 100%;
}

/* ── Wrapper global ── */
.terra-carousel-wrapper {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    padding: 40px 0;
    overflow: hidden;
}

.terra-carousel-wrapper.terra-bg-dark {
    background: linear-gradient(135deg, #0a1628 0%, #0d1b2a 50%, #112240 100%);
}
.terra-carousel-wrapper.terra-bg-light       { background: #f0f4f8; }
.terra-carousel-wrapper.terra-bg-transparent { background: transparent; }

/* ── Track (overflow visible pour voir les cartes latérales) ── */
.terra-carousel {
    display: flex;
    align-items: flex-end;      /* Aligne les cartes par le bas → hauteur homogène */
    gap: 16px;
    overflow: visible;          /* NE PAS mettre hidden — les cartes latérales doivent dépasser */
    padding: 40px 0;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    /* scroll désactivé — navigation via JS uniquement */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.terra-carousel::-webkit-scrollbar { display: none; }
.terra-carousel:active { cursor: grabbing; }

/* ── Carte par défaut (latérales) ── */
.terra-service-card {
    min-width: var(--card-width, 260px);
    max-width: var(--card-width, 260px);
    /* Hauteur fixe identique pour TOUTES les cartes — scale(0.88) crée le différentiel visuel */
    height: var(--card-height, 460px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--terra-radius-card);
    padding: 18px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;

    /* Pas de flou — juste réduit + légèrement transparent */
    opacity: 0.68;
    transform: scale(0.88);
    transform-origin: bottom center;
    box-shadow: var(--terra-shadow-md);
    border: 2px solid transparent;

    /* Transition fluide */
    transition:
        opacity    0.45s cubic-bezier(0.4,0,0.2,1),
        transform  0.45s cubic-bezier(0.4,0,0.2,1),
        box-shadow 0.45s cubic-bezier(0.4,0,0.2,1),
        border-color 0.45s ease;
}

/* ── Carte ACTIVE / CENTRALE ── */
.terra-service-card.is-center {
    opacity: 1;
    transform: scale(1);
    transform-origin: bottom center;
    box-shadow: var(--terra-shadow-lg);
    border-color: var(--terra-active-border);
    z-index: 5;
    /* Même hauteur que les latérales — c'est scale(0.88) qui crée le différentiel visuel */
}

/* ── Image latérale ── */
.terra-card-image {
    width: 100%;
    height: 130px;
    border-radius: var(--terra-radius-img);
    overflow: hidden;
    margin-bottom: 14px;
    position: relative;
    background: #e9eef5;
    transition: height 0.45s cubic-bezier(0.4,0,0.2,1);
}

/* ── Image centrale (plus haute) ── */
.terra-service-card.is-center .terra-card-image {
    height: 240px;
}

.terra-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.terra-service-card.is-center:hover .terra-card-image img {
    transform: scale(1.04);
}

/* ── Texte ── */
.terra-card-body-text {
    padding: 6px 4px 0;
    display: flex;
    flex-direction: column;
    flex: 1;          /* occupe l'espace restant après l'image */
}

/* Bouton collé en bas du body */
.terra-card-body-text .terra-card-button {
    margin-top: auto;
}

.terra-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    letter-spacing: 0.3px;
    text-transform: none;
    line-height: 1.3;
}

.terra-card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.55;
    margin: 0 0 16px;
    min-height: 36px;
}

/* ── Bouton ── */
.terra-card-button {
    display: inline-block;
    padding: 9px 22px;
    border: 1.5px solid var(--terra-primary);
    border-radius: 25px;
    color: var(--terra-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.terra-card-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--terra-primary);
    transition: left 0.3s ease;
    z-index: -1;
}
.terra-card-button:hover         { color: #fff; text-decoration: none; }
.terra-card-button:hover::before { left: 0; }

/* ── Flèches — positionnées par rapport à .terra-sc-outer ── */
.terra-arrow {
    position: absolute;
    /* Centre vertical : milieu de .terra-sc-outer.
       On soustrait la moitié de la hauteur du bouton (22px) pour le centrer. */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 44px; height: 44px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 20;
    transition: all 0.25s ease;
    color: var(--terra-primary);
}
.terra-arrow:hover {
    background: var(--terra-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}
.terra-arrow-prev { left: 14px; }
.terra-arrow-next { right: 14px; }

/* ── Points de navigation ── */
.terra-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}
.terra-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--dot-color);
    cursor: pointer;
    transition: all 0.35s ease;
    flex-shrink: 0;
}
.terra-dot:hover  { opacity: 0.75; }
.terra-dot.active {
    width: 28px;
    border-radius: 5px;
    background: var(--dot-active-color);
}

/* ── Animations entrée ── */
@keyframes tcFadeIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 0.68; transform: scale(0.88) translateY(0); }
}
@keyframes tcFadeInActive {
    from { opacity: 0; transform: scale(1) translateY(16px); }
    to   { opacity: 1;  transform: scale(1) translateY(0); }
}
.terra-service-card             { animation: tcFadeIn       0.5s ease both; }
.terra-service-card.is-center   { animation: tcFadeInActive 0.5s ease both; }
.terra-service-card.tc-clone    { animation: none; }

.terra-service-card:nth-child(1) { animation-delay: 0.05s; }
.terra-service-card:nth-child(2) { animation-delay: 0.12s; }
.terra-service-card:nth-child(3) { animation-delay: 0.20s; }
.terra-service-card:nth-child(4) { animation-delay: 0.28s; }
.terra-service-card:nth-child(5) { animation-delay: 0.36s; }
.terra-service-card:nth-child(6) { animation-delay: 0.44s; }

/* ── Responsive ── */

/* Tablette */
@media (max-width: 1024px) {
    .terra-sc-outer { padding: 0 8px; }
    .terra-arrow-prev { left: 6px; }
    .terra-arrow-next { right: 6px; }
    .terra-arrow { width: 38px; height: 38px; }
}

/* Phablet / petite tablette */
@media (max-width: 768px) {
    .terra-service-card {
        min-width: 220px; max-width: 220px;
        height: var(--card-height-mobile, 380px);
    }
    .terra-card-image   { height: 110px; }
    .terra-service-card.is-center .terra-card-image { height: 170px; }
    .terra-arrow        { width: 34px; height: 34px; }
    .terra-carousel     { padding: 24px 0; }
    .terra-carousel-wrapper { padding: 20px 0; }

    /* Textes plus petits */
    .terra-card-title       { font-size: 13px; }
    .terra-card-description { font-size: 11px; margin-bottom: 10px; }
    .terra-card-button      { font-size: 11px; padding: 7px 14px; }
}

/* Mobile */
@media (max-width: 480px) {
    .terra-service-card {
        min-width: 200px; max-width: 200px;
        height: var(--card-height-mobile, 340px);
        padding: 12px;
    }
    .terra-card-image   { height: 90px; }
    .terra-service-card.is-center .terra-card-image { height: 150px; }

    /* Flèches masquées sur mobile — navigation tactile */
    .terra-arrow { display: none; }

    /* Dots plus grands pour faciliter le tap */
    .terra-dot  { width: 9px; height: 9px; }

    /* Padding wrapper réduit */
    .terra-carousel-wrapper { padding: 16px 0 24px; }

    /* Scale plus léger sur mobile pour voir plus de cartes */
    .terra-service-card:not(.is-center) {
        transform: scale(0.82);
        opacity: 0.60;
    }
}

/* ── Accessibilité ── */
.terra-dot:focus, .terra-card-button:focus, .terra-arrow:focus {
    outline: 3px solid var(--terra-primary);
    outline-offset: 2px;
}

/* ============================================================
   FILTRE PAR CATÉGORIE
   ============================================================ */
.tsc-filter-wrapper { width: 100%; }

.tsc-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 20px 24px;
}

.tsc-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border: 1.5px solid #ccc;
    border-radius: 25px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
}
.tsc-filter-btn:hover  { border-color: #0066CC; color: #0066CC; background: rgba(0,102,204,0.06); }
.tsc-filter-btn.active { background: #0066CC; border-color: #0066CC; color: #fff; box-shadow: 0 4px 14px rgba(0,102,204,0.28); }

@media (max-width: 768px) {
    .tsc-filter-wrap { gap: 7px; padding: 0 10px 18px; }
    .tsc-filter-btn  { padding: 7px 16px; font-size: 13px; }
}
@media (max-width: 480px) {
    .tsc-filter-wrap { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 12px; }
    .tsc-filter-wrap::-webkit-scrollbar { display: none; }
}

/* ============================================================
   TERRA HORIZONTAL CARD CAROUSEL
   ============================================================ */
.thc-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 40px 60px;
    background: linear-gradient(135deg, #1a7fd4 0%, #1560a8 100%);
    overflow: hidden;
}
.thc-viewport { overflow: hidden; width: 100%; position: relative; }
.thc-track    { display: flex; will-change: transform; transition: transform 0.45s cubic-bezier(0.4,0,0.2,1); }
.thc-card {
    display: flex; align-items: center; gap: 20px;
    background: #fff; border-radius: 16px; padding: 24px 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    min-width: 100%; width: 100%; box-sizing: border-box; flex-shrink: 0;
}
.thc-icon-wrap {
    width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thc-icon-wrap img { width:100%; height:100%; object-fit:cover; }
.thc-icon-wrap svg { width:28px; height:28px; }
.thc-content { flex: 1; min-width: 0; }
.thc-header  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.thc-title {
    font-size: 17px; font-weight: 700; color: #1a1a2e;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-decoration: none;
}
.thc-title:hover { color: #0066CC; }
.thc-badge {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px; border: 1.5px solid;
    white-space: nowrap;
}
.thc-desc { font-size: 13px; color: #666; line-height: 1.5; margin: 0; }
.thc-desc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thc-meta-chip {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: #666; background: #f5f6f8;
    padding: 3px 10px; border-radius: 20px;
}
.thc-meta-chip.thc-expired { color:#E74C3C; background:#fff0f0; }
.thc-btn {
    display: inline-block; padding: 12px 26px; border-radius: 10px;
    color: #fff; text-decoration: none; font-size: 14px; font-weight: 700;
    white-space: nowrap; flex-shrink: 0;
    transition: filter 0.25s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.thc-btn:hover { filter:brightness(1.1); transform:translateY(-2px); text-decoration:none; color:#fff; }
.thc-btn-closed {
    display:inline-block; padding:10px 18px; background:#eee;
    color:#999; border-radius:10px; font-size:13px; font-weight:600; white-space:nowrap; flex-shrink:0;
}
.thc-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: transparent; border: 2px solid rgba(255,255,255,0.8);
    border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #fff; z-index: 10;
    transition: all 0.25s ease;
}
.thc-arrow:hover { background: rgba(255,255,255,0.2); }
.thc-prev { left: 14px; } .thc-next { right: 14px; }
.thc-dots { display:flex; justify-content:center; align-items:center; gap:10px; margin-top:20px; }
.thc-dot {
    width:8px; height:8px; border-radius:50%;
    background: rgba(255,255,255,0.4); cursor:pointer; transition:all 0.3s ease;
}
.thc-dot.active { width:26px; border-radius:4px; background:#fff; }
.thc-dot:hover  { background: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
    .thc-wrapper { padding: 30px 50px; }
    .thc-card    { flex-wrap: wrap; gap: 14px; padding: 18px; }
    .thc-title   { font-size: 15px; white-space: normal; }
    .thc-btn     { width: 100%; text-align: center; margin-top: 4px; }
    .thc-arrow   { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
    .thc-wrapper   { padding: 24px 44px; }
    .thc-icon-wrap { width: 44px; height: 44px; }
}

/* ── Accessibilité ── */
.thc-dot:focus, .thc-btn:focus, .thc-arrow:focus {
    outline: 3px solid rgba(255,255,255,0.8); outline-offset: 2px;
}


/* ============================================================
   TERRA STEPS CARD WIDGET — v1.6.0
   Grid desktop → Carousel swipeable mobile
   ============================================================ */

.tsc-steps-wrapper {
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #0a1628 0%, #0d1b2a 100%);
    padding: 60px 40px;
    overflow: hidden;
}

/* ── Grid track ── */
.tsc-steps-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
}

/* ── Card ── */
.tsc-step-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 28px 24px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    /* Subtile bordure intérieure */
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tsc-step-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 16px 40px rgba(0,0,0,0.5);
}

/* ── Header : label + numéro ── */
.tsc-step-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 8px;
}

.tsc-step-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    line-height: 1.2;
    padding-top: 4px;
}

.tsc-step-number {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

/* ── Titre ── */
.tsc-step-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin: 0 0 14px 0;
    padding: 0;
}

/* ── Description ── */
.tsc-step-desc {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.72);
    margin: 0;
    flex-grow: 1;
}

/* ── Flèche de connexion ── */
.tsc-step-arrow-abs svg {
    width: 36px;
    height: 36px;
    color: rgba(255,255,255,0.3);
    display: block;
}

/* ── Dots carousel ── */
.tsc-steps-dots {
    display: none; /* visible uniquement @media mobile via le <style> inline widget */
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.tsc-steps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.tsc-steps-dot.active {
    background: #ffffff;
    transform: scale(1.25);
}

/* ── Responsive tablette / mobile par défaut ── */
@media (max-width: 767px) {
    .tsc-steps-wrapper {
        padding: 36px 20px;
    }
    .tsc-step-number { font-size: 28px; }
    .tsc-step-title  { font-size: 16px; }
    .tsc-step-desc   { font-size: 12px; }
    .tsc-steps-dots  { display: flex; }
}
