/* ============================================================================
   Section "Annonces déjà consultées"
   Fichier : css/recently-viewed.css
   Utilisé par : includes/recently-viewed.php
   ============================================================================ */

/* ─── Conteneur de section ────────────────────────────────────────────────── */

.recently-viewed-section {
    /* Tailwind gère le padding/margin (mx-auto px-4 sm:px-6 lg:px-8 py-12) */
}

.recently-viewed-section__title {
    /* Tailwind : text-2xl font-bold text-gray-900 mb-8 */
}

.recently-viewed-section__carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    /* Scroll fluide sur iOS */
    -webkit-overflow-scrolling: touch;
    /* Scroll snap optionnel (décommentez pour activer) */
    /* scroll-snap-type: x mandatory; */
}

.recently-viewed-section__slide {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

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

.recent-view-card {
    position: relative;
    display: block;
    width: 280px;
    height: 340px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recent-view-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ─── Image principale ────────────────────────────────────────────────────── */

.recent-view-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recent-view-img-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* ─── Dégradé overlay ─────────────────────────────────────────────────────── */

.recent-view-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
    pointer-events: none;
}

/* ─── Bouton favori (cœur) ────────────────────────────────────────────────── */

.favorite-button.recent-view-card__favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #475569;
    transition: all 0.2s ease;
    padding: 0;
}

.favorite-button.recent-view-card__favorite:hover {
    background: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.favorite-button.recent-view-card__favorite:active {
    transform: scale(0.95);
}

.favorite-button.recent-view-card__favorite i {
    font-size: 15px;
    line-height: 1;
}

/* ─── Contenu (titre + tags + localisation) ──────────────────────────────── */

.recent-view-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-view-card__title {
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    margin: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.2;
}

.recent-view-card__title-badge {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
}

/* ─── Tags (prix, km, carburant, transmission) ───────────────────────────── */

.recent-view-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-view-card__tag {
    background: rgba(255, 255, 255, 0.9);
    color: #1F2937;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    /* border-radius: 999px; */
    white-space: nowrap;
}

/* ─── Localisation ────────────────────────────────────────────────────────── */

.recent-view-card__location {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recent-view-card__location i {
    font-size: 14px;
}

/* ─── Icône type de véhicule (décorative) ────────────────────────────────── */

.recent-view-card__vehicle-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    object-fit: contain;
    z-index: 3;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

/* Seul le vélo est retourné (voiture et moto regardent déjà à gauche) */
.recent-view-card__vehicle-icon--flip {
    transform: scaleX(-1);
}

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

@media (max-width: 640px) {
    .recently-viewed-section__slide {
        min-width: 250px;
        max-width: 250px;
    }
    .recent-view-card {
        width: 250px;
        height: 320px;
    }
    .recent-view-card__title {
        font-size: 16px;
    }
    .recent-view-card__tag {
        font-size: 12px;
        padding: 3px 8px;
    }
}