/* ==========================================================================
   GLOBAL & RESET
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   PAGE TITLES
   ========================================================================== */
.page-title {
    font-size: 2rem;           /* larger than regular section titles */
    font-weight: 800;           /* bold */
    color: #008080;             /* teal color matching your design */
    margin: 0;                  /* handled by the flex container */
    line-height: 1.2;
    display: flex;              /* for icon + text alignment */
    align-items: center;
    gap: 0.5rem;                /* space between icon and text */
}
.section {
    padding: 0;
    margin-bottom: 2rem;
}


/* ==========================================================================
   SECTION TITLES
   ========================================================================== */
.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #008080;
    margin: 0 0 1.2rem 0;
    line-height: 1.2;
}

/* ==========================================================================
   DESKTOP / TABLET GRID
   ========================================================================== */
.cards-container {
    display: grid;
    gap: 16px;
    padding: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    justify-items: center;
}

/* ==========================================================================
   CARD
   ========================================================================== */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    width: 100%;
    max-width: 260px; /* prevents huge card */
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
}

.card.no-image .card-img {
    display: block;
    visibility: hidden;
    height: 0;
    margin-bottom: 0;
}

/* ==========================================================================
   TEXT
   ========================================================================== */
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-price {
    font-weight: 600;
    color: #008080;
    margin-bottom: 6px;
}

/* ==========================================================================
   BUTTON
   ========================================================================== */
.card-button {
    display: inline-block;
    padding: 6px 10px;
    background-color: #008080;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    margin-top: auto;
}

.card-button:hover {
    background-color: #006666;
}


/* ==========================================================================
   MOBILE (Horizontal Scroll Cards)
   ========================================================================== */
/* ==========================================================================
   MOBILE (Horizontal Scroll Cards Fixed)
   ========================================================================== */
/* ==========================================================================
   MOBILE (Fixed Size, Non-Stretchable Cards)
   ========================================================================== */
@media (max-width: 768px) {

    .cards-container {
        display: flex;
        overflow-x: auto;
        gap: 16px;
        scroll-snap-type: x mandatory;
        padding: 16px;
        
        /* FIX 1: Prevents cards from stretching vertically to match the tallest card */
        align-items: flex-start; 
    }

    .card {
        /* FIX 2: Locks the width completely. 0 shrink, 0 grow, explicitly fixed at 75% viewport width */
        flex: 0 0 75%;
        min-width: 75%; 
        max-width: 75%;
        
        /* FIX 3: Ensures the height adapts neatly to internal content without rubber banding */
        height: auto; 
        
        scroll-snap-align: start;
        text-decoration: none;
    }

    /* FIX 4: Prevents long titles/text strings from forcing the card wider */
    .card-title, 
    .card-text {
        width: 100%;
        white-space: normal; /* Allows normal line wrapping */
        word-break: break-word; /* Snaps long words so they don't push margins */
    }
    
    .card-title {
        /* Keeps the ellipsis styling working correctly inside fixed width */
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap; 
    }

    /* Hide scrollbars but keep functionality */
    .cards-container::-webkit-scrollbar {
        display: none;
    }
    .cards-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ==========================================================================
   FINAL TITLE STYLE
   ========================================================================== */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #008080;
    margin: 24px 16px 16px 16px;
    text-align: center;
}