/* ===========================
   CATEGORY SECTION (GLOBAL)
   =========================== */
.categories {
    padding: 0;
    margin-top: 8px;
    background: linear-gradient(
        135deg,
        rgba(255, 154, 158, 0.25),
        rgba(250, 208, 196, 0.25),
        rgba(161, 196, 253, 0.25),
        rgba(194, 233, 251, 0.25)
    ), #f8fafc;
}

.categories .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 22px;
    text-align: center;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    font-family: "Inter", sans-serif;
}

/* ===========================
   GRID SYSTEM
   =========================== */
.categories-wrapper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* Mobile: 5 columns */
    gap: 10px;
    justify-items: center;
    width: 100%;
    padding: 0 6px;
    overflow: hidden;
}

/* ===========================
   DESKTOP: STRICT 10x1
   =========================== */
@media (min-width: 992px) {
    .categories-wrapper {
        grid-template-columns: repeat(10, minmax(0, 1fr)); /* 10 columns */
        grid-template-rows: 1fr; /* Only 1 row */
        max-height: none;
    }
}

/* ===========================
   MOBILE: STRICT 5x2
   =========================== */
@media (max-width: 991px) {
    .categories-wrapper {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        max-height: calc(2 * 110px); /* limit to 2 rows */
    }
}

/* ===========================
   CATEGORY CARD
   =========================== */
.category-card {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    width: 100%;
    max-width: 100%; /* prevent overflow */
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 18px;
    padding: 8px 2px;
}

.category-card:hover {
    transform: translateY(-5px);
}

/* ===========================
   IMAGE BOX (AUTO SCALE)
   =========================== */
.category-card .image-box {
    width: 100%;
    max-width: 78px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: #f5f6f8;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-card img {
    width: 75%;
    height: 75%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.category-card:hover img {
    transform: scale(1.15);
}

/* ===========================
   CATEGORY TEXT
   =========================== */
.category-card span {
    background: #f4f4f6;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-top: 6px;
    display: block;
    max-width: 90px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Inter", sans-serif;
}

.category-card:hover span {
    color: #2563eb;
}

/* ===========================
   SMALL MOBILE OPTIMIZATION
   =========================== */
@media (max-width: 480px) {
    .categories-wrapper {
        gap: 8px;
        padding: 0 4px;
    }

    .category-card .image-box {
        max-width: 60px;
    }

    .category-card span {
        font-size: 12px;
    }
}