
@media (min-width: 781px) {
    /* --- Carousel Layout --- */
    .carousel-section {
        max-width: 780px;
        margin: 40px auto;
        padding: 20px;
        background-color: #F5F3FF;
        border: #dadfe1 1px solid;
        border-radius: 8px;
    }

    .carousel-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* --- Carousel Wrapper --- */
    .carousel-wrapper {
        overflow: hidden;
        flex-grow: 1;
        margin: 0 10px;
        max-width: 650px;
        min-height: 350px;
    }

    /* --- Carousel moving element --- */
    .carousel {
        display: flex;
        transition: transform 0.4s ease-in-out;
        width: fit-content;
        padding-top: 15px;
    }

    /* --- Individual Card Styling --- */
    .card {
        width: 220px;
        height: 320px; /* Increased slightly to fit description */
        margin-left: 5px;
        margin-right: 15px;
        background-color: #fff;
        border-radius: 8px;
        padding: 10px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        cursor: pointer;
        box-shadow: 
            0 4px 10px rgba(0, 0, 0, 0.28),
            0 -4px 10px rgba(0, 0, 0, 0.18),
            0 2px 6px rgba(0, 0, 0, 0.16);
        transition: box-shadow 0.25s ease, transform 0.25s ease;
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow:
            0 5px 8px rgba(0, 0, 0, 0.40),
            0 -5px 8px rgba(0, 0, 0, 0.30),
            0 2px 4px rgba(0, 0, 0, 0.25);
    }

    /* --- NEW: Image Container & Floating Rating --- */
    .card-img-container {
        position: relative; /* Anchor for the rating badge */
        width: 100%;
        height: 150px;
        overflow: hidden;
        border-radius: 4px;
    }

    .card-img-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .card-rating-badge {
        position: absolute;
        bottom: 5px;
        left: 5px;
        z-index: 10;
        font-size: 15px;
        font-weight: bold;
        color: white !important;
        padding: 4px 6px;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }

    /* Styling for the parentheses and review count */
    .rating-count {
        font-size: 12px;      /* Makes it smaller than the rating */
        margin-left: 4px;       /* Adds a tiny gap after the rating number */
        font-weight: normal;    /* Keeps it from being too heavy */
    }

    /* Rating Colors */
    .rating-high { background-color: #27ae60 !important; }
    .rating-mid  { background-color: #f39c12 !important; }
    .rating-low  { background-color: #c0392b !important; }

    /* --- Content Styling --- */
    .card-title {
        text-align: center;
        margin-top: 5px;
        font-weight: bold;
        color: #219ebc;
        margin-bottom: 2px;
    }

    .card-description-index-carousel {
        font-weight: normal;
        font-size: 13px;
        color: black;
        font-style: italic;
        margin-top: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limits description to 2 lines */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-top: 4px;
    }

    .card-name { font-size: 13px; }
    .card-price { color: #0b4e0b; font-size: 16px; font-weight: bold; }
    .card-city { font-size: 13px; }

    /* --- Navigation Buttons --- */
    .carousel-btn {
        background-color: #023047;
        color: white;
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        font-size: 24px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s;
    }

    .carousel-btn:hover { background-color: #219ebc; }
}

@media (max-width: 780px) {
    /* --- Carousel Layout --- */
    .carousel-section {
        max-width: 100%;
        margin: 20px 10px;
        padding: 15px 0; 
        background-color: #F5F3FF;
        border: #dadfe1 1px solid;    
        border-radius: 8px;
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05), 
                    0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .carousel-row {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-wrapper {
        overflow-x: auto; 
        flex-grow: 1;
        margin: 0;
        max-width: 100%; 
        min-height: 330px;
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: none; 
        -ms-overflow-style: none;
    }

    .carousel-wrapper::-webkit-scrollbar {
        display: none;
    }

    .carousel {
        display: flex;
        width: fit-content;
        justify-content: flex-start; 
        padding-top: 10px;
        padding-bottom: 20px;
    }

    .card {
        width: 240px; 
        height: 300px;
        margin: 0 7.5px;       
        background-color: white;
        border-radius: 8px;
        padding: 10px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        border: 1px solid gray;
    }

    /* --- ADDED: Image Container & Floating Rating for Mobile --- */
    .card-img-container {
        position: relative; /* Anchor for the rating badge */
        width: 100%;
        height: 130px; /* Moved height from img to container */
        overflow: hidden;
        border-radius: 4px;
    }

    .card-img-container img {
        width: 100%; 
        height: 100%; /* Image fills container */
        object-fit: cover;
        display: block;
    }

    .card-rating-badge {
        position: absolute;
        bottom: 5px;
        left: 5px;
        z-index: 10;
        font-size: 14px;
        font-weight: bold;
        color: white !important;
        padding: 4px 6px;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }
    .rating-count {
        font-size: 11px;      /* Makes it smaller than the rating */
        margin-left: 4px;       /* Adds a tiny gap after the rating number */
        font-weight: normal;    /* Keeps it from being too heavy */
    }
    /* Rating Colors (Make sure these are inside the media query or global) */
    .rating-high { background-color: #27ae60 !important; }
    .rating-mid  { background-color: #f39c12 !important; }
    .rating-low  { background-color: #c0392b !important; }

    /* --- Remaining Content Styling --- */
    .card p.card-title {
        margin-top: 5px;
        font-weight: bold;
        color: #219ebc;
        margin-bottom: 2px;
        text-align: center;
    }

    .card-description-index-carousel {
        font-weight: normal;
        font-size: 13px;
        color: black;
        font-style: italic;
        overflow-wrap: break-word;
        word-break: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden; 
    }

    .card-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-top: 4px;
    }

    .card-price {
        color: #0b4e0b;
        font-size: 15px;
        font-weight: bold;
    }

    .card-city {
        font-size: 12px;
        color: #333;
    }

    .card-name {
        font-size: 13px;
        color: #555;
    }

    .carousel-btn {
        display: none; 
    }
}