:root {
    --card-bg: #ffffff;
    --accent-color: #6b7280;
}


.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* Featured Categories */
.featured-categories {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); */
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    max-width: 1420px;
    margin: auto;
}

.featured-categories.on-home {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-y: auto;
    padding: 0rem;
    padding-top: 2rem;
    padding-bottom: 5px;

    .category-item {
        flex: 0 0 auto;
        /* Don't grow, don't shrink, auto basis */
        width: 220px;
        /* Fixed width for each item */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 25px 15px;
        gap: 15px;
        border-radius: 10px;
        background-color: white;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .category-icon {
        i {
            font-size: 2.5rem;
        }
    }

    .category-title {
        font-weight: 500;
        font-size: .8rem;
    }


    .category-count {
        color: #6b7280;
        font-size: 0.765rem;
    }
}

/* Scrollable alerts if too many */
.featured-categories.on-home {
    max-height: 400px;
    overflow-y: auto;
}

.featured-categories.on-home::-webkit-scrollbar {
    height: 6px;
    display: none;
}

.featured-categories.on-home::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.featured-categories.on-home::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}


.category-card {
    /* 
    border-radius: 0.5rem; */
    overflow: hidden;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;

    a {
        text-decoration: none;
        color: inherit;
    }
}

.category-image {
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.152) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-content {
    padding: 1rem;
    background-color: white;
}

.category-title {
    font-weight: 500;
    /* 
    margin-bottom: 0.5rem; */
    font-size: 1.1rem;
}

.c-c-combo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;

    i {
        color: var(--primary-color);
        font-size: 1.8rem;
    }
}

.category-count {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive */
/* @media (max-width: 768px) {
    .mobile-categories {
        display: block;
    }

    .featured-categories {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }

    .category-image {
        height: 120px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-template-columns: repeat(6, 1fr);
    }
} */

@media (max-width: 480px) {
    .featured-categories {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-image {
        height: 150px;
    }

    .category-content {
        padding: 0.75rem;
    }

    .category-title {
        font-size: 1rem;
    }
}


/* Dropdown Container */
.browse-all-container {
    position: relative;
    /*  overflow-y: scroll; */
}

.browse-all-btn {
    /*  border: 1px solid lightgrey; */
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--black);
    background-color: inherit;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.browse-all-btn:hover {
    background-color: #f3f4f6;
}

.browse-all-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.browse-all-btn._active i {
    transform: rotate(180deg);
}

/* Dropdown Menu - Large Screens */
.categories-dropdown {
    position: absolute;
    top: 0%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid lightgray;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 0;
    width: calc(98vw);
    /* height: 430px; */
    opacity: 0;
    overflow: scroll;
    display: none;
    transition: all 0.3s ease;
}

.categories-dropdown._active {
    height: fit-content;
    height: fit-content;
    max-height: 600px;
    opacity: 1;
    overflow: visible;
    display: grid;
}

.dropdown-content {
    display: flex;
    gap: 2rem;
}

.parent-categories {
    flex: 0 0 250px;
    border-right: 1px solid lightgray;
    padding: .5rem 1rem;
}

.parent-category {
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    font-size: 0.8rem;
}

.parent-category:hover,
.parent-category._active {
    background-color: #f3f4f6;
    color: var(--primary-color);
}

.child-categories {
    flex: 1;
    display: none;
    /* grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); */
    gap: 1rem;
    padding: 1rem 0;

}

.child-categories:first-child {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
}

.child-categories._active {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Each column */
.child-categories-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
    border-right: 1px solid lightgray;
    height: 100%;
}

.child-categories-column:last-child {
    border-right: none;
}

.child-category a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.child-category a:hover {
    color: var(--primary-color);
}

.child-category span {
    color: var(--accent-color);
    font-size: 0.6rem;
}

/* Mobile Styles */
@media (max-width: 769px) {

    /* Dropdown Container */
    .browse-all-container {
        overflow-y: hidden;
    }

    .browse-all-btn {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .categories-dropdown {
        position: static;
        border: none;
        box-shadow: none;
        background-color: transparent;
    }

    .dropdown-content {
        padding: 0;
        flex-direction: column;
        overflow: scroll;
        max-height: inherit;
    }

    .parent-categories {
        border-right: none;
        padding: 0;
    }

    .parent-category {
        /* background-color: var(--card-bg); */
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .parent-category i {
        transition: transform 0.3s ease;
    }

    .parent-category._active i {
        transform: rotate(180deg);
    }

    .child-categories {
        display: none;
        padding: 1rem;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .child-categories._active {
        display: block;
    }

    .child-category a {
        padding: 0.75rem 0;
        font-size: 0.875rem;
    }

    .child-categories-column {
        border: none;
    }
}