/* ==========================================================================
   SERVICE CARD COMPONENT - Modern, Flexible Layout
   ========================================================================== */

/* Card Container */
.service-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Fill grid cell */
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Image Container */
.service-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f3f4f6;
}

.service-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.service-card:hover .service-card-image {
    transform: scale(1.05);
}

.service-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d7a8c 100%);
    color: rgba(255, 255, 255, 0.7);
}

/* Featured Badge */
.service-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff6b35;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Card Content */
.service-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Grow to fill space */
    gap: 12px;
}

/* Card Header - Title and Rating */
.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.service-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    /* Limit to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Card Meta - Location and Views */
.service-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #6b7280;
}

.service-card-meta-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.service-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.service-card-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card Price */
.service-card-price-wrapper {
    margin-top: 4px;
}

.service-card-price {
    font-size: 28px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
    margin-bottom: 4px;
}

.service-card-price-unit {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    display: block;
}

/* Alternative: Price with unit on same line */
.service-card-price-inline {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.service-card-price-inline .service-card-price {
    margin-bottom: 0;
}

/* Card Button */
.service-card-button {
    margin-top: auto;
    padding: 12px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    text-decoration: none;
}

.service-card:hover .service-card-button {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.service-card-button:active {
    transform: translateY(0);
}

/* Alternative button styles */
.service-card-button-secondary {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.service-card-button-secondary:hover {
    background: #2563eb;
    color: white;
}

/* ==========================================================================
   GRID CONTAINER
   ========================================================================== */

/* Services Grid - Responsive */
/* Equal height for all card types */
.services-grid,
.featured-services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    max-width: 100%;
    align-items: start;
    /* Start at same top position */
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Large Desktop (1400px+): 4 columns */
@media (min-width: 1400px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }

    .service-card-image-wrapper {
        height: 180px;
    }
}

/* Desktop (1024px - 1399px): 4 columns, slightly smaller */
@media (min-width: 1024px) and (max-width: 1399px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Tablet (768px - 1023px): 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .service-card-image-wrapper {
        height: 170px;
    }
}

/* Large Mobile (576px - 767px): 2 columns */
@media (min-width: 576px) and (max-width: 767px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .service-card-image-wrapper {
        height: 170px;
    }
}

/* Mobile (< 576px): 1 column */
@media (max-width: 575px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-card-image-wrapper {
        height: 170px;
    }

    .service-card-content {
        padding: 16px;
    }

    .service-card-title {
        font-size: 16px;
    }

    .service-card-price {
        font-size: 24px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .service-card-image-wrapper {
        height: 160px;
    }

    .service-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-card-rating {
        align-self: flex-start;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus styles */
.service-card:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.service-card-button:focus {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .service-card,
    .service-card-image,
    .service-card-button {
        transition: none;
    }

    .service-card:hover {
        transform: none;
    }

    .service-card:hover .service-card-image {
        transform: none;
    }
}

/* ==========================================================================
   MOBILE SPACING FIX - SERVICE CARDS (FALLBACK)
   Increase vertical spacing between cards on mobile
   ========================================================================== */

@media (max-width: 768px) {

    /* Service Card - Mobile Spacing */
    .service-card,
    a.service-card,
    .home-category-section .service-card,
    .services-grid .service-card {
        margin-bottom: 32px !important;
        /* Increased spacing */
    }
}

@media (max-width: 414px) {

    .service-card,
    a.service-card {
        margin-bottom: 32px !important;
        /* Keep 32px on large mobile */
    }
}

@media (max-width: 360px) {

    .service-card,
    a.service-card {
        margin-bottom: 32px !important;
        /* Keep 32px on small mobile */
    }
}

@media (max-width: 320px) {

    .service-card,
    a.service-card {
        margin-bottom: 28px !important;
        /* Slight reduction for tiny screens */
    }
}

/* ==========================================================================
   MOBILE CARD FIX - PADDING
   ========================================================================== */

@media (max-width: 768px) {

    .tour-card,
    .wine-tasting-card,
    .service-card {
        margin: 0 12px 16px 12px;
    }
}