/* ============================================================
   cards.css — Composant carte hébergement (.heb-card)
   Partagé par : home (section hébergements + bons plans liés),
   reservation étape 1 (catalogue + résultats datés)
   Importer APRÈS base.css, AVANT les styles propres à chaque page.
   ============================================================ */

/* ── Grille ────────────────────────────────────────────────── */

.heb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5px;
    background: var(--color-sand-dark);
    margin-bottom: 2.5rem;
}

/* Variante listing (catalogue reservation) — colonnes adaptatives,
   pas de fond visible entre les cartes (bordure portée par la carte elle-même) */
.heb-grid--listing {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    background: transparent;
    align-items: stretch;
}

.heb-grid--listing .heb-card {
    border: 0.5px solid var(--color-sand-dark);
    max-width: 420px;
    justify-self: center;
    width: 100%;
}

.heb-empty {
    grid-column: span 3;
    text-align: center;
    color: var(--color-muted);
    padding: 3rem;
}

/* ── Carte ─────────────────────────────────────────────────── */

.heb-card {
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.heb-card[data-product-id] {
    cursor: pointer;
}

.heb-card.is-selected {
    outline: 2px solid var(--color-terracotta);
}

.heb-card.just-added {
    outline: 2px solid var(--color-terracotta);
    transition: outline var(--transition-fast);
}

.heb-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.heb-card__img {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: var(--color-sand-dark);
}

.heb-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.heb-card__link:hover .heb-card__img img {
    transform: scale(1.04);
}

/* Badge — pilule blanche, style unique (coup de cœur comme promo),
   utilisé partout (home et tunnel), pas seulement le tunnel */
.heb-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    background: #fff;
    color: var(--color-forest);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    padding: 6px 14px;
}

/* "Promo" — orange vif volontairement hors palette du site, pour accrocher
   l'œil comme un vrai badge promotionnel. Toujours à droite (le badge
   principal ci-dessus reste à gauche). */
.heb-card__badge--promo {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 50%;
    background: #ff6a1a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 106, 26, 0.5);
}

.heb-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.heb-card__type {
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.heb-card__name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-forest);
    margin-bottom: 6px;
}

/* Description tronquée à 2 lignes : sans ça, une carte à 3 lignes de texte
   décale son footer par rapport aux cartes voisines à 2 lignes sur la même
   rangée (cf. .heb-card__body en flex column + flex:1 ci-dessus, qui permet
   au footer de se pousser en bas via margin-top:auto). */
.heb-card__desc {
    font-size: var(--text-sm);
    color: var(--color-muted);
    line-height: 1.65;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em; /* garde-fou si line-clamp indisponible */
}

/* Mention "Ménage inclus" — met en valeur ce qui est déjà compris dans le
   prix affiché, plutôt que de le laisser apparaître comme un supplément
   découvert seulement dans le panneau détail. */
.heb-card__included {
    font-size: var(--text-xs);
    color: var(--color-forest);
    margin-top: 4px;
    margin-bottom: 0;
    font-weight: 500;
}

.heb-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 0.75rem;
    border-top: 0.5px solid var(--color-sand-dark);
}

/* Variante pour les footers sortis du lien principal (deux ancres frères,
   ex: catalogue tunnel avec bouton "Réserver" distinct de la navigation
   fiche produit) — n'hérite plus du padding de .heb-card__body, donc porte
   son propre padding complet. */
.heb-card__footer--standalone {
    padding: 0.75rem 1.5rem 1.5rem;
}

.heb-card__price {
    font-size: var(--text-base);
    color: var(--color-forest);
}

.heb-card__price span {
    font-size: var(--text-xs);
    color: var(--color-muted);
}

/* "À partir de" — au-dessus du prix plutôt qu'accolé, pour éviter que
   "/ nuit" ne se retrouve isolé sur sa propre ligne à l'étroit. */
.heb-card__price-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-muted);
    font-weight: 400;
    margin-bottom: 2px;
}

.heb-card__price-original {
    text-decoration: line-through;
    color: var(--color-muted);
    font-weight: 400;
    margin-right: 4px;
}

.heb-card__cta {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-terracotta);
    transition: gap var(--transition-fast);
}

/* ── Bouton "Réserver / Choisir" ───────────────────────────── */

.btn-resa-choisir {
    padding: 0.65rem 1.2rem;
    background: var(--color-terracotta);
    color: #fff;
    border: 0;
    border-radius: 2px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-resa-choisir:hover {
    background: var(--color-terracotta-dk);
    text-decoration: none;
}

.heb-card.is-selected .btn-resa-choisir {
    color: var(--color-forest);
    font-weight: 500;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
    .heb-grid { grid-template-columns: 1fr; }
    .heb-empty { grid-column: span 1; }
    .heb-grid--listing { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .heb-grid { gap: 1rem; background: transparent; }

    .heb-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .heb-card__price {
        width: 100%;
    }

    .btn-resa-choisir {
        width: 100%;
        text-align: center;
        padding: 0.85rem;
        border: 1px solid var(--color-terracotta);
        background: var(--color-terracotta);
        color: #fff;
    }
}

@media (max-width: 600px) {
    .heb-grid--listing { grid-template-columns: 1fr; }
}