/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
.hidden { display: none !important; }

/* ===== HEADER ===== */
#header {
    background: linear-gradient(135deg, #ff6600, #ff4400);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-top {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 6px 20px;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.15);
    font-weight: 600;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.logo .tagline {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 600;
}

.search-bar {
    flex: 1;
    display: flex;
    max-width: 500px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background: #222;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    font-weight: 700;
    font-size: 0.9rem;
}

.search-bar button:hover { background: #000; }

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-icon:hover { background: rgba(255,255,255,0.35); }

/* ===== CATEGORY NAV ===== */
#category-nav {
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 90px;
    z-index: 90;
}

.category-scroll {
    display: flex;
    gap: 6px;
    padding: 10px 30px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
    padding: 8px 16px;
    border: 2px solid #eee;
    border-radius: 20px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    color: #555;
}

.cat-btn:hover { border-color: #ff6600; color: #ff6600; }
.cat-btn.active { background: #ff6600; color: white; border-color: #ff6600; }

/* ===== MAIN ===== */
#main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
}

/* ===== FLASH SALE ===== */
#flash-sale {
    background: linear-gradient(135deg, #ff6600, #ff4400);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    color: white;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.section-header h2 { font-size: 1.4rem; font-weight: 800; }

.countdown {
    background: rgba(0,0,0,0.25);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.countdown span:first-child { margin-right: 6px; opacity: 0.8; }

#countdown-timer { font-variant-numeric: tabular-nums; }

.lihat-semua {
    margin-left: auto;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.9;
}

.lihat-semua:hover { opacity: 1; }

.flash-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* ===== BANNER ===== */
#banner {
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
}

.banner-slide {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 40px;
    border-radius: 16px;
    color: white;
    text-align: center;
}

.banner-slide h2 { font-size: 2rem; margin-bottom: 8px; }
.banner-slide p { font-size: 1.1rem; margin-bottom: 16px; opacity: 0.9; }

.btn-primary {
    background: white;
    color: #ff6600;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    transition: transform 0.2s;
}

.btn-primary:hover { transform: scale(1.05); }

/* ===== SORT & FILTER ===== */
#sort-filter {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.sort-options { display: flex; gap: 6px; flex-wrap: wrap; }

.sort-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    transition: all 0.2s;
}

.sort-btn:hover { border-color: #ff6600; color: #ff6600; }
.sort-btn.active { background: #ff6600; color: white; border-color: #ff6600; }

.filter-checkbox {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-checkbox input { accent-color: #ff6600; }

/* ===== PRODUCTS GRID ===== */
#products-section h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-image .emoji-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff4444;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
}

.product-info { padding: 12px; }

.product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 2.6em;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.price-current {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ff6600;
}

.price-original {
    font-size: 0.78rem;
    color: #999;
    text-decoration: line-through;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
}

.product-rating { color: #f5a623; }

.product-actions {
    display: flex;
    gap: 6px;
}

.btn-buy {
    flex: 1;
    padding: 8px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-buy:hover { background: #e55a00; }

.btn-cart {
    padding: 8px 10px;
    background: #fff0e6;
    color: #ff6600;
    border: 1px solid #ff6600;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-cart:hover { background: #ff6600; color: white; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    transition: all 0.2s;
    min-width: 40px;
}

.page-btn:hover { border-color: #ff6600; color: #ff6600; }
.page-btn.active { background: #ff6600; color: white; border-color: #ff6600; }

.page-ellipsis {
    padding: 8px 4px;
    color: #999;
    font-weight: 600;
}

/* ===== FOOTER ===== */
    background: #222;
    color: #ccc;
    padding: 40px 30px 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto 30px;
}

.footer-col h3 { color: #ff6600; margin-bottom: 12px; font-size: 1.2rem; }
.footer-col h4 { color: white; margin-bottom: 10px; font-size: 1rem; }
.footer-col p { font-size: 0.85rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { font-size: 0.85rem; color: #aaa; transition: color 0.2s; }
.footer-col ul li a:hover { color: #ff6600; }

.payment-icons { display: flex; gap: 10px; font-size: 1.5rem; margin-bottom: 8px; }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    font-size: 0.8rem;
    color: #777;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-main { flex-wrap: wrap; padding: 10px 15px; }
    .search-bar { order: 3; max-width: 100%; width: 100%; margin-top: 8px; }
    .logo h1 { font-size: 1.4rem; }
    .header-top { gap: 15px; font-size: 0.7rem; }
    #main-content { padding: 15px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-info { padding: 8px; }
    .product-name { font-size: 0.78rem; }
    .price-current { font-size: 0.9rem; }
    .btn-buy { padding: 6px; font-size: 0.75rem; }
}
