/* =========================================
   TOUR CARDS - EXACT REPLICA WITH REDUCED GAP
   Updated per ridurre gap e ottimizzare dimensioni card
   ========================================= */

/* CARD BASE STYLING - Exact match to target con ottimizzazioni */
.tour-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.4s ease !important;
    cursor: pointer !important;
    width: 100% !important;
    max-width: 450px !important; /* INCREASED: Leggermente più larghe */
    display: flex !important;
    flex-direction: column !important;
    min-height: 540px !important; /* AUMENTATO: +60px per immagine più alta */
    margin: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
}

/* HOVER EFFECT - Exact match */
.tour-card:hover {
    transform: translateY(-10px) scale(1.02) !important;
    box-shadow: 0 20px 60px rgba(247, 148, 72, 0.15) !important;
}

/* IMAGE CONTAINER - Increased height for better visual */
.tour-card-image {
    position: relative !important;
    height: 300px !important; /* AUMENTATO: da 240px a 300px (+25%) */
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

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

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

/* BADGE - Exact positioning */
.tour-badge {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    background: linear-gradient(135deg, #3068b3, #2a5ba1) !important;
    color: white !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 12px rgba(48, 104, 179, 0.3) !important;
    z-index: 9 !important;
}

/* CARD INFO - Exact padding and layout */
.tour-card-info {
    padding: 22px !important; /* INCREASED: Padding leggermente maggiore */
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

/* TITLE - Exact styling */
.tour-name {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #222 !important;
    margin: 0 0 15px 0 !important;
    line-height: 1.3 !important;
}

.tour-name a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.tour-name a:hover {
    color: #3068b3 !important;
}

/* DEPARTURE LOCATION - Exact styling */
.departure-location {
    font-size: 15px !important;
    color: #666 !important;
    margin-bottom: 15px !important;
    font-weight: 500 !important;
}

.departure-location strong {
    color: #333 !important;
}

/* TOUR DETAILS - Exact layout */
.tour-details {
    display: flex !important;
    gap: 25px !important;
    margin-bottom: 15px !important;
    flex-wrap: wrap !important;
}

.tour-detail {
    font-size: 14px !important;
    color: #666 !important;
    font-weight: 500 !important;
}

.tour-detail strong {
    color: #333 !important;
}

/* RATING - SINGLE STAR EXACT MATCH */
.tour-rating {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 15px !important;
    margin-bottom: 15px !important;
}

.tour-rating .stars {
    font-size: 16px !important;
    color: #ffc107 !important;
    filter: drop-shadow(0 1px 3px rgba(255, 193, 7, 0.3)) !important;
}

.tour-rating strong {
    font-weight: 700 !important;
    color: #333 !important;
}

.reviews-count {
    color: #999 !important;
}

/* PRICE SECTION - EXACT TARGET LAYOUT */
.tour-price {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-top: 15px !important;
    border-top: 1px solid rgba(240, 240, 240, 0.6) !important;
    margin-top: auto !important;
}

/* PRICE + BUTTON HORIZONTAL ROW */
.tour-price .price-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
}

/* PRICE AMOUNT - Left side */
.tour-price .price-info .price-display {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
}

.price-amount {
    font-size: 28px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #222, #444) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    line-height: 1 !important;
}

.price-period {
    font-size: 14px !important;
    color: #666 !important;
    font-weight: 500 !important;
}

/* BOOK BUTTON - Right side, exact match to target */
.book-now-btn {
    padding: 12px 28px !important;
    background: linear-gradient(135deg, #3068b3, #2a5ba1) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.book-now-btn:hover {
    background: linear-gradient(135deg, #2a5ba1, #244f8f) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(48, 104, 179, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

/* TOTAL PILL - EXACT MATCH - Below the price/button row */
.price-total {
    background: rgba(48, 104, 179, 0.1) !important;
    border: 1px solid rgba(48, 104, 179, 0.2) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    animation: slideInUp 0.3s ease !important;
}

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

.price-total-label {
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 600 !important;
}

.price-total-amount {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #3068b3 !important;
}

/* GRID LAYOUT - FIXED: Prevents cards from squeezing */
.tours-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(380px, 420px)) !important; /* FIXED: Max width 420px prevents squeezing */
    gap: 20px !important;
    justify-content: center !important; /* ADDED: Center cards when they don't fill the row */
}

/* Ensure cards maintain consistent width */
.tours-grid .tour-card {
    width: 100% !important;
    min-width: 380px !important; /* ADDED: Prevent shrinking below this width */
}

/* PLACEHOLDER IMAGES - Updated colors */
.placeholder-image {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #f79448 0%, #ff6b35 100%) !important;
    color: white !important;
    text-align: center !important;
}

.placeholder-image.location-como {
    background: linear-gradient(135deg, #3068b3 0%, #4a7bc8 100%) !important;
}

.placeholder-content {
    padding: 20px !important;
}

.placeholder-text {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    display: block !important;
}

.placeholder-location {
    font-size: 14px !important;
    opacity: 0.9 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* RESPONSIVE - FIXED: Keep horizontal layout on mobile */
@media (max-width: 768px) {
    .tour-card {
        min-height: 460px !important; /* AUMENTATO: +60px per immagine più alta */
        max-width: 100% !important; /* FULL WIDTH su mobile */
    }

    .tour-card-image {
        height: 260px !important; /* AUMENTATO: da 200px a 260px (+30%) */
    }
    
    .tour-card-info {
        padding: 18px !important; /* REDUCED: Padding ridotto su mobile */
    }
    
    .tour-name {
        font-size: 20px !important;
    }
    
    .price-amount {
        font-size: 24px !important;
    }
    
    /* Keep horizontal layout on mobile - same as desktop */
    .tour-price .price-info {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
    }
    
    /* Keep button same size as desktop */
    .book-now-btn {
        padding: 12px 28px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    .tour-details {
        gap: 15px !important;
    }
    
    .tour-detail {
        font-size: 13px !important;
    }
    
    /* MOBILE GRID - Mantenere gap 20px */
    .tours-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important; /* MANTIENE: Gap 20px anche su mobile */
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .tour-card-info {
        padding: 15px !important;
    }
    
    .tour-name {
        font-size: 18px !important;
    }
    
    .price-amount {
        font-size: 22px !important;
    }
    
    .book-now-btn {
        padding: 10px 24px !important;
        font-size: 13px !important;
    }
}

/* ENSURE GRID COMPATIBILITY */
.location-tours-fullwidth {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)) !important; /* UPDATED: Ottimizzato per 3 card per riga */
    gap: 20px !important; /* CONSISTENT: Gap 20px ovunque */
    justify-items: stretch !important;
}

@media (max-width: 768px) {
    .location-tours-fullwidth {
        grid-template-columns: 1fr !important;
        gap: 30px !important; /* INCREASED: Gap 30px anche su mobile */
    }
}

/* PERFORMANCE OPTIMIZATIONS */
.tour-card {
    will-change: transform !important;
    transform: translateZ(0) !important; /* Force hardware acceleration */
}

.tour-card-image img {
    will-change: transform !important;
}

/* PRINT STYLES */
@media print {
    .tour-card {
        break-inside: avoid !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .favorite-btn,
    .book-now-btn {
        display: none !important;
    }
}
