:root {
  
    --primary-green: #10b981;
    --primary-green-dark: #059669;
    --primary-green-light: #34d399;
    --accent-green: #6ee7b7;
    --dark-green: #065f46;
    
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    --background: #f0fdf4;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-white: #ffffff;
    --border-color: #d1fae5;
    
    --shadow-sm: 0 1px 2px 0 rgba(16, 185, 129, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(16, 185, 129, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(16, 185, 129, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(16, 185, 129, 0.2);
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    --header-height: 60px;
    --bottom-nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.logo-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.logo-text {
    color: var(--text-white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-white);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.cart-btn .badge,
.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: var(--text-white);
    border-radius: var(--radius-full);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.banner-section {
    background: transparent;
    padding: var(--spacing-sm) 0;
}

.banner-carousel {
    position: relative;
    overflow: hidden;
    height: 180px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 0 15px;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    border-radius: var(--radius-lg);
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.banner-indicators-external {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 5px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1; 
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--primary-green);
    width: 24px;
    border-radius: 4px;
}

.categories-section {
    background: var(--card-bg);
    padding: var(--spacing-md) 0;
    margin: var(--spacing-sm) 15px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 5px 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-item:hover {
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-3px);
}

.category-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green-light), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-white);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}

.category-item:hover .category-icon {
    box-shadow: var(--shadow-lg);
    transform: scale(1.1);
}

.category-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--primary-green-light));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.category-item:hover .category-icon::before {
    opacity: 0.3;
}

.category-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.category-name {
    font-size: 12px;
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flashsale-section,
.products-section {
    background: var(--card-bg);
    margin: var(--spacing-sm) 15px;
    padding: var(--spacing-md) 15px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary-green);
    -webkit-text-fill-color: var(--primary-green);
    background: none;
}

.see-all {
    font-size: 13px;
    color: var(--primary-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.see-all:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateX(3px);
}

.products-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green-light) var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.products-carousel::-webkit-scrollbar {
    height: 5px;
}

.products-carousel::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

.products-carousel::-webkit-scrollbar-thumb {
    background: var(--primary-green-light);
    border-radius: var(--radius-full);
}

.products-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

.product-card-scroll {
    min-width: 150px;
    max-width: 150px;
    flex-shrink: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card,
.product-card-scroll {
    background: var(--card-bg);
    border-radius: 5px;            
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}

.product-card::before,
.product-card-scroll::before {
    display: none;                
}

.product-card:hover::before,
.product-card-scroll:hover::before {
    transform: scaleX(1);
}

.product-card:hover,
.product-card-scroll:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: linear-gradient(135deg, #f0fdf4, #d1fae5);
    overflow: hidden;
    border-radius: 5px;            
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 5px;            
}

.product-card:hover .product-image img,
.product-card-scroll:hover .product-image img {
    transform: scale(1.08);
}

.discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: var(--text-white);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 36px;
}

.product-price {
    margin-bottom: 6px;
}

.price-original {
    font-size: 10px;
    color: var(--text-secondary);
    text-decoration: line-through;
    display: block;
    margin-bottom: 3px;
}

.price-discount,
.price-normal {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.product-rating {
    color: var(--warning-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -4px 6px -1px rgba(16, 185, 129, 0.1);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 0;
    z-index: 100;
    height: var(--bottom-nav-height);
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-green);
    border-radius: 0 0 3px 3px;
    transition: width 0.3s ease;
}

.nav-item.active::before,
.nav-item:hover::before {
    width: 50%;
}

.nav-item i {
    font-size: 22px;
    transition: all 0.3s ease;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary-green);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-green);
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    pointer-events: none;
}

.side-menu.active {
    pointer-events: all;
}

.side-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.side-menu.active .side-menu-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.side-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--card-bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.side-menu.active .side-menu-content {
    transform: translateX(0);
}

.side-menu-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    padding: var(--spacing-lg) var(--spacing-md);
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}

.side-menu-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details h3 {
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details p {
    font-size: 13px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guest-info {
    text-align: center;
    position: relative;
    z-index: 1;
}

.guest-info h3 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
}

.guest-info p {
    font-size: 13px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.side-menu-list {
    list-style: none;
    padding: var(--spacing-sm) 0;
}

.side-menu-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.side-menu-list li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(16, 185, 129, 0.1);
    transition: width 0.3s ease;
}

.side-menu-list li a:hover::before {
    width: 100%;
}

.side-menu-list li a:hover {
    color: var(--primary-green);
    border-left-color: var(--primary-green);
    padding-left: calc(var(--spacing-md) + 8px);
}

.side-menu-list li a i {
    width: 20px;
    font-size: 18px;
    color: var(--primary-green);
    transition: transform 0.3s ease;
}

.side-menu-list li a:hover i {
    transform: scale(1.2);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: var(--text-white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

@media (min-width: 640px) {
    .banner-carousel {
        height: 220px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
    
    .category-name {
        font-size: 13px;
    }
    
    .product-card-scroll {
        min-width: 170px;
        max-width: 170px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

@media (min-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .header-content {
        padding: 12px 20px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .icon-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .banner-carousel {
        height: 280px;
        margin: 0 20px;
    }
    
    .categories-section,
    .flashsale-section,
    .products-section {
        margin: var(--spacing-md) 20px;
        padding: var(--spacing-lg) 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .product-card-scroll {
        min-width: 180px;
        max-width: 180px;
    }
    
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

@media (min-width: 1024px) {
    body {
        padding-bottom: var(--spacing-md);
    }
    
    .banner-carousel {
        height: 350px;
    }
    
    .categories-section,
    .flashsale-section,
    .products-section {
        margin: var(--spacing-lg) auto;
        max-width: 1200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .product-card-scroll {
        min-width: 200px;
        max-width: 200px;
    }
    
    .bottom-nav {
        display: none;
    }
}

@media (min-width: 1280px) {
    .banner-carousel {
        height: 400px;
    }
    
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.product-card-scroll,
.category-item {
    animation: fadeInUp 0.5s ease;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }

.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

#loadMoreSentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    grid-column: 1 / -1;         /* span semua kolom grid */
}
 
#loadMoreSpinner {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}
 
#loadMoreEnd {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}