/* ============================================================
   TERRA SERVICES CAROUSEL - CSS PRO v2.0.0
   © TERRAbiga - https://terrabiga.com
   ============================================================ */

:root {
    --terra-primary:       #0066CC;
    --terra-primary-light: #0099CC;
    --terra-white:         #ffffff;
    --terra-shadow-md:     0 8px 30px rgba(0,0,0,0.12);
    --terra-shadow-lg:     0 24px 60px rgba(0,0,0,0.28);
    --terra-radius-card:   20px;
    --terra-radius-img:    15px;
    --terra-transition:    0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --dot-color:           rgba(255,255,255,0.3);
    --dot-active-color:    #0066CC;
}

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

.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 ---- */
.terra-carousel {
    display: flex;
    align-items: center;          /* centrage vertical */
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;          /* laisser les cartes dépasser verticalement */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 40px 30px;           /* espace vertical pour que la grande carte ne soit pas coupée */
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.terra-carousel:active { cursor: grabbing; }

.terra-carousel::-webkit-scrollbar { display: none; }
.terra-carousel { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Card par défaut (latérales) ---- */
.terra-service-card {
    min-width: var(--card-width, 260px);
    max-width: var(--card-width, 260px);
    background: #ffffff;
    border-radius: var(--terra-radius-card);
    padding: 18px;
    text-align: center;
    flex-shrink: 0;
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;

    /* État "réduit" par défaut */
    opacity: 0.55;
    transform: scale(0.88);
    box-shadow: var(--terra-shadow-md);
    transition:
        opacity    var(--terra-transition),
        transform  var(--terra-transition),
        box-shadow var(--terra-transition);
}

/* Barre bleue en haut - cachée par défaut */
.terra-service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--terra-primary), var(--terra-primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 2;
    border-radius: 0;
}

/* ---- Card ACTIVE (centrale) ---- */
.terra-service-card.is-center {
    opacity: 1;
    transform: scale(1);
    box-shadow: var(--terra-shadow-lg);
    z-index: 5;
}

.terra-service-card.is-center::before {
    transform: scaleX(1);
}

/* Image latérale : petite */
.terra-card-image {
    width: 100%;
    height: 120px;
    border-radius: var(--terra-radius-img);
    overflow: hidden;
    margin-bottom: 14px;
    position: relative;
    background: #e9eef5;
    transition: height var(--terra-transition);
}

/* Image centrale : grande */
.terra-service-card.is-center .terra-card-image {
    height: 210px;
}

.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.06);
}

/* ---- Zone texte (titre + description + bouton) ---- */
.terra-card-body-text {
    padding: 16px 16px 0;
}

.terra-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    padding: 0 4px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.3;
}

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

.terra-service-card .terra-card-button {
    margin: 0 0 4px;
}

/* ---- Bouton ---- */
.terra-card-button {
    display: inline-block;
    padding: 9px 22px;
    border: 2px 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 ---- */
.terra-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 42px; height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--terra-shadow-md);
    z-index: 10;
    transition: all 0.3s ease;
    color: var(--terra-primary);
}
.terra-arrow:hover {
    background: var(--terra-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}
.terra-arrow-prev { left: 12px; }
.terra-arrow-next { right: 12px; }

/* ---- Dots ---- */
.terra-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.terra-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--dot-color, rgba(255,255,255,0.3));
    cursor: pointer;
    transition: all 0.35s ease;
    flex-shrink: 0;
}

.terra-dot:hover  { opacity: 0.8; }
.terra-dot.active { width: 28px; border-radius: 5px; background: var(--dot-active-color, #0066CC); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .terra-service-card         { min-width: 220px; max-width: 220px; }
    .terra-card-image           { height: 100px; }
    .terra-service-card.is-center .terra-card-image { height: 170px; }
    .terra-carousel             { padding: 30px 16px; gap: 12px; }
    .terra-arrow                { display: none; }
}

@media (max-width: 480px) {
    .terra-service-card { min-width: 200px; max-width: 200px; }
}

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


/* ============================================================
   TERRA SERVICES GRID - CSS v1.0.0
   ============================================================ */

/* ---- Wrapper ---- */
.terra-grid-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* ---- Grille ---- */
.terra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---- Card base ---- */
.tg-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
}

/* Barre accent en haut */
.tg-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #0066CC;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.38s ease;
    z-index: 3;
}

/* ---- Effets hover ---- */
.tg-card.effect-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(0,0,0,0.16);
}

.tg-card.effect-lift:hover::before,
.tg-card.effect-border:hover::before,
.tg-card.effect-zoom:hover::before {
    transform: scaleX(1);
}

.tg-card.effect-border {
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tg-card.effect-border:hover {
    border-color: #0066CC;
    box-shadow: 0 0 0 4px rgba(0,102,204,0.08);
}

/* ---- Badge ---- */
.tg-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #0066CC;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 4;
    line-height: 1;
}

/* ================================================================
   STYLE : VERTICAL (image en haut)
================================================================ */
.tg-card.style-vertical .tg-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    background: #e9eef5;
}

.tg-card.style-vertical .tg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.tg-card.style-vertical.effect-zoom:hover .tg-card-image img,
.tg-card.style-vertical.effect-lift:hover .tg-card-image img {
    transform: scale(1.06);
}

/* ================================================================
   STYLE : HORIZONTAL (image à gauche)
================================================================ */
.tg-card.style-horizontal {
    flex-direction: row;
    align-items: stretch;
}

.tg-card.style-horizontal .tg-card-image {
    width: 140px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 16px 0 0 16px;
    background: #e9eef5;
}

.tg-card.style-horizontal .tg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.tg-card.style-horizontal.effect-zoom:hover .tg-card-image img {
    transform: scale(1.08);
}

.tg-card.style-horizontal .tg-card-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ================================================================
   STYLE : OVERLAY (image de fond + texte par-dessus)
================================================================ */
.tg-card.style-overlay {
    min-height: 240px;
}

.tg-card.style-overlay .tg-card-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    border-radius: 16px;
    transition: transform 0.5s ease;
}

.tg-card.style-overlay.effect-zoom:hover .tg-card-image {
    transform: scale(1.04);
}

.tg-card.style-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.72) 100%);
    z-index: 1;
    border-radius: 16px;
}

.tg-card.style-overlay .tg-card-body {
    position: relative;
    z-index: 2;
    padding: 24px 20px 20px;
    margin-top: auto;
}

.tg-card.style-overlay .tg-card-title,
.tg-card.style-overlay .tg-card-desc {
    color: #fff !important;
}

.tg-card.style-overlay .tg-btn {
    border-color: rgba(255,255,255,0.8);
    color: #fff;
}

.tg-card.style-overlay .tg-btn:hover {
    background: #fff;
    color: #0066CC;
}

/* ================================================================
   STYLE : MINIMAL (sans image)
================================================================ */
.tg-card.style-minimal {
    padding: 28px 24px;
}

.tg-card.style-minimal .tg-card-body {
    padding: 0;
}

.tg-card.style-minimal .tg-card-icon {
    font-size: 36px;
    color: #0066CC;
    margin-bottom: 14px;
}

.tg-card.style-minimal .tg-card-icon svg,
.tg-card.style-minimal .tg-card-icon i {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

/* ================================================================
   CARD BODY (commun)
================================================================ */
.tg-card-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tg-card-icon {
    font-size: 28px;
    color: #0066CC;
    margin-bottom: 12px;
    line-height: 1;
}

.tg-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    line-height: 1.3;
}

.tg-card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 18px;
    flex: 1;
}

/* ---- Bouton ---- */
.tg-btn {
    display: inline-block;
    padding: 9px 22px;
    border: 2px solid #0066CC;
    border-radius: 25px;
    color: #0066CC;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    align-self: flex-start;
    letter-spacing: 0.3px;
}

.tg-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: #0066CC;
    transition: left 0.3s ease;
    z-index: -1;
}

.tg-btn:hover             { color: #fff; text-decoration: none; }
.tg-btn:hover::before     { left: 0; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .terra-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .terra-grid { grid-template-columns: 1fr; }
    .tg-card.style-horizontal { flex-direction: column; }
    .tg-card.style-horizontal .tg-card-image {
        width: 100%;
        height: 160px;
        border-radius: 16px 16px 0 0;
    }
}


/* ============================================================
   TERRA HORIZONTAL CARD CAROUSEL - CSS v1.0.0
   ============================================================ */

/* ── Wrapper ── */
.thc-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 40px 60px;
    background: linear-gradient(135deg, #1a7fd4 0%, #1560a8 100%);
    overflow: hidden;
}

/* ── Viewport : fenêtre qui masque les cartes hors vue ── */
.thc-viewport {
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* ── Track : bande glissante — largeur calculée en JS (N × vpW px) ── */
.thc-track {
    display: flex;
    will-change: transform;
    flex-shrink: 0;
    /* NE PAS mettre width:100% ici — le JS gère les px */
}

/* ── Carte : largeur calculée en JS (= vpW px) ── */
.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);
    box-sizing: border-box;
    flex-shrink: 0;
    /* min-width et width gérés en JS */
}

/* ── Icône ── */
.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;
}

/* ── Contenu ── */
.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;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thc-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1.5px solid currentColor;
    line-height: 1.4;
    white-space: nowrap;
}

.thc-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bouton ── */
.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;
}

/* ── Flèches ── */
.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; }

/* ── Dots ── */
.thc-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    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;
    flex-shrink: 0;
}

.thc-dot.active {
    width: 26px;
    border-radius: 4px;
    background: #fff;
}

.thc-dot:hover { background: rgba(255,255,255,0.7); }

/* ── Responsive TABLETTE (≤ 1024px) ── */
@media (max-width: 1024px) {
    .thc-wrapper {
        padding: 36px 56px;
    }
    .thc-card {
        gap: 16px;
        padding: 22px 24px;
    }
    .thc-title { font-size: 16px; }
    .thc-btn   { padding: 11px 22px; }
}

/* ── Responsive MOBILE (≤ 768px) ── */
/* Layout vertical : icône centrée en haut, texte centré, bouton pleine largeur */
@media (max-width: 768px) {
    .thc-wrapper {
        padding: 30px 48px;
    }

    .thc-card {
        flex-direction: column;   /* empilement vertical */
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 30px 24px 26px;
    }

    .thc-icon-wrap {
        width: 60px;
        height: 60px;
        border-radius: 16px;
        margin: 0 auto;
    }

    .thc-content {
        width: 100%;
    }

    .thc-header {
        justify-content: center;  /* titre + badge centrés */
        gap: 8px;
        margin-bottom: 10px;
    }

    .thc-title {
        font-size: 20px;
        font-weight: 800;
        white-space: normal;
        text-align: center;
    }

    .thc-badge {
        font-size: 12px;
        padding: 4px 12px;
    }

    .thc-desc {
        font-size: 14px;
        white-space: normal;
        text-align: center;
        line-height: 1.6;
        color: #777;
    }

    .thc-btn {
        display: block;
        width: 70%;
        margin: 4px auto 0;
        text-align: center;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* Flèches plus visibles sur mobile */
    .thc-arrow {
        width: 36px;
        height: 36px;
        background: rgba(255,255,255,0.15);
    }
    .thc-prev { left: 8px; }
    .thc-next { right: 8px; }
}

/* ── Responsive PETIT MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
    .thc-wrapper {
        padding: 26px 44px;
    }

    .thc-icon-wrap {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .thc-title { font-size: 18px; }
    .thc-desc  { font-size: 13px; }

    .thc-btn {
        width: 85%;
        font-size: 14px;
        padding: 13px 16px;
    }

    .thc-arrow {
        width: 32px;
        height: 32px;
    }
    .thc-prev { left: 6px; }
    .thc-next { right: 6px; }

    .thc-dots { margin-top: 16px; gap: 7px; }
    .thc-dot  { width: 7px; height: 7px; }
    .thc-dot.active { width: 22px; }
}
