/* ===================================
   HOME KATEGORI SECTION - SHOPEE STYLE
   =================================== */

/* Section wrapper */
.kategori-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header styling */
.kategori-wrapper .row.align-center h3 {
    font-size: 18px !important;
    font-weight: 600;
    color: #ee4d2d;
    margin: 0;
    display: flex;
    align-items: center;
}

.kategori-wrapper .row.align-center h3 i {
    font-size: 16px;
    margin-right: 8px;
}

.kategori-wrapper .fs-18 a {
    font-size: 14px !important;
    color: #05a;
    text-decoration: none;
    font-weight: 500;
}

.kategori-wrapper .fs-18 a:hover {
    color: #ee4d2d;
    text-decoration: underline;
}

/* Grid kategori desktop - 8 columns with auto-centering */
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 12px;
    padding: 0;
    justify-content: center;
    justify-items: center;
    max-width: 100%;
    margin: 0 auto;
}

/* Auto-center incomplete rows */
.kategori-grid .kategori-item:nth-last-child(-n+7):nth-child(8n+1) {
    grid-column-start: 2;
}
.kategori-grid .kategori-item:nth-last-child(-n+6):nth-child(8n+1) {
    grid-column-start: 2;
}
.kategori-grid .kategori-item:nth-last-child(-n+5):nth-child(8n+1) {
    grid-column-start: 2;
}
.kategori-grid .kategori-item:nth-last-child(-n+4):nth-child(8n+1) {
    grid-column-start: 3;
}
.kategori-grid .kategori-item:nth-last-child(-n+3):nth-child(8n+1) {
    grid-column-start: 3;
}
.kategori-grid .kategori-item:nth-last-child(-n+2):nth-child(8n+1) {
    grid-column-start: 4;
}
.kategori-grid .kategori-item:nth-last-child(-n+1):nth-child(8n+1) {
    grid-column-start: 4;
}

/* Item kategori */
.kategori-item {
    background: #fff;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f5f5f5;
    width: 100%;
    max-width: 140px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.kategori-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ee4d2d;
}

/* Icon container */
.cat-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    overflow: hidden;
    flex-shrink: 0;
}

.cat-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Nama kategori */
.cat-name {
    font-size: 11px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    text-align: center;
    margin: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mobile slider */
.slide-kategori.swiper {
    padding: 0 16px;
}

.slide-kategori .swiper-slide {
    width: auto !important;
    margin-right: 12px;
}

.slide-kategori .kategori-item {
    width: 80px;
    min-height: 100px;
    padding: 12px 8px;
}

.slide-kategori .cat-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.slide-kategori .cat-icon img {
    width: 28px;
    height: 28px;
}

.slide-kategori .cat-name {
    font-size: 11px;
    line-height: 1.2;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .kategori-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
    }
}

@media (max-width: 992px) {
    .kategori-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .kategori-item {
        min-height: 110px;
        padding: 14px 10px;
    }
    
    .cat-icon {
        width: 56px;
        height: 56px;
    }
    
    .cat-icon img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 768px) {
    .kategori-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .kategori-item {
        min-height: 100px;
        padding: 12px 8px;
    }
    
    .cat-icon {
        width: 52px;
        height: 52px;
    }
    
    .cat-name {
        font-size: 12px;
    }
}

/* Hide/show classes */
@media (max-width: 600px) {
    .hidesmall {
        display: none !important;
    }
    
    .showsmall {
        display: block !important;
    }
    
    .kategori-wrapper .fs-18 a {
        font-size: 12px !important;
    }
    
    .kategori-wrapper h3 {
        font-size: 16px !important;
    }
}

@media (min-width: 601px) {
    .showsmall {
        display: none !important;
    }
}

/* Color variations for icons */
.cat-icon.variant-1 { background: linear-gradient(135deg, #ffeaa7, #fab1a0); }
.cat-icon.variant-2 { background: linear-gradient(135deg, #a8e6cf, #81c784); }
.cat-icon.variant-3 { background: linear-gradient(135deg, #ffb3ba, #ff8a95); }
.cat-icon.variant-4 { background: linear-gradient(135deg, #bae1ff, #64b5f6); }
.cat-icon.variant-5 { background: linear-gradient(135deg, #e1bee7, #ba68c8); }
.cat-icon.variant-6 { background: linear-gradient(135deg, #f8d7da, #f5c6cb); }
