:root {}

/* main card – clean container */
.categories-section {
    width: 100%;
    padding-top: 25px;
    margin: 0 auto;
    max-width: 1400px;
    overflow: hidden;
}


.featured-categories.on-home {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 10px 5px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    max-width: 1400px;
    margin: auto;
    margin-top: 1rem;

}

/* category card – refined interactive tile */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1rem;
    background: #ffffff;
    border-radius: .1rem;
    text-decoration: none;
    color: #141b34;
    transition: all 0.25s ease;
    position: relative;
    backdrop-filter: blur(2px);
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    width: 180px;
}

.category-item:nth-child(10n+1) {
    background: radial-gradient(#f9fafc, #e9f0ff);
}

.category-item:nth-child(10n+2) {
    background: radial-gradient(#fff7f7, #ffe3e3);
}

.category-item:nth-child(10n+3) {
    background: radial-gradient(#f4fff8, #dff7e8);
}

.category-item:nth-child(10n+4) {
    background: radial-gradient(#f5fbff, #dff1ff);
}

.category-item:nth-child(10n+5) {
    background: radial-gradient(#fffaf4, #ffe8cc);
}

.category-item:nth-child(10n+6) {
    background: radial-gradient(#f8f5ff, #e4dcff);
}

.category-item:nth-child(10n+7) {
    background: radial-gradient(#f2fffd, #d6f5f1);
}

.category-item:nth-child(10n+8) {
    background: radial-gradient(#fff3fb, #ffd9ef);
}

.category-item:nth-child(10n+9) {
    background: radial-gradient(#f4fff4, #dbf5db);
}

.category-item:nth-child(10n+10) {
    background: radial-gradient(#f7f7f7, #e5e5e5);
}

/* icon container – soft gradient background */
.category-icon {
    width: 3.8rem;
    height: 3.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

/* icon itself (phosphor) */
.category-icon i {
    font-size: 2.1rem;
    line-height: 1;
}

/* middle area – title + count */
.category-body {
    flex: 1;
}

.category-title {
    font-size: .8rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: #0f182c;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.category-count {
    font-size: 0.65rem;
    font-weight: 480;
    color: #596780;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/* subtle bullet / item indicator */
.category-count::before {
    content: "•";
    color: #9aa9c1;
    font-weight: 600;
    margin-right: 0.2rem;
    opacity: 0.8;
}

/* caret – animated on hover */
.ph-caret-right {
    font-size: 1.4rem;
    color: #8a99bb;
    transition: 0.2s ease;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.category-item:hover .ph-caret-right {
    transform: translateX(5px) scale(1.1);
    color: #3f5b9e;
    opacity: 1;
}

/* preserve thin style for all icons (already thin by default) */
.ph-thin {
    font-variation-settings: 'wght' 100;
}

/* dynamic counts via placeholders – showing dummy numbers for preview */
/* we replace <?php ... ?> with static realistic values, 
           but keep the original syntax visible as comments (to respect your structure) 
           and also display fallback numbers for the design demo */
.category-count span {
    font-weight: 600;
    color: #1f2b48;
    background: #f0f4fe;
    padding: 0.1rem 0.4rem;
    border-radius: 30px;
    margin-left: 0.25rem;
}

/* demo adaptation: shows the php-like placeholders + example numbers (just for preview) */
.category-count .demo-value {
    background: #eef2f8;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1d2b44;
}

/* style for the optional note (demo) */
.demo-hint {
    font-size: 0.75rem;
    color: #8f9bb3;
    margin-top: 1.75rem;
    text-align: center;
    border-top: 1px dashed #cfddee;
    padding-top: 1.2rem;
    letter-spacing: 0.2px;
}

.demo-hint code {
    background: #e4ebf5;
    padding: 0.2rem 0.5rem;
    border-radius: 40px;
    font-family: 'JetBrains Mono', monospace;
    color: #32537e;
}

/* small screens fine-tuning */
@media (max-width: 550px) {
    .featured-categories.on-home {
        padding-left: 0;
        gap: .5rem;
    }

    .categories-section {
        padding: 1.5rem 1rem;
        border-radius: 2rem;
    }

    .category-item {
        padding: 1rem 1.2rem;
        width: 130px;
    }

    .category-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.8rem;
    }
}

/* 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: 150px;
    height: 100%;
    align-items: center;
    padding: 10px 15px;
    text-align: left;
    padding-left: 0px;
    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: 1400px;
    /* height: 430px; */
    opacity: 0;
    overflow: scroll;
    display: none;
    transition: all 0.3s ease;
}

.categories-dropdown._active {
    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;
    transition: background-color 0.2s ease;
    font-size: 0.8rem;
}

.parent-category:hover,
.parent-category._active {
    background-color: #f3f4f6;
    color: var(--mzansi-orange);
}

.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(--mzansi-orange);
}

.child-category span {
    color: var(--accent-color);
    font-size: 0.6rem;
}

/* Mobile Styles */
@media (max-width: 769px) {

    .nav-container {
        padding: 0px;
    }

    .navbar {
        width: 100%;
    }

    /* Dropdown Container */
    .browse-all-container {
        overflow-y: hidden;
        width: 100%;
    }

    .browse-all-btn {
        font-size: 0.875rem;
        padding: 0.75rem;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .categories-dropdown {
        position: static;
        border: none;
        box-shadow: none;
        background-color: transparent;
        width: 100%;
        border-radius: 0rem;
    }

    .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 .5rem;
        margin-bottom: 0.5rem;
        border-radius: 0rem;
        display: flex;
        font-weight: 400;
        justify-content: space-between;
        align-items: center;
        box-shadow: none;
        border-bottom: 1px solid lightgray;
        font-size: 0.765rem;
    }

    .parent-category i {
        transition: transform 0.3s ease;
    }

    .parent-category._active i {
        transform: rotate(180deg);
    }

    .child-categories {
        display: none;
        padding: 0px;
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .child-categories._active {
        display: block;
    }

    .child-category a {
        padding: 0.75rem 0;
        font-size: 0.665rem;
        padding: .5rem 1rem;
    }

    .child-categories-column {
        border: none;
    }
}