/* ========================================
   SHOPEE HOME STYLE - MODERN & SMOOTH
======================================== */

:root {
    --shopee-primary: #ee4d2d;
    --shopee-secondary: #ff6b35;
    --shopee-dark: #333333;
    --shopee-light: #f5f5f5;
    --shopee-border: #e5e5e5;
    --shopee-text: #555555;
    --shopee-gradient: linear-gradient(135deg, #ee4d2d, #ff6b35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FIX: Remove gap between navbar and content */
.mobile-top-header {
    margin-bottom: 0 !important;
}

.alert-wrapper {
    margin-top: 0 !important;
    padding-top: 12px;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: var(--shopee-text);
    margin: 0;
    padding: 0;
}

.shopee-container {
    background: #fff;
    min-height: 100vh;
    padding-bottom: 80px;
    margin: 0;
    padding-top: 0;
}

/* ========================================
   HEADER SHOPEE STYLE
======================================== */
.shopee-header {
    background: var(--shopee-gradient);
    padding: 16px;
    position: relative;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.15);
    margin: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar,
.user-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar-placeholder {
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.greeting {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.username {
    font-size: 15px;
    color: white;
    font-weight: 600;
    margin: 0;
}

.header-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
}

/* ========================================
   SEARCH BAR SHOPEE
======================================== */
.shopee-search-section {
    padding: 12px 16px 12px 16px;
}

.shopee-search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.shopee-search-bar:focus-within {
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.2);
}

.shopee-search-bar .search-icon {
    color: var(--shopee-text);
    font-size: 16px;
    margin-right: 8px;
}

.shopee-search-bar .search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--shopee-dark);
}

.shopee-search-bar .search-input::placeholder {
    color: #999;
}

.shopee-search-bar .search-btn {
    background: none;
    border: none;
    color: var(--shopee-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.shopee-search-bar .search-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   BANNER SLIDER
======================================== */
.shopee-banner-section {
    padding: 12px 16px;
    position: relative;
    margin: 0;
    background: white;
}

.banner-slider {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.banner-slide.active {
    opacity: 1;
}

.banner-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.banner-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.banner-content p {
    font-size: 14px;
    opacity: 0.95;
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dot.active {
    background: var(--shopee-primary);
    width: 20px;
    border-radius: 4px;
}

/* ========================================
   CATEGORIES GRID SHOPEE
======================================== */
.shopee-categories {
    padding: 16px;
    background: white;
    margin: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: center;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-4px);
}

.category-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffebe6, #fff0ec);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.1);
}

.category-item.active .category-icon-box {
    background: var(--shopee-gradient);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.category-icon-box i {
    font-size: 24px;
    color: var(--shopee-primary);
}

.category-item.active .category-icon-box i {
    color: white;
}

.category-icon-box img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

/* Badge jumlah sub-kategori */
.category-icon-box {
    position: relative;
}

.category-children-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--shopee-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(238, 77, 45, 0.4);
    line-height: 1;
}

.category-name {
    font-size: 12px;
    color: var(--shopee-dark);
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.category-item.active .category-name {
    color: var(--shopee-primary);
    font-weight: 600;
}

/* ========================================
   SUB-CATEGORIES CHIPS
======================================== */
.shopee-subcategories {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--shopee-border);
    margin: 0;
    scrollbar-width: none; /* Firefox */
}
.shopee-subcategories::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.subcat-chip {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--shopee-light);
    color: var(--shopee-text);
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--shopee-border);
    transition: all 0.3s ease;
}

.subcat-chip:hover {
    background: #fff0ec;
    color: var(--shopee-primary);
    border-color: var(--shopee-primary);
}

.subcat-chip.active {
    background: var(--shopee-primary);
    color: white;
    border-color: var(--shopee-primary);
    font-weight: 500;
}

/* ========================================
   TABS SHOPEE
======================================== */
.shopee-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--shopee-border);
    padding: 0 16px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 90;
    margin: 0;
}

.tab-item {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--shopee-text);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-item i {
    font-size: 16px;
}

.tab-item:hover {
    color: var(--shopee-primary);
}

.tab-item.active {
    color: var(--shopee-primary);
    border-bottom-color: var(--shopee-primary);
    font-weight: 600;
}

/* ========================================
   PRODUCTS GRID SHOPEE
======================================== */
.shopee-products {
    padding: 12px 16px;
    background: var(--shopee-light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.product-card-shopee {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card-shopee:hover {
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.15);
    transform: translateY(-2px);
}

/* Product Card Content (overrides) */
.product-card-shopee .card-img-top {
    height: 180px;
    object-fit: cover;
    border-radius: 0;
}

.product-card-shopee .product-image-placeholder {
    height: 180px;
    background: linear-gradient(135deg, #ffebe6, #fff0ec);
}

.product-card-shopee .product-body {
    padding: 12px;
}

.product-card-shopee .product-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--shopee-dark);
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 8px;
}

.product-card-shopee .price {
    font-size: 16px;
    color: var(--shopee-primary);
    font-weight: 600;
    margin-top: 8px;
}

.product-card-shopee .shop-name {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* Product Badge */
.product-card-shopee .product-category-badge {
    position: absolute;
    top: 8px;
    left: 0;
    background: rgba(238, 77, 45, 0.9);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
}

/* ========================================
   EMPTY STATE
======================================== */
.empty-state-shopee {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state-shopee i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state-shopee h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--shopee-dark);
    margin-bottom: 8px;
}

.empty-state-shopee p {
    font-size: 14px;
    color: var(--shopee-text);
}

/* ========================================
   PAGINATION
======================================== */
.shopee-pagination {
    margin-top: 16px;
}

.pagination-modern {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination-modern .page-item .page-link {
    min-width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid var(--shopee-border);
    background: white;
    color: var(--shopee-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-modern .page-item.active .page-link {
    background: var(--shopee-gradient);
    color: white;
    border-color: var(--shopee-primary);
}

.pagination-modern .page-item .page-link:hover {
    border-color: var(--shopee-primary);
    color: var(--shopee-primary);
}

.pagination-modern .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ========================================
   BACK TO TOP BUTTON
======================================== */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--shopee-gradient);
    color: white;
    border: none;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(238, 77, 45, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.product-card-shopee {
    animation: slideInUp 0.4s ease forwards;
}

.category-item {
    animation: fadeIn 0.5s ease forwards;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 375px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-icon-box {
        width: 48px;
        height: 48px;
    }
    
    .category-icon-box i {
        font-size: 20px;
    }
}

/* ========================================
   SMOOTH SCROLLING
======================================== */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.category-grid::-webkit-scrollbar,
.products-grid::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.category-grid,
.products-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}