/* --- REDESIGNED HOME CARDS (Clean Premium) --- */
.home-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.home-card-img-box {
    background: #f4f6f8;
    border-radius: 16px;
    height: 200px;
    /* Consistent Height */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
}

/* Placeholder for badges if added dynamically */
.home-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e65100;
    /* Default Accent */
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(230, 81, 0, 0.3);
}

/* Specification Badge (Clean Tag - FORCED RED) */
.spec-badge {
    display: inline-block !important;
    background-color: #d32f2f !important;
    background: linear-gradient(45deg, #c62828, #e53935) !important;
    color: #fff !important;
    padding: 4px 12px !important;
    border-radius: 99px !important;
    /* Full Pill as requested or 4px? User liked "Red Tags". Let's go with 20px for safety/pill look */
    border-radius: 4px !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 5px rgba(198, 40, 40, 0.3) !important;
    margin-top: 8px !important;
    margin-bottom: 5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    border: none !important;
    text-shadow: none !important;
    width: fit-content !important;
}

/* Desktop Override: Red & Thick Inline Badge */
@media screen and (min-width: 769px) {
    .spec-badge {
        margin-top: 0 !important;
        margin-left: 0 !important;
        display: block !important;
        /* On desktop it's under title, so block or inline-block is fine */
        margin-top: 5px !important;
    }
}

.home-card-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    color: #ccc;
    transition: all 0.2s;
}

.home-card-wishlist:hover {
    color: #e91e63;
    transform: scale(1.1);
}

.home-card-img {
    width: 80%;
    max-height: 90%;
    object-fit: contain;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.15));
}

.home-card:hover .home-card-img {
    transform: scale(1.1) translateY(-5px);
}

.home-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1b4332;
    margin-bottom: 6px;
    line-height: 1.2;
}

.home-card-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    /* Reserve space for 2 lines */
}

.home-card-controls {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Carousel Slide Grid (Desktop Default) */
.carousel-slide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 40px;
    align-items: start;
    /* Prevent grid items from stretching vertically */
}

/* Fix for Track stretching slides */
/* Fix for Desktop: 3x2 Grid Layout */
#homeCarouselTrack {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    /* 3 Columns */
    gap: 30px !important;
    /* Clean Spacing */
    width: 100% !important;
    max-width: 1200px;
    margin: 0 auto;
    transform: none !important;
    /* Disable sliding */
    flex-wrap: wrap !important;
}

/* Ensure cards fill their grid cells */
#homeCarouselTrack .home-card {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    flex: none !important;
}

#homeCarouselTrack .home-card {
    min-width: 320px;
    flex: 0 0 auto;
}

/* --- MOBILE GRID ADAPTATION (320px - 768px) --- */
@media screen and (max-width: 768px) {
    #homeCarouselTrack {
        /* Force grid layout for mobile */
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        overflow-x: visible !important;
        box-sizing: border-box !important;
    }

    .carousel-slide {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Standard Card Adjustments for Mobile */
    .home-card {
        padding: 10px !important;
        min-height: 260px !important;
        height: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .home-card-img-box {
        height: 120px !important;
        /* Smaller image on mobile */
        margin-bottom: 10px !important;
    }

    .home-card-title {
        font-size: 1rem !important;
        /* Slightly smaller title */
    }

    .home-card-desc {
        display: none !important;
        /* Hide description on mobile to save space */
    }

    /* Ensure buttons/controls fit */
    .home-card-controls {
        gap: 8px !important;
        /* Reduce gap */
        margin-top: auto !important;
    }

    .home-card-btn {
        padding: 8px 0 !important;
        font-size: 0.9rem !important;
    }
}