/* Design épuré et professionnel */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Poppins', sans-serif;
    background: #f8fafc;
    padding: 2rem 1rem;
    color: #334155;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Grille responsive */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}


/* Carte principale */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #e2e8f0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Badge */
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
}

/* Image */
.card-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

/* Contenu */
.card-content {
    padding: 0.75rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.card-category {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-category i {
    color: #1e293b;
    font-size: 0.8rem;
}

.online-purchase {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Styles selon le type */
.online-purchase.available {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.online-purchase.contact {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
}

.online-purchase.unavailable {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 0;
    padding: 0;
    max-height: 0;
    overflow: visible;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-specs {
    max-height: 120px;
    opacity: 1;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
}

.spec-item i {
    color: #1e293b;
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

.spec-item span {
    font-weight: 500;
}

/* Item de localisation avec carte */
.location-item {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
    position: relative;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.location-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.location-item i {
    color: #3b82f6;
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

.address-text {
    font-weight: 500;
    color: #1e293b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Carte flottante */
.map-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: auto;
    border: 2px solid #e2e8f0;
    margin-bottom: 10px;
}

/* Suppression du hover CSS - géré par JavaScript */

.map-tooltip iframe {
    border-radius: 6px;
    display: block;
}

/* Flèche pointant vers l'adresse */
.map-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.card-info {
    color: #059669;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Footer avec prix et bouton */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.card-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.card-btn:hover {
    background: #0f172a;
    transform: translateY(-1px);
}

/* Rating */
.card-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.stars {
    display: flex;
    align-items: center;
    color: #f59e0b;
    font-size: 0.85rem;
}

.stars span {
    color: #64748b;
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.status {
    color: #059669;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Annonceur */
.advertiser {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.advertiser-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advertiser-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.advertiser-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.advertiser .name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.advertiser-status {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.advertiser-status.premium {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
}

.advertiser-status.gold {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.advertiser-status.pro {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.advertiser-status.standard {
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
}

.verified {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #059669;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Timer Badge */
.timer-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 15;
    transition: all 0.3s ease;
}

.timer-badge:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Animation du timer pour les nouvelles annonces */
.card-badge[data-new="true"] + .card-image .timer-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Icônes de contact en overlay */
.contact-icons-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.card:hover .contact-icons-overlay {
    opacity: 1;
    transform: translateY(0);
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

/* Icônes de shopping à droite de l'image */
.shop-icons-overlay {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%) translateX(15px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.card:hover .shop-icons-overlay {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.icon-btn.whatsapp {
    background: #25d366;
    color: white;
}

.icon-btn.whatsapp:hover {
    background: #128c7e;
    transform: scale(1.1);
}

.icon-btn.phone {
    background: #3b82f6;
    color: white;
}

.icon-btn.phone:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}

.icon-btn.email {
    background: #6b7280;
    color: white;
}

.icon-btn.email:hover {
    background: #374151;
    transform: scale(1.1);
}

/* Icônes de shopping */
.icon-btn.cart {
    background: #f59e0b;
    color: white;
}

.icon-btn.cart:hover {
    background: #d97706;
    transform: scale(1.1);
}

.icon-btn.compare {
    background: #8b5cf6;
    color: white;
}

.icon-btn.compare:hover {
    background: #7c3aed;
    transform: scale(1.1);
}

.icon-btn.wishlist {
    background: #ef4444;
    color: white;
}

.icon-btn.wishlist:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Icônes spécifiques emploi */
.icon-btn.save {
    background: #06b6d4;
    color: white;
}

.icon-btn.save:hover {
    background: #0891b2;
    transform: scale(1.1);
}

.icon-btn.apply {
    background: #10b981;
    color: white;
}

.icon-btn.apply:hover {
    background: #059669;
    transform: scale(1.1);
}

/* Animations */
.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .card-content {
        padding: 0.5rem;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .card-btn {
        justify-content: center;
    }
    
    .card-rating {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* MEDIA QUERIES - À LA FIN POUR LA PRIORITÉ */

/* Responsive - 3 colonnes sur écrans moyens */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* Responsive - 2 colonnes sur tablette et smartphone */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    body {
        padding: 1rem 0.5rem;
    }
    
    /* Réduction proportionnelle des éléments */
    .card {
        border-radius: 8px;
    }
    
    /* Image plus petite */
    .card-image {
        height: 140px;
    }
    
    /* Contenu plus compact */
    .card-content {
        padding: 0.6rem;
    }
    
    /* Typographie réduite */
    .card-title {
        font-size: 0.85rem;
        line-height: 1.2;
        margin-bottom: 0.4rem;
    }
    
    .card-category {
        font-size: 0.65rem;
    }
    
    .card-category i {
        font-size: 0.7rem;
    }
    
    .online-purchase {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    
    /* Spécifications plus petites */
    .spec-item {
        font-size: 0.7rem;
        gap: 0.4rem;
    }
    
    .spec-item i {
        width: 12px;
        font-size: 0.65rem;
    }
    
    /* Prix et bouton réduits */
    .card-price {
        font-size: 1.1rem;
    }
    
    .card-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        border-radius: 5px;
    }
    
    /* Rating plus petit */
    .stars {
        font-size: 0.75rem;
    }
    
    .stars span {
        font-size: 0.7rem;
    }
    
    .status {
        font-size: 0.7rem;
    }
    
    /* Annonceur plus compact */
    .advertiser {
        gap: 0.4rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .advertiser img {
        width: 32px;
        height: 32px;
    }
    
    .advertiser .name {
        font-size: 0.8rem;
    }
    
    .advertiser-status {
        font-size: 0.55rem;
        padding: 1px 3px;
    }
    
    .verified {
        font-size: 0.7rem;
    }
    
    /* Icônes de contact plus petites */
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .contact-icons-overlay,
    .shop-icons-overlay {
        gap: 6px;
    }
    
    /* Badge plus petit */
    .card-badge {
        top: 8px;
        left: 8px;
        padding: 3px 6px;
        font-size: 0.6rem;
        border-radius: 3px;
    }
    
    /* Carte flottante adaptée */
    .map-tooltip {
        width: 250px;
        max-width: 85vw;
        padding: 12px;
        border-radius: 8px;
    }
    
    .map-tooltip iframe {
        width: 100%;
        height: 180px;
    }
    
    /* Info card plus petite */
    .card-info {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }
}

/* Responsive - Très petits écrans mais toujours 2 colonnes */
@media (max-width: 480px) {
    .cards-grid {
        gap: 0.5rem;
    }
    
    body {
        padding: 0.5rem 0.25rem;
    }
    
    /* Réduction supplémentaire pour très petits écrans */
    .card-image {
        height: 120px;
    }
    
    .card-content {
        padding: 0.5rem;
    }
    
    .card-title {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .card-category {
        font-size: 0.6rem;
    }
    
    .online-purchase {
        font-size: 0.55rem;
    }
    
    .spec-item {
        font-size: 0.65rem;
        gap: 0.3rem;
    }
    
    .spec-item i {
        width: 10px;
        font-size: 0.6rem;
    }
    
    .card-price {
        font-size: 1rem;
    }
    
    .card-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.7rem;
    }
    
    .icon-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .advertiser img {
        width: 28px;
        height: 28px;
    }
    
    .advertiser .name {
        font-size: 0.75rem;
    }
    
    .advertiser-status {
        font-size: 0.5rem;
    }
    
    .map-tooltip {
        width: 220px;
        padding: 10px;
    }
    
    .map-tooltip iframe {
        height: 160px;
    }
}
