/* ------------------------------------------------------------------
 * 1. Reset dan Variabel CSS (Custom Properties) - UPGRADED
 * ------------------------------------------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; 
}

:root {
    --primary-red: #e31837;
    --secondary-red: #c4162f;
    --blue: #0066cc;
    --dark-blue: #004d99;
    --green: #00a650;
    --yellow: #ffc400;
    --orange: #ff6b00;
    --purple: #6a0dad;
    --bg-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --white: #ffffff;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.15);
    --border-radius-sm: 6px;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: all 0.15s ease;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
}

/* Improved focus styles for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

input, select, textarea {
    font-size: 16px;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================================== */
/* TOP BAR STYLES (White + Shadow + Gradient Outline) */
/* ==================================== */
.top-bar {
    background-color: var(--white); 
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1;
}

.top-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to right, 
        var(--primary-red), 
        var(--secondary-red), 
        var(--blue)
    );
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px; 
}

.top-bar-contact a {
    margin-right: 15px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition-fast);
}
.top-bar-contact a:hover {
    color: var(--primary-red);
}
.top-bar-contact i {
    margin-right: 4px;
    color: var(--text-light);
}

.top-bar-saldo span {
    font-weight: 600;
    color: var(--primary-red);
}

/* ------------------------------------------------------------------
 * 2. Header Styles - SUPER COMPACT & OPTIMIZED
 * ------------------------------------------------------------------ */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header .container {
    padding: 0 16px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.logo {
    flex-shrink: 0;
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-red);
    background: linear-gradient(135deg, var(--primary-red), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 10px 48px 10px 16px;
    border: 1.5px solid var(--border-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-gray);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(227, 24, 55, 0.1);
}

.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--secondary-red);
    transform: translateY(-50%) scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
    color: var(--text-dark);
}

.action-item:hover {
    color: var(--primary-red);
    background: rgba(227, 24, 55, 0.05);
    transform: translateY(-1px);
}

.action-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--white);
}

.download-app {
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.download-app:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Navigation - ULTRA COMPACT */
.main-nav {
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border-gray);
    overflow-x: auto;
    padding: 4px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 11px;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
    border-radius: 4px;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--primary-red);
    background: rgba(227, 24, 55, 0.05);
}

.nav-item.active {
    color: var(--primary-red);
    font-weight: 700;
    background: rgba(227, 24, 55, 0.08);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 1px;
    background: var(--primary-red);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

/* Cashback Banner - OPTIMIZED */
.cashback-banner {
    background: linear-gradient(135deg, var(--primary-red), var(--purple));
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-medium);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.cashback-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 16px 16px;
    transform: rotate(30deg);
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: rotate(30deg) translateX(0); }
    100% { transform: rotate(30deg) translateX(-16px); }
}

.cashback-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.cashback-text {
    flex: 1;
}

.cashback-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 2px;
}

.cashback-desc {
    font-size: 12px;
    opacity: 0.9;
}

.copy-btn {
    background: var(--white);
    color: var(--primary-red);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: var(--shadow-light);
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Sections General - OPTIMIZED */
.section-wrapper {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.section-wrapper:hover {
    box-shadow: var(--shadow-medium);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--primary-red);
    border-radius: var(--border-radius-sm);
}

.see-all {
    color: var(--primary-red);
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.see-all:hover {
    color: inherit;
    transform: none;
}

/* Categories Grid - OPTIMIZED */
.categories {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 10px 6px;
    border-radius: var(--border-radius-sm);
    color: var(--text-dark);
    background: var(--white);
    transition: transform 0.25s ease;
}

.category:hover {
    transform: scale(1.05);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--white);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 20px;
    color: var(--primary-red);
    box-shadow: var(--shadow-light);
    transition: transform 0.25s ease;
}

.category:hover .category-icon {
    transform: scale(1.1);
}

.category-name {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

/* Flash Sale - OPTIMIZED */
.flashsale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-gray);
}

.flashsale-title {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    color: var(--primary-red);
    gap: 10px;
}

.flashsale-badge {
    background: linear-gradient(135deg, var(--orange), var(--primary-red));
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 800;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.countdown {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--orange);
    font-weight: 700;
    gap: 6px;
}

.countdown-timer {
    background: var(--orange);
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-family: 'Courier New', monospace;
    font-weight: 800;
    box-shadow: var(--shadow-light);
}

/* Products Container (Horizontal Scroll) - OPTIMIZED */
.products-wrapper {
    position: relative;
    padding: 0 16px;
}

.products, .special-deals, .brand-deals {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 12px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0;
}

.products::-webkit-scrollbar, 
.special-deals::-webkit-scrollbar, 
.brand-deals::-webkit-scrollbar {
    display: none;
}

.product-card, .deal-card, .brand-card {
    flex-shrink: 0;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    background: var(--white);
    white-space: normal;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.product-card:hover,
.deal-card:hover,
.brand-card:hover {
    box-shadow: none;
    transform: none;
}

.product-card { width: 200px; }
.deal-card { width: 240px; }
.brand-card { width: 220px; }

/* Scroll button (desktop only) - OPTIMIZED */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-dark);
    box-shadow: var(--shadow-heavy);
    z-index: 10;
    transition: var(--transition);
    opacity: 0.9;
}

.scroll-btn:hover {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.scroll-btn.left {
    left: -8px;
}

.scroll-btn.right {
    right: -8px;
}

.product-image {
    width: 100%;
    height: 120px;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-red);
    color: var(--white);
    padding: 3px 6px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 800;
    z-index: 2;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 13px;
    margin-bottom: 6px;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    font-weight: 600;
}

.product-price {
    font-weight: 800;
    color: var(--primary-red);
    font-size: 14px;
    margin-bottom: 2px;
}

.product-original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 11px;
    margin-bottom: 6px;
}

.product-rating {
    display: flex;
    align-items: center;
    font-size: 10px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.rating-stars {
    color: var(--yellow);
    margin-right: 4px;
}

.product-sold {
    margin-left: 4px;
}

.buy-now {
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: var(--white);
    border: none;
    width: 100%;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.buy-now:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* Popular Categories - OPTIMIZED */
.popular-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.popular-category {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.popular-category:hover {
    box-shadow: var(--shadow-heavy);
    transform: translateY(-1px);
    border-color: var(--primary-red);
}

.popular-category-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-red), var(--purple));
    color: var(--white);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
    transition: var(--transition);
}

.popular-category:hover .popular-category-icon {
    transform: scale(1.05) rotate(3deg);
}

.popular-category-info {
    flex: 1;
}

.popular-category-name {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.popular-category-discount {
    font-size: 12px;
    color: var(--primary-red);
    font-weight: 700;
}

/* Special Deals & Brand Deals - OPTIMIZED */
.deal-card .product-image {
    height: 140px;
}

.deal-card .product-name {
    font-size: 14px;
    font-weight: 700;
}

.deal-card .product-price {
    font-size: 16px;
}

.deal-card .product-badge {
    background: var(--blue);
}

.deal-card .buy-now {
    background: linear-gradient(135deg, var(--blue), var(--dark-blue));
}

.brand-card .product-image {
    height: 100px;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.brand-card .product-badge {
    background: var(--purple);
}

.brand-info {
    padding: 12px;
    text-align: center;
}

.brand-logo {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--primary-red), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-voucher {
    background: var(--bg-gray);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    margin-bottom: 10px;
    display: inline-block;
    color: var(--text-dark);
    font-weight: 600;
}

.brand-products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 10px 10px;
}

.brand-product-item img {
    border-radius: var(--border-radius-sm);
    height: 70px;
    object-fit: cover;
    border: 1px solid var(--border-gray);
    transition: var(--transition);
}

.brand-product-item:hover img {
    border-color: var(--primary-red);
    transform: scale(1.03);
}

/* ------------------------------------------------------------------
 * 4. Footer - OPTIMIZED
 * ------------------------------------------------------------------ */
.footer {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    padding: 40px 0 16px;
    margin-top: 40px;
    color: var(--white);
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--white);
    font-weight: 800;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--primary-red);
    border-radius: var(--border-radius-sm);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #cccccc;
    font-size: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: var(--primary-red);
    transform: translateX(2px);
}

.payment-methods, .shipping-partners {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.payment-method, .shipping-partner {
    width: 42px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.payment-method:hover, .shipping-partner:hover {
    background: var(--primary-red);
    transform: scale(1.05);
}

.copyright {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999999;
    font-size: 12px;
}

/* ------------------------------------------------------------------
 * 5. Mobile Bottom Navigation - WEBVIEW APK FIXED
 * ------------------------------------------------------------------ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(20px);
    display: none;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    margin: 0;
    background: var(--white);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
    color: var(--text-dark);
    text-decoration: none;
    flex: 1;
    text-align: center;
    min-height: 50px;
    min-width: 60px;
    
    /* WebView APK Fixes */
    -webkit-tap-highlight-color: rgba(220, 38, 55, 0.3);
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.mobile-nav-item:hover {
    color: var(--primary-red);
    background: rgba(227, 24, 55, 0.05);
}

.mobile-nav-icon {
    font-size: 18px;
    margin-bottom: 4px;
    transition: var(--transition);
}

.mobile-nav-item.active {
    color: var(--primary-red);
    background: rgba(227, 24, 55, 0.08);
    font-weight: 700;
}

.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.1);
    color: var(--primary-red);
}

/* Toast Notification - OPTIMIZED */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 13px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ------------------------------------------------------------------
 * 6. Mobile Responsive Styles - WEBVIEW APK OPTIMIZED
 * ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .header .container {
        padding: 0 12px;
    }

    /* Header Mobile - Search Focused */
    .header-top {
        padding: 6px 0;
        gap: 0;
        justify-content: center;
    }

    .logo {
        display: none !important;
    }

    .search-container {
        margin: 0;
        flex: 1;
        max-width: 100%;
    }

    .search-box {
        padding: 10px 42px 10px 14px;
        font-size: 13px;
        border-radius: 6px;
        background: #f8f8f8;
        border: 1px solid #e0e0e0;
    }

    .search-btn {
        padding: 6px 10px;
        background: var(--primary-red);
    }

    .header-actions {
        display: none !important;
    }

    .download-app {
        display: none;
    }

    .main-nav {
        display: none !important;
    }

    /* Mobile Banner */
    .main-banner {
        margin: 8px 0;
        border-radius: 6px;
    }
    
    .banner-slide {
        height: 140px;
    }

    .banner-overlay {
        padding: 12px 10px 10px;
    }

    .banner-title {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .banner-subtitle {
        font-size: 11px;
    }

    .slider-btn {
        display: none;
    }
    
    .top-bar {
        display: none !important; 
    }
    
    /* Mobile Cashback Banner */
    .cashback-banner {
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
        flex-direction: row;
        text-align: left;
        gap: 0;
        align-items: center;
        background: linear-gradient(135deg, var(--primary-red), var(--purple));
        box-shadow: var(--shadow-medium);
        position: relative;
        overflow: hidden;
    }

    .cashback-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 12px;
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        backdrop-filter: blur(6px);
    }

    .cashback-text {
        flex: 1;
        text-align: left;
    }

    .cashback-title {
        font-size: 14px;
        font-weight: 800;
        margin-bottom: 2px;
        color: var(--white);
    }

    .cashback-desc {
        font-size: 11px;
        opacity: 0.9;
        color: var(--white);
    }

    .cashback-desc strong {
        color: var(--white);
        font-weight: 800;
    }

    .copy-btn {
        background: var(--white);
        color: var(--primary-red);
        padding: 8px 14px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        transition: var(--transition);
        flex-shrink: 0;
        box-shadow: var(--shadow-light);
        border: none;
        white-space: nowrap;
    }

    .copy-btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-medium);
    }

    /* Mobile Sections */
    .section-wrapper {
        padding: 10px;
        margin: 6px 0;
        border-radius: 6px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    }

    .section-header {
        margin-bottom: 10px;
        align-items: flex-start;
    }

    .section-title {
        font-size: 13px !important;
        font-weight: 700;
        color: #333;
    }

    .section-title::after {
        display: none;
    }

    .see-all {
        font-size: 11px;
        color: var(--primary-red);
        font-weight: 600;
    }

    /* Mobile Categories */
    .categories {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        overflow-x: auto;
        display: flex;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -2px;
        scroll-snap-type: x mandatory;
    }
    
    .categories::-webkit-scrollbar {
        display: none;
    }

    .category {
        flex-shrink: 0;
        width: 58px;
        padding: 6px 3px;
        background: transparent;
        border-radius: 4px;
        scroll-snap-align: start;
    }

    .category:hover {
        background: rgba(227, 24, 55, 0.05);
        transform: none;
        box-shadow: none;
    }

    .category-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-bottom: 3px;
        background: #f8f8f8;
        border-radius: 4px;
    }
    
    .category-name {
        font-size: 8px;
        height: auto;
        line-height: 1.1;
        font-weight: 500;
    }

    /* Mobile Product Scroll */
    .products-wrapper {
        padding: 0;
        position: relative;
    }

    .products, .special-deals, .brand-deals {
        gap: 6px;
        padding: 6px 0;
        margin-left: -2px;
        margin-right: -2px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .product-card, .deal-card, .brand-card {
        scroll-snap-align: start;
        border-radius: 6px;
        border: 1px solid #f0f0f0;
        box-shadow: 0 1px 1px rgba(0,0,0,0.04);
        flex-shrink: 0;
    }

    .product-card {
        width: 120px;
    }

    .deal-card {
        width: 150px;
    }

    .brand-card {
        width: 130px;
    }

    .product-image {
        height: 80px;
        background: #f8f8f8;
    }

    .product-info {
        padding: 6px;
    }

    .product-name {
        font-size: 10px;
        height: 28px;
        line-height: 1.2;
        margin-bottom: 4px;
        font-weight: 500;
        color: #333;
    }

    .product-price {
        font-size: 12px;
        margin-bottom: 1px;
        color: var(--primary-red);
    }

    .product-original-price {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .product-rating {
        font-size: 9px;
        margin-bottom: 6px;
    }

    .buy-now {
        padding: 6px;
        font-size: 10px;
        border-radius: 3px;
        font-weight: 600;
    }

    /* Flash Sale Section */
    .flashsale-section .products-wrapper {
        padding: 0;
    }

    .flashsale-section .products {
        gap: 6px;
        padding: 6px 0;
        margin-left: -2px;
        margin-right: -2px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .flashsale-section .product-card {
        width: 120px;
        scroll-snap-align: start;
    }

    .flashsale-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .flashsale-title {
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .flashsale-badge {
        font-size: 9px;
        padding: 3px 6px;
        animation: pulse 2s infinite;
    }

    .countdown {
        font-size: 11px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .countdown-timer {
        font-size: 10px;
        padding: 3px 6px;
        font-family: 'Courier New', monospace;
        font-weight: 800;
    }
    
    /* Mobile Popular Categories */
    .popular-categories-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        margin: 6px 0;
    }

    .popular-category {
        padding: 10px;
        border-radius: 6px;
        border: 1px solid #f0f0f0;
    }

    .popular-category:hover {
        transform: none;
        border-color: var(--primary-red);
    }

    .popular-category-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 8px;
    }

    .popular-category-name {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .popular-category-discount {
        font-size: 10px;
    }

    /* Hide desktop elements on mobile */
    .scroll-btn {
        display: none;
    }

    .footer {
        display: none;
    }

    /* WEBVIEW APK FIX: Force mobile navigation to show and be clickable */
    .mobile-bottom-nav {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: #fff;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-nav-items {
        padding: 4px 0;
    }

    .mobile-nav-item {
        padding: 6px 4px;
        font-size: 9px;
        min-height: 44px;
        min-width: 60px;
        
        /* WebView APK Critical Fixes */
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(220, 38, 55, 0.3) !important;
        pointer-events: auto !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        touch-action: manipulation !important;
    }

    .mobile-nav-icon {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    /* Ensure body has space for mobile nav */
    body {
        padding-bottom: 60px !important;
        background: #f8f8f8;
    }

    /* Additional marketplace styling */
    .section-wrapper {
        background: #fff;
    }

    .product-badge {
        top: 4px;
        left: 4px;
        font-size: 8px;
        padding: 1px 4px;
    }

    .rating-stars {
        font-size: 9px;
    }

    .products-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 15px;
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03));
        pointer-events: none;
        border-radius: 0 6px 6px 0;
    }
}

@media (max-width: 480px) {
    .categories {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .category {
        width: 54px;
    }

    .product-card {
        width: 110px;
    }
    
    .brand-card {
        width: 120px;
    }

    .flashsale-section .product-card {
        width: 110px;
    }

    .banner-slide {
        height: 120px;
    }

    .section-title {
        font-size: 12px !important;
    }

    .flashsale-title {
        font-size: 11px;
    }

    .countdown {
        font-size: 10px;
    }

    .countdown-timer {
        font-size: 9px;
        padding: 2px 4px;
    }

    .footer-sections {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 375px) {
    .product-card {
        width: 100px;
    }

    .flashsale-section .product-card {
        width: 100px;
    }

    .category {
        width: 50px;
    }

    .banner-slide {
        height: 100px;
    }

    .section-wrapper {
        padding: 8px;
    }

    .flashsale-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .countdown {
        align-self: flex-start;
    }
}

/* Enhanced swipe experience */
.products::-webkit-scrollbar,
.special-deals::-webkit-scrollbar,
.brand-deals::-webkit-scrollbar,
.categories::-webkit-scrollbar {
    display: none;
}

.products,
.special-deals,
.brand-deals,
.categories {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .flashsale-badge {
        animation: none;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-gray: #000000;
        --text-light: #666666;
        --shadow-light: 0 1px 3px rgba(0,0,0,0.3);
    }
    
    .category:hover,
    .product-card:hover {
        border: 2px solid var(--primary-red);
    }
}

/* Hilangkan kotak fokus/hover pada icon header & bottom navbar */
.header .icon:focus,
.header .icon:hover,
.header a:focus,
.header a:hover,
.header button:focus,
.header button:hover,
.mobile-bottom-nav .icon:focus,
.mobile-bottom-nav .icon:hover,
.mobile-bottom-nav a:focus,
.mobile-bottom-nav a:hover,
.mobile-bottom-nav button:focus,
.mobile-bottom-nav button:hover {
    outline: none !important;
    box-shadow: none !important;
}

/* ------------------------------------------------------------------
 * 7. WEBVIEW APK SPECIFIC FIXES
 * ------------------------------------------------------------------ */
/* Pastikan mobile navigation selalu visible dan clickable di WebView APK */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .mobile-nav-item {
        /* Force clickable styles untuk WebView APK */
        cursor: pointer !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: rgba(220, 38, 55, 0.3) !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        touch-action: manipulation !important;
        
        /* Minimum touch target size untuk mobile */
        min-width: 60px !important;
        min-height: 44px !important;
    }
    
    /* Pastikan tidak ada yang nge-block clicks di WebView */
    .mobile-bottom-nav,
    .mobile-bottom-nav * {
        pointer-events: auto !important;
    }
    
    /* Hilangkan semua efek yang mungkin block interaction di WebView */
    .mobile-nav-item:hover,
    .mobile-nav-item:active,
    .mobile-nav-item:focus {
        outline: none !important;
        box-shadow: none !important;
        background-color: rgba(220, 38, 55, 0.05) !important;
    }
}

/* Fix untuk WebView rendering issues */
.mobile-nav-item {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* High DPI screen optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mobile-bottom-nav {
        border-top-width: 0.5px;
    }
}