/* ===================================
   CARDS DESIGN - Professional Style
   ================================= */

/* Card Container */
.card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Badges */
.badges {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-discount {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge-bestseller {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge-urgent {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.badge-urgent.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

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

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

/* Card Content */
.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-tagline {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Destinations */
.card-destinations {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #374151;
}

.card-destinations i {
    color: #3b82f6;
}

/* Highlights List */
.card-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.card-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-highlights i {
    color: #10b981;
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Pricing */
.card-pricing {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.price-original {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
    direction: ltr;
    unicode-bidi: embed;
}

.price-current {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
    line-height: 1;
    direction: ltr;
    unicode-bidi: embed;
}

.price-savings {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: embed;
}

/* Availability Bar */
.card-availability {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #f3f4f6;
}

.card-availability.availability-low {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.card-availability.availability-medium {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.card-availability.availability-critical {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

.availability-text {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.availability-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.availability-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Card Footer - Mobile First */
.card-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop - Boutons plus grands */
@media (min-width: 640px) {
    .card-footer {
        padding: 16px 20px;
        gap: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-secondary:hover {
    background: #eff6ff;
    transform: translateY(-2px);
}

/* Grid Layout */
#destinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px 0;
}

@media (min-width: 768px) {
    #destinations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #destinations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   LIST VIEW MODE - MOBILE FIRST
   Layout: Image+Prix | Titre+Destinations (60%) | Boutons (colonne)
   ================================= */

/* Mobile par défaut (< 640px) - Layout 3 colonnes */
.list-card {
    flex-direction: row !important;
    max-height: none;
    min-height: 110px;
    gap: 8px;
    padding: 8px;
}

/* Colonne 1: Image + Prix dessous (wrapper virtuel) */
.list-card .card-image {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    height: 130px; /* Image (90px) + marge (4px) + prix (2 lignes ~36px) */
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.list-card .card-image img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
}

/* Prix repositionné sous l'image via position absolue */
.list-card .card-pricing {
    position: absolute;
    top: 94px; /* hauteur image (90px) + margin (4px) */
    left: 0;
    right: 0;
    text-align: center;
    margin: 0;
}

.list-card .price-current {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
    display: block;
    line-height: 1.2;
}

.list-card .price-original {
    font-size: 9px;
    text-decoration: line-through;
    color: #9ca3af;
    display: block;
    line-height: 1.2;
}

.list-card .price-savings {
    display: none;
}

/* Colonne 2: Contenu (3/5 de l'espace) */
.list-card .card-content {
    flex: 3;
    padding: 0 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-card .card-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1f2937;
}

.list-card .card-tagline {
    display: none;
}

.list-card .card-highlights {
    display: none;
}

.list-card .card-destinations {
    font-size: 11px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #6b7280;
}

.list-card .card-destinations i {
    font-size: 10px;
    color: #3b82f6;
}

.list-card .card-availability {
    display: none;
}

/* Colonne 3: Footer avec boutons en colonne */
.list-card .card-footer {
    flex: 1;
    padding: 0;
    border-top: none;
    gap: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.list-card .btn {
    padding: 6px 4px;
    font-size: 9px;
    border-radius: 6px;
    flex: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.list-card .btn-secondary {
    background: #f3f4f6;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.list-card .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Badges compacts */
.list-card .badges {
    position: absolute;
    top: 2px;
    left: 2px;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
}

.list-card .badge {
    padding: 2px 5px;
    font-size: 8px;
    border-radius: 3px;
}

/* Désactiver animations en mode liste mobile */
.list-card .badge-urgent.pulse {
    animation: none;
}

.list-card:hover {
    transform: none;
}

/* Desktop (> 640px) - Plus d'espace */
@media (min-width: 640px) {
    .list-card {
        min-height: 130px;
        gap: 12px;
        padding: 10px;
    }

    .list-card .card-image {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        height: 155px; /* Image (110px) + marge (4px) + prix (2 lignes ~41px) */
    }

    .list-card .card-image img {
        height: 110px;
    }

    .list-card .card-pricing {
        top: 114px; /* hauteur image (110px) + margin (4px) */
    }

    .list-card .card-content {
        padding: 0 10px;
    }

    .list-card .card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .list-card .card-destinations {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .list-card .price-current {
        font-size: 16px;
    }

    .list-card .price-original {
        font-size: 11px;
    }

    .list-card .card-footer {
        gap: 8px;
    }

    .list-card .btn {
        padding: 7px 8px;
        font-size: 10px;
    }

    .list-card .badges {
        top: 4px;
        left: 4px;
    }

    .list-card .badge {
        padding: 3px 6px;
        font-size: 9px;
    }
}

/* Large Desktop (> 1024px) */
@media (min-width: 1024px) {
    .list-card {
        min-height: 150px;
        gap: 16px;
        padding: 12px;
    }

    .list-card .card-image {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        height: 178px; /* Image (130px) + marge (4px) + prix (2 lignes ~44px) */
    }

    .list-card .card-image img {
        height: 130px;
    }

    .list-card .card-pricing {
        top: 134px; /* hauteur image (130px) + margin (4px) */
    }

    .list-card .card-content {
        padding: 0 12px;
    }

    .list-card .card-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .list-card .card-destinations {
        font-size: 13px;
    }

    .list-card .price-current {
        font-size: 18px;
    }

    .list-card .price-original {
        font-size: 12px;
    }

    .list-card .card-footer {
        gap: 10px;
    }

    .list-card .btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .list-card .badge {
        padding: 3px 7px;
        font-size: 10px;
    }
}

/* ===================================
   GRID MODE - MOBILE RESPONSIVE
   ================================= */

@media (max-width: 640px) {
    #destinations-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Grid mode mobile - Optimisé pour 98% des consultations */
    .grid-card .card-image {
        height: 180px;
    }

    .grid-card .card-content {
        padding: 14px;
    }

    .grid-card .card-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .grid-card .card-tagline {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .grid-card .card-destinations {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .grid-card .card-highlights {
        margin-bottom: 12px;
    }

    .grid-card .card-highlights li {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .grid-card .price-current {
        font-size: 24px;
    }

    .grid-card .card-footer {
        flex-direction: row;
        padding: 10px 14px;
        gap: 6px;
    }

    .grid-card .btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .grid-card .badges {
        top: 10px;
        left: 10px;
    }

    .grid-card .badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Touch-friendly clickable areas for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 38px; /* Taille tactile recommandée pour mobile */
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation; /* Améliore la réactivité tactile */
    }

    .list-card .btn {
        min-height: 32px; /* Plus compact en mode liste */
    }
}
