.categories {
    position: sticky;
    top: 0;
    display: flex;
    gap: 10px;
    padding: 8px;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    background: #fff;
    z-index: 2;
}


.categories::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.categories::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.categories::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 6px;
}

.cat {
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 13px
}
.cat.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: bold;
}
.section {
    padding: 0 ;
}
.section-title {
    font-size: 20px;
    font-weight: bold;
    margin: 16px 0;
}
.product-card {
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: 0.2s;
    z-index: 1;
    position: relative;
}

.product-card:hover {
    scale: 1.01;
    z-index: 1;
}

.product-card .product-image-container {
    width: 80px;
    border: 1px solid #ccc;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    padding: 2px;

}

.product-card .product-content-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card .product-content-container .product-price{
    color: var(--primary-color)
}



.product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    height: auto;
    border-radius: 6px;
}
.product-title {
    font-weight: bold;
    margin-bottom: 5px;
}
.product-price {
    color: #555;
}
.product-desc {
    color: #777;
    font-size: 14px;
    line-height: 1.3;
}


.products-container.grid {
    display: grid;
    grid-template-columns: repeat(6,1fr);
    gap: 10px
}

.products-container.grid .product-card {
    padding: 0;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column-reverse;
    align-items: start;
    justify-content: start;
    cursor: pointer;
    transition: 0.2s;
    z-index: 1;
    position: relative;
}

.products-container.grid .product-card .product-image-container {
    width: 100%;
    border: none;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0;
    padding: 2px;
    flex-shrink: 0;
}

.products-container.grid .product-card .product-content-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    padding: 8px;
    height: 100%;
}

.products-container.grid .product-card .product-content-container .product-price{
    font-size: 18px;
    font-weight: 600;
}

@media(max-width: 900px){
    .products-container.grid {
        display: grid;
        grid-template-columns: repeat(2,1fr);
        gap: 10px
    }  
}

/* ============================================================
   HIERARCHICAL MODE — two-bar parent / child navigation
   ============================================================ */

.hierarchical-menu .parent-categories {
    position: sticky;
    top: 0;
    z-index: 3;
}

.hierarchical-menu .sub-categories {
    position: sticky;
    top: 40px;
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    overflow-x: auto;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    z-index: 2;
    max-height: 42px;
    transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
    opacity: 1;
}

.hierarchical-menu .sub-categories[style*="display: none"],
.hierarchical-menu .sub-categories:empty {
    max-height: 0;
    opacity: 0;
    padding: 0 8px;
    border-bottom: none;
    overflow: hidden;
}

.hierarchical-menu .sub-categories::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.hierarchical-menu .sub-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}
.hierarchical-menu .sub-categories::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

.hierarchical-menu .sub-cat {
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 12px;
}

.hierarchical-menu .sub-cat.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: bold;
}

.hierarchical-menu .parent-group {
    margin-bottom: 4px;
}