/* ==========================================================================
   HomeTripleBlock — variables de thème
   Adapte ces valeurs à la charte de ton thème Splendid (couleurs, rayon, etc.)
   ========================================================================== */
.htb-container {
    --htb-primary: #3d1a52;
    --htb-primary-dark: #2a1138;
    --htb-accent: #ff6f7a;
    --htb-bg-card: #ffffff;
    --htb-text-dark: #241433;
    --htb-cta: #ff3732;
    --htb-cta-dark: #d92c27;
    --htb-placeholder: #e4e4e8;
    --htb-radius-sm: 5px;
    --htb-gap: 16px;

    /* La typo suit celle du thème (aucune police custom chargée par le module) */
    font-family: inherit;
}

.htb-container,
.htb-container * {
    font-family: inherit;
}

/* ==========================================================================
   Layout général : grille 2/3 (bloc héro) + 1/3 (2 blocs empilés)
   ========================================================================== */
.htb-container {
    max-width: 100%;
    margin: 30px 0;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--htb-gap);
    box-sizing: border-box;
}

.htb-container * {
    box-sizing: border-box;
}

.htb-block {
    position: relative;
    border-radius: var(--htb-radius-sm);
    overflow: hidden;
    background-color: var(--htb-placeholder);
    background-size: cover;
    background-position: center;
    min-height: 180px;
    display: flex;
    transition: transform .35s ease, box-shadow .35s ease;
}

.htb-block:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

/* ---- Bloc 1 : héro, occupe les 2 lignes de la colonne de gauche ---- */
.htb-block-1 {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 560px;
    display: block; /* l'image et la carte gèrent chacune leur propre mise en page */
    padding: 0;
}

/* Zone visuelle : occupe tout le bloc en desktop (l'image sert de fond plein cadre) */
.htb-hero-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    background-size: cover;
    background-position: center;
    background-color: var(--htb-placeholder);
    padding: 40px 40px 100px 40px;
}

.htb-hero-top {
    color: #fff;
    max-width: 70%;
}

.htb-hero-subtitle {
    display: block;
    font-size: 16px;
    font-weight: 400;
    opacity: .9;
    margin-bottom: 6px;
}

.htb-hero-title {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 600;
    margin: 0;
    letter-spacing: .5px;
}

/* Étiquette prix flottante (haut à droite du bloc héro) */
.htb-price-tag {
    position: absolute;
    top: 40%;
    right: 40px;
    background: var(--htb-primary-dark);
    color: #fff;
    padding: 14px 26px;
    border-radius: 60px 60px 60px 0;
    text-align: center;
    line-height: 1.1;
}

.htb-price-old {
    display: block;
    font-size: 14px;
    text-decoration: line-through;
    opacity: .7;
}

.htb-price-new {
    display: block;
    font-size: 26px;
    font-weight: 800;
}

/* Carte blanche flottante en bas à gauche du bloc héro */
.htb-card-floating {
    position: absolute;
    left: 32px;
    bottom: 32px;
    background: var(--htb-bg-card);
    border-radius: var(--htb-radius-sm);
    padding: 18px 22px;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.htb-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--htb-text-dark);
    margin: 0 0 8px 0;
}

.htb-card-text {
    font-size: 13px;
    color: var(--htb-text-dark);
    margin: 0 0 14px 0;
}

.htb-badge {
    display: inline-block;
    background: var(--htb-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--htb-radius-sm);
    margin-bottom: 10px;
}

.htb-badge-dark {
    background: var(--htb-accent);
}

.htb-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Blocs 2 & 3 : blocs secondaires empilés à droite ---- */
.htb-block-2 {
    grid-column: 2;
    grid-row: 1;
}

.htb-block-3 {
    grid-column: 2;
    grid-row: 2;
}

.htb-block-2,
.htb-block-3 {
    background-color: var(--htb-placeholder); /* couleur de secours si pas d'image */
    padding: 0;
    display: block;
}

/* Carte de texte superposée sur l'image, ancrée en bas à gauche du bloc (cohérent avec le bloc héro) */
.htb-side-card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--htb-bg-card);
    border-radius: var(--htb-radius-sm);
    padding: 14px 16px;
    max-width: 220px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .15);
}

.htb-side-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--htb-text-dark);
}

.htb-side-text {
    font-size: 12px;
    margin: 0 0 10px 0;
    color: var(--htb-text-dark);
    opacity: .85;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.htb-btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: var(--htb-radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.htb-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.htb-btn-primary {
    background: var(--htb-cta);
    color: #fff;
}

.htb-btn-primary:hover {
    background: var(--htb-cta-dark);
    color: #fff;
}

.htb-btn-secondary {
    background: transparent;
    color: var(--htb-cta);
    border: 2px solid var(--htb-cta);
}

.htb-btn-secondary:hover {
    background: var(--htb-cta);
    color: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .htb-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 0 24px;
    }

    .htb-block-1,
    .htb-block-2,
    .htb-block-3 {
        grid-column: 1;
        grid-row: auto;
    }

    .htb-block-1 {
        min-height: 460px;
    }

    .htb-hero-image {
        padding: 28px 28px 90px 28px;
    }

    .htb-hero-top {
        max-width: 85%;
    }

    .htb-price-tag {
        right: 24px;
    }
}

/* --------------------------------------------------------------------
   En dessous de 767px : l'image et la carte deviennent deux blocs
   empilés indépendants (fini le chevauchement/positionnement flottant,
   trop fragile sur petit écran).
   -------------------------------------------------------------------- */
@media (max-width: 767px) {
    .htb-container {
        padding: 0 16px;
    }

    .htb-block-2,
    .htb-block-3 {
        min-height: 220px;
    }

    .htb-side-card {
        left: 14px;
        bottom: 14px;
        max-width: calc(100% - 28px);
        padding: 12px 14px;
    }

    .htb-block-1 {
        min-height: 0;
    }

    /* L'image redevient un bloc normal avec sa propre hauteur, non recouvert */
    .htb-hero-image {
        position: relative;
        inset: auto;
        min-height: 260px;
        padding: 24px 24px 20px 24px;
        border-radius: var(--htb-radius-sm) var(--htb-radius-sm) 0 0;
        flex-direction: column; /* titre puis prix l'un sous l'autre, jamais côte à côte */
        align-items: flex-start;
    }

    .htb-hero-top {
        max-width: 100%;
        padding: 0;
    }

    /* Le prix suit le flux au lieu de flotter en absolu */
    .htb-price-tag {
        position: static;
        display: inline-block;
        align-self: flex-start;
        margin-top: 14px;
        right: auto;
        top: auto;
    }

    /* La carte n'est plus en position absolue : elle s'affiche à plat,
       collée sous l'image, pleine largeur, sans chevaucher le texte. */
    .htb-card-floating {
        position: static;
        width: 100%;
        max-width: none;
        margin: 0;
        left: auto;
        bottom: auto;
        border-radius: 0 0 var(--htb-radius-sm) var(--htb-radius-sm);
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .htb-hero-title {
        font-size: 26px;
    }

    .htb-card-floating {
        padding: 18px 20px;
    }
}

/* Respect du mode "réduction des animations" */
@media (prefers-reduced-motion: reduce) {
    .htb-block,
    .htb-btn {
        transition: none;
    }
}
