/* =========================================
   1. VARIABEL & RESET
   ========================================= */
:root {
    --primary-blue: #003399;   /* Warna Biru Utama (Header) */
    --dark-blue: #002266;      /* Warna Biru Gelap (Footer) */
    --accent-yellow: #FFFF00;  /* Warna Kuning (Teks/Hover) */
    --white: #ffffff;
    --gray-bg: #f5f5f5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif; /* Atau 'Roboto' jika sudah load font google */
    background-color: var(--gray-bg);
    color: #333;
    /* Jaga jarak bawah khusus di HP agar konten tidak ketutup menu/bar sticky */
    padding-bottom: 96px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. HEADER (GAYA SHOPEE)
   ========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary-blue);
    color: var(--white);
    border-bottom: 3px solid var(--accent-yellow);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

/* --- Strip menu tipis (atas) --- */
.header-topbar { font-size: 12px; font-weight: 500; }
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 7px;
}
.topbar-links { display: flex; gap: 18px; }
.topbar-links a { color: rgba(255,255,255,0.85); }
.topbar-links a:hover { color: var(--accent-yellow); }
.topbar-cta { color: var(--accent-yellow) !important; font-weight: 700; }

/* --- Baris utama: logo + search + keranjang --- */
.header-main-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 12px 0;
}

.brand-logo { flex: 0 0 auto; display: flex; align-items: center; }
.brand-logo-img { display: block; height: auto; }
.brand-logo-full { height: 46px; width: auto; border-radius: 8px; }
.brand-logo-mark { display: none; }

.header-search {
    flex: 1;
    min-width: 0;
}
.search-bar {
    display: flex;
    width: 100%;
    height: 42px;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
}
.search-bar input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 0 16px;
    font: inherit;
    font-size: 14px;
    color: #333;
    background: transparent;
}
.search-bar button {
    border: none;
    padding: 0 22px;
    background: var(--accent-yellow);
    color: var(--primary-blue);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.search-bar button:hover { filter: brightness(0.95); }

.header-cart {
    position: relative;
    flex: 0 0 auto;
    padding-top: 6px;
    color: var(--white);
    font-size: 24px;
}
.header-cart:hover { color: var(--accent-yellow); }
.cart-badge {
    position: absolute;
    top: 0;
    right: -9px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--accent-yellow);
    color: var(--primary-blue);
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-img {
    display: block;
    width: 210px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 14px;
}

/* =========================================
   3. FOOTER INFORMASI (BIRU GELAP)
   ========================================= */
.site-footer {
    background-color: var(--dark-blue);
    color: var(--white);
    margin-top: 32px;
    font-size: 14px;
}
.site-footer .container { padding-top: 38px; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
}

.footer-brand { max-width: 360px; }
.footer-brand p {
    margin-top: 12px;
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
}

.footer-column h3 {
    margin-bottom: 14px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
}

.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a { color: rgba(255,255,255,0.78); font-size: 13.5px; }
.footer-links a:hover,
.contact-list a:hover { color: var(--accent-yellow); }

/* Ikon sosial media (bulat) */
.social-links { margin-top: 15px; display: flex; gap: 12px; }
.social-links a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.social-links a:hover { background: var(--accent-yellow); color: var(--primary-blue); }

.contact-list li {
    margin-bottom: 9px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.78);
}
.contact-list i { width: 18px; margin-top: 3px; color: var(--accent-yellow); }

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 15px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
}

/* =========================================
   4. STICKY BOTTOM NAV (KHUSUS HP)
   ========================================= */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 7px 6px 9px;
    background: var(--white);
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
    color: #5a6072;
    text-align: center;
}
.bottom-nav .nav-item i { font-size: 18px; color: var(--primary-blue); }
.bottom-nav .nav-wa i { color: #25D366; }
.bottom-nav .nav-shopee i { color: #EE4D2D; }
.bottom-nav .nav-tiktok i { color: #111; }
.bottom-nav .nav-home { color: var(--primary-blue); font-weight: 700; }

/* Tombol Home mengambang (menonjol) */
.home-circle {
    width: 50px;
    height: 50px;
    margin-top: -30px;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 3px solid var(--white);
    box-shadow: 0 5px 12px rgba(0,51,153,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-circle i { color: var(--white) !important; font-size: 20px; }

/* =========================================
   5. MEDIA QUERIES (RESPONSIVE RULES)
   ========================================= */

/* A. TAMPILAN HP / TABLET KECIL (Dibawah 900px) */
@media (max-width: 900px) {
    /* Sembunyikan strip atas */
    .header-topbar { display: none; }

    /* Header ringkas: logo brand + search sejajar, dengan ruang lega
       (selector dispesifikkan agar tak kalah dari aturan .container) */
    .site-header .header-main-inner {
        align-items: center;
        gap: 10px;
        padding: 13px 16px 15px;
    }

    .brand-logo {
        flex: 0 0 clamp(108px, 34vw, 132px);
        min-width: 0;
    }
    .brand-logo-full {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
    .brand-logo-mark { display: none; }

    .search-bar { height: 40px; }
    .search-bar input { padding: 0 14px; font-size: 13px; }
    .search-bar button { padding: 0 15px; }
    .header-cart { display: none; }

    /* Footer menumpuk 1 kolom */
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-brand { max-width: 100%; }
}

/* B. TAMPILAN DESKTOP (Diatas 900px) */
@media (min-width: 901px) {
    /* Tidak ada menu bawah -> body tidak perlu padding */
    body { padding-bottom: 0; }

    /* Sembunyikan menu bawah (khusus HP) */
    .bottom-nav { display: none; }
}


/* =========================================
   6. BAGIAN KONTEN UTAMA (HOME)
   ========================================= */

/* --- A. HERO SLIDER --- */
.hero-section { margin-bottom: 14px; }
.main-slider .slick-list {
    overflow: hidden;
    border-radius: 14px;
}
.main-slider .slick-track {
    display: flex;
    align-items: stretch;
}
.main-slider .slick-slide {
    overflow: hidden;
}
.main-slider .slick-slide > div,
.hero-slide-item,
.hero-slide-item a {
    display: block;
    overflow: hidden;
    border-radius: 14px;
}
.hero-slide-item img {
    width: 100%;
    height: 160px;              /* tinggi konsisten di HP */
    object-fit: cover;
    border-radius: 14px;
    display: block;
}
@media (min-width: 768px) {
    .main-slider .slick-list,
    .main-slider .slick-slide > div,
    .hero-slide-item,
    .hero-slide-item a,
    .hero-slide-item img { border-radius: 12px; }
    .hero-slide-item img { height: 300px; }
}

/* Dots banner: pill biru brand, rapi di bawah banner */
.main-slider .slick-dots {
    position: static;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    line-height: 0;
}
.main-slider .slick-dots li {
    width: 8px;
    height: 8px;
    margin: 0;
    transition: width 0.3s ease;
}
.main-slider .slick-dots li button { width: 8px; height: 8px; padding: 0; }
.main-slider .slick-dots li button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cfd6e4;
    opacity: 1;
    transition: width 0.3s ease, background 0.3s ease;
}
.main-slider .slick-dots li.slick-active,
.main-slider .slick-dots li.slick-active button { width: 22px; }
.main-slider .slick-dots li.slick-active button:before {
    width: 22px;
    border-radius: 4px;
    background: var(--primary-blue);
}

/* --- B. KATEGORI (GAYA SHOPEE: rapat + garis pembatas) --- */
.kategori-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}
.kat-title {
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #757575;
    border-bottom: 1px solid #f0f0f0;
}
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid #f0f0f0;
    border-left: 1px solid #f0f0f0;
}
.kat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 18px 8px;
    cursor: pointer;
    text-align: center;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.kat-item:hover { background: #f7faff; }
.kat-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #EEF3FC;
    display: flex; align-items: center; justify-content: center;
    margin: 0;
    font-size: 21px;
    color: var(--primary-blue);
}
.kat-text { font-size: 12px; font-weight: 600; color: #333; line-height: 1.3; }
.kat-item.active .kat-icon {
    background: var(--primary-blue);
    color: #fff;
}
.kat-item.active .kat-text { color: var(--primary-blue); font-weight: 800; }

@media (max-width: 900px) {
    /* Kategori jadi strip geser horizontal (gaya Shopee mobile):
       tanpa garis grid & tanpa sel kosong, berapa pun jumlah kategorinya. */
    .kategori-grid {
        display: flex;
        gap: 2px;
        overflow-x: auto;
        border: none;
        padding: 8px 6px 12px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }
    .kategori-grid::-webkit-scrollbar { display: none; }
    /* Lebar ~18% -> sekitar 5,5 item terlihat, sisanya kepotong
       sebagai petunjuk bahwa strip bisa di-geser. */
    .kat-item {
        flex: 0 0 17.6%;
        padding: 8px 2px;
        border: none;
        scroll-snap-align: start;
    }
    .kat-item:hover { background: transparent; }
    .kat-icon { width: 46px; height: 46px; font-size: 19px; }
    .kat-text {
        font-size: 11px;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- C. FLASH SALE / SECTION HEADER --- */
.section-box {
    background: white;
    padding: 15px 0 20px 0; /* Padding atas bawah */
    margin-bottom: 15px;
    border-top: 1px solid #eee;
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px 15px 20px; /* Padding kiri kanan */
}

.header-left-group { display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 16px; font-weight: 800; color: #333; }
.see-all { font-size: 12px; color: var(--primary-blue); font-weight: 600; }
.search-results-header { align-items: flex-start; }
.search-results-copy { min-width: 0; }
.search-meta {
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}
.search-meta span {
    display: inline-block;
    margin-left: 6px;
    color: var(--primary-blue);
    font-weight: 800;
}
.empty-search {
    display: flex;
    min-height: 160px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 18px;
    color: #6b7280;
    text-align: center;
}
.empty-search i {
    color: var(--primary-blue);
    font-size: 28px;
}
.empty-search strong {
    color: #222;
    font-size: 15px;
}
.empty-search span { font-size: 13px; }

/* --- Halaman Search --- */
.search-page {
    min-height: 100vh;
    background: #f5f5f5;
    padding: 12px 0 92px;
}
.search-head {
    margin-bottom: 10px;
}
.search-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
}
.search-back {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EEF3FC;
    color: var(--primary-blue);
}
.search-title-copy {
    flex: 1 1 auto;
    min-width: 0;
}
.search-title-copy h1 {
    color: #222;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}
.search-title-copy p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-title-copy p span {
    color: var(--primary-blue);
    font-weight: 800;
    margin-left: 6px;
}
.search-reset {
    flex: 0 0 auto;
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 800;
}
.search-filter-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 2px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.search-filter-strip::-webkit-scrollbar { display: none; }
.filter-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.filter-chip i { color: var(--primary-blue); }
.filter-chip.active {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}
.filter-chip.active i { color: #fff; }
.search-results-wrap {
    padding-top: 2px;
}
.search-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.search-pagination {
    margin-top: 18px;
    padding: 14px 0;
}
.empty-search-page {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}
.empty-search-page a {
    margin-top: 4px;
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 800;
}

/* Countdown Timer Style */
.countdown { display: flex; gap: 4px; align-items: center; margin-left: 10px; }
.time-box {
    background-color: #d0011b; /* Merah Flash Sale */
    color: white;
    font-size: 12px; font-weight: bold;
    padding: 3px 6px; border-radius: 4px;
}
.time-sep { font-weight: bold; color: #d0011b; }

/* =========================================
   UPDATE STYLE PRODUCT CARD (MARKETPLACE STYLE)
   ========================================= */

/* Wrapper supaya bayangan tidak terpotong slider (khusus slider produk) */
.product-slider .slick-list,
.home-product-slider .slick-list { padding: 10px 0 20px 0 !important; }
.product-slider .slick-slide,
.home-product-slider .slick-slide { padding: 0 8px; }

.product-slider .slick-arrow {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    z-index: 20;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-slider .slick-arrow:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.product-slider .slick-arrow i {
    display: block;
    line-height: 1;
    color: var(--primary-blue);
}
.product-slider .slick-prev { left: -18px; }
.product-slider .slick-next { right: -18px; }
.product-slider .slick-prev:before,
.product-slider .slick-next:before {
    content: "" !important;
    display: none !important;
}
.product-slider .slick-disabled {
    opacity: 0.25;
    cursor: default;
}
.product-slider .slick-disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px; /* Sudut tumpul */
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    height: 100%; /* Biar tinggi sama rata */
    display: flex;
    flex-direction: column;
}

/* Efek Hover: Naik sedikit & Bayangan */
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-blue);
}

/* Badge Diskon (Tag Merah) */
.discount-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #d0011b; /* Merah cabe */
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-bottom-left-radius: 8px;
    z-index: 2;
}

/* Bagian Gambar */
.prod-img-wrap {
    width: 100%;
    padding-top: 100%; /* Trik rasio 1:1 (Kotak Sempurna) */
    position: relative;
    background-color: #f9f9f9;
}
.prod-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Gambar pas penuh */
}

/* Bagian Isi (Teks) */
.prod-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.prod-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
    
    /* Batasi cuma 2 baris, sisanya ... */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px; /* Tinggi fix untuk 2 baris */
}

/* Harga Coret (Abu kecil) */
.coret {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    display: block;
    margin-bottom: 2px;
}

/* Harga Asli (Besar & Tebal) */
.price-final {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-blue); /* Atau ganti #ee4d2d (Oren Shopee) */
    display: block;
}

/* Tombol Aksi (Opsional, muncul pas hover atau selalu ada) */
.action-btn {
    margin-top: 10px;
    width: 100%;
    padding: 6px 0;
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}
.product-card:hover .action-btn {
    background: var(--primary-blue);
    color: white;
}


/* =========================================
   STYLE KATEGORI ALA SHOPEE (2 BARIS)
   ========================================= */

/* Box Putih Pembungkus Utama */
.shopee-cat-box {
    background: white;
    border: 1px solid #e5e5e5;
    padding: 0; /* Padding 0 biar rapi */
    margin-bottom: 20px;
    border-radius: 3px;
}

/* Judul "KATEGORI" */
.cat-header-title {
    padding: 20px;
    font-size: 16px;
    font-weight: 700;
    color: rgba(0,0,0,.54);
    border-bottom: 1px solid #e5e5e5;
    text-transform: uppercase;
}

/* Item Kategori Individual */
.cat-item-link {
    display: block;
    border-right: 1px solid #f1f1f1;
    border-bottom: 1px solid #f1f1f1;
    text-align: center;
    padding: 15px 5px;
    transition: 0.2s;
    height: 150px; /* Tinggi fix biar sama rata */
    text-decoration: none !important;
    background: white;
    color: rgba(0,0,0,.8);
}

.cat-item-link:hover {
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.1);
    position: relative;
    z-index: 5; /* Biar pas hover dia muncul di atas border tetangga */
}

/* Gambar Kategori */
.cat-img-box {
    width: 80px; /* Ukuran gambar shopee biasanya segini */
    height: 80px;
    margin: 0 auto 10px;
    /* border-radius: 50%; kalau mau bulat opsional */
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Teks Kategori */
.cat-text-shopee {
    font-size: 13px;
    line-height: 1.2;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Maksimal 2 baris */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigasi Panah Kanan/Kiri Slider */
.cat-slider .slick-arrow {
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    z-index: 10;
}
.cat-slider .slick-prev { left: -10px; }
.cat-slider .slick-next { right: -10px; }
.cat-slider .slick-prev:before, .cat-slider .slick-next:before {
    color: #333; /* Warna panah */
    font-size: 16px;
}



/* =========================================
   TOMBOL PESAN (CTA) UNTUK PRODUK
   ========================================= */
.card-action-btn {
    display: block;
    width: 100%;
    padding: 6px 0;
    margin-top: 10px;
    text-align: center;
    background-color: #fff;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

/* Efek Hover: Jadi Biru Penuh */
.product-card:hover .card-action-btn {
    background-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}



/* =========================================
   MOBILE SIDE MENU (SLIDE DARI KIRI)
   ========================================= */

/* Wadah Menu (Sembunyi di Kiri Layar) */
.mobile-side-menu {
    position: fixed;
    top: 0;
    left: -280px; /* Sembunyi sejauh 280px ke kiri */
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 2000; /* Paling atas */
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Class Aktif (Munculin Menu) */
.mobile-side-menu.active {
    left: 0; /* Geser ke posisi 0 (terlihat) */
}

/* Header Sidebar */
.side-menu-header {
    background: var(--primary-blue);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.close-menu-btn {
    cursor: pointer;
    font-size: 20px;
    color: white;
}

/* List Menu */
.side-menu-list {
    padding: 10px 0;
    overflow-y: auto; /* Bisa discroll kalau menu panjang */
}
.side-menu-list li {
    display: block;
}
.side-menu-list a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    transition: 0.2s;
}
.side-menu-list a i {
    width: 25px;
    color: var(--primary-blue);
    margin-right: 10px;
    font-size: 16px;
}
.side-menu-list a:hover {
    background: #f9f9f9;
    color: var(--primary-blue);
    padding-left: 25px; /* Efek geser dikit pas hover */
}

/* Garis Pemisah */
.side-menu-list li.divider {
    height: 5px;
    background: #f5f5f5;
    margin: 10px 0;
}

/* Layar Hitam Transparan (Overlay) */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none; /* Sembunyi default */
    opacity: 0;
    transition: opacity 0.3s;
}
.menu-overlay.active {
    display: block;
    opacity: 1;
}


/* =========================================
   DETAIL PRODUK (gaya mockup)
   ========================================= */
.product-detail-page {
    min-height: 100vh;
    background: #EDEFF3;
    padding: 22px 0 40px;
}
.detail-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: #7a8296;
    font-size: 13px;
    margin-bottom: 16px;
}
.detail-breadcrumb a { color: var(--primary-blue); font-weight: 700; }
.detail-breadcrumb .crumb-current { color: #4b5563; }
.detail-breadcrumb--inline { margin-bottom: 8px; font-size: 12.5px; }

.detail-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.detail-body {
    display: grid;
    grid-template-columns: 436px minmax(0, 1fr);
    gap: 40px;
    padding: 26px 24px 24px;
}

/* --- Galeri --- */
.detail-gallery { min-width: 0; }   /* biar strip thumbnail bisa menyempit & di-scroll */
.detail-main-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #ECECEC;
    border-radius: 10px;
    overflow: hidden;           /* zoom tetap terkurung di dalam area */
    background: #F6F6F6;
    cursor: zoom-in;
}
.detail-main-img.zoomed { cursor: zoom-out; }
.detail-main-zoom {
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease;
}
.detail-main-img.zoomed .detail-main-zoom { transform: scale(2.2); }
.detail-main-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: nowrap;          /* selalu 1 baris */
    overflow-x: auto;           /* >4 foto -> bisa di-geser */
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.detail-thumbs::-webkit-scrollbar { height: 5px; }
.detail-thumbs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 8px; }
.detail-thumb {
    flex: 0 0 auto;             /* jangan menyusut, biar rapi saat di-scroll */
    width: 88px;
    height: 88px;
    padding: 0;
    border: 1px solid #ECECEC;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color 0.15s;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-thumb:hover { border-color: #b9c6e6; }
.detail-thumb.active { border-color: var(--primary-blue); box-shadow: inset 0 0 0 1px var(--primary-blue); }
.detail-share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;          /* selalu sebaris */
    margin-top: 18px;
}
.detail-share .share-label { font-size: 13px; color: #8a8a8a; font-weight: 600; white-space: nowrap; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #E3E3E3;
    border-radius: 50%;
    background: #fff;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.share-btn.wa { color: #25D366; }
.share-btn.fb { color: #1877F2; }
.share-btn.x  { color: #111; }
.share-btn:hover { background: #f4f4f4; }
.share-btn.wa:hover { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn.fb:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn.x:hover  { background: #111;    color: #fff; border-color: #111; }
.share-btn.copy:hover { background: var(--primary-blue); color: #fff; border-color: var(--primary-blue); }
.share-btn.copied { background: #16a34a; color: #fff; border-color: #16a34a; }

/* --- Info --- */
.detail-cat { font-size: 12.5px; color: #9a9a9a; }
.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #212121;
    line-height: 1.3;
    margin: 6px 0 0;
}
.detail-price-box {
    background: #EEF3FC;
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 16px;
}
.detail-price-box .detail-old-price {
    display: inline-block;
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 13px;
    margin-bottom: 4px;
}
.detail-price-label { font-size: 13px; color: #5b6b8f; }
.detail-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.1;
    margin-top: 2px;
}
.detail-price-note { font-size: 12px; color: #8090ad; margin-top: 6px; }

.detail-desc { margin-top: 20px; }
.detail-desc h2 { font-size: 15px; font-weight: 700; color: #212121; margin-bottom: 8px; }
.detail-desc p { font-size: 14px; line-height: 1.7; color: #555; margin: 0 0 10px; }
.detail-desc p:last-child { margin-bottom: 0; }

/* Collapse "Selengkapnya" */
.detail-desc-body {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.detail-desc-body::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46px;
    background: linear-gradient(rgba(255,255,255,0), #fff);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s;
}
.detail-desc.expanded .detail-desc-body::after { opacity: 0; }
.detail-desc-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 9px 2px 2px;
    background: none;
    border: none;
    border-top: 1px solid #f0f0f0;
    color: var(--primary-blue);
    font: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.detail-desc-toggle i { font-size: 11px; transition: transform 0.2s; }
.detail-desc.expanded .detail-desc-toggle i { transform: rotate(180deg); }

.detail-order-label { font-size: 13px; color: #8a8a8a; font-weight: 600; margin: 22px 0 8px; }
.detail-order-btns { display: flex; gap: 10px; }
.order-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 14px 6px;
    border-radius: 9px;
}
.order-btn.wa { background: #25D366; }
.order-btn.shopee { background: #EE4D2D; }
.order-btn.tiktok { background: #111; }
.order-btn:hover { filter: brightness(0.94); color: #fff; }

/* --- Sticky CTA bar (mobile, halaman detail) --- */
.detail-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px calc(9px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.detail-cta-bar .cta-label { font-size: 13px; font-weight: 800; color: var(--primary-blue); text-align: center; letter-spacing: 0.2px; }
.detail-cta-bar .cta-row { display: flex; gap: 8px; }
.detail-cta-bar .cta-order {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    border-radius: 9px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
.detail-cta-bar .cta-order i { font-size: 15px; }
.detail-cta-bar .cta-order.wa { background: #25D366; }
.detail-cta-bar .cta-order.shopee { background: #EE4D2D; }
.detail-cta-bar .cta-order.tiktok { background: #111; }
.detail-cta-bar .cta-order:hover { filter: brightness(0.94); color: #fff; }
@media (min-width: 901px) {
    .detail-cta-bar { display: none; }   /* desktop tak perlu sticky bar */
}
/* Di mobile, tombol order pindah ke sticky bar -> sembunyikan yang di konten */
@media (max-width: 900px) {
    .detail-order-label,
    .detail-order-btns { display: none; }
}

/* --- Produk terkait --- */
.detail-related { border-top: 8px solid #F3F5F8; padding: 24px; }
.detail-related-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.detail-related-head h3 { font-size: 17px; font-weight: 700; color: #212121; }
.detail-related-head span { font-size: 12.5px; color: #9a9a9a; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.related-card {
    display: block;
    border: 1px solid #ECECEC;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}
.related-card:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
    transform: translateY(-3px);
    color: inherit;
}
.related-img { width: 100%; aspect-ratio: 1 / 1; background: #F3F3F3; overflow: hidden; }
.related-img img { width: 100%; height: 100%; object-fit: cover; }
.related-info { padding: 9px 10px 12px; }
.related-name {
    font-size: 12.5px;
    line-height: 1.35;
    color: #333;
    height: 34px;
    overflow: hidden;
}
.related-price { margin-top: 7px; color: var(--primary-blue); font-weight: 700; font-size: 14px; }

@media (max-width: 900px) {
    .detail-body { grid-template-columns: 1fr; gap: 22px; padding: 18px 16px; }
    .detail-title { font-size: 20px; }
    .detail-price { font-size: 28px; }
    .detail-related { padding: 18px 16px; }
    .related-grid { grid-template-columns: repeat(3, 1fr); }
    .related-card:nth-child(n+7) { display: none; }
}
@media (max-width: 560px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    /* Tombol order tetap 1 baris, font & padding diperkecil biar pas */
    .order-btn { font-size: 12px; padding: 12px 4px; gap: 6px; }
    .detail-thumb { width: 72px; height: 72px; }
}

/* =========================================
   POLISH MOBILE (umum)
   ========================================= */
@media (max-width: 767px) {
    /* User sentuh -> geser slider, panah tak perlu & bikin sempit */
    .product-slider .slick-arrow { display: none !important; }
    .product-slider .slick-list { padding-top: 6px !important; }
    .main-slider .slick-list { padding: 0 !important; }
}
@media (max-width: 560px) {
    .container { padding: 0 8px; }
    .section-box {
        margin-top: 18px;
        margin-bottom: 20px;
        padding-top: 18px;
        padding-bottom: 22px;
    }
    .section-header {
        padding: 4px 10px 16px;
        gap: 12px;
    }
    .section-box .product-slider {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .kat-title { padding: 12px 14px; }

    /* Header section anti-kepotong: "Lihat Semua" selalu utuh; judul mengisi
       ruang tersisa dan hanya dipotong rapi (ellipsis) saat benar-benar sempit.
       Ellipsis hanya untuk judul anak-langsung (bukan yg di grup countdown). */
    .header-left-group { min-width: 0; flex: 1 1 auto; }
    .section-header > .section-title {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .countdown { flex-shrink: 0; }
    .see-all { flex: 0 0 auto; white-space: nowrap; }
    .search-page { padding-top: 10px; }
    .search-head { margin-bottom: 8px; }
    .search-title-row {
        gap: 10px;
        border-radius: 8px;
        padding: 12px 10px;
    }
    .search-title-copy h1 { font-size: 15px; }
    .search-title-copy p { font-size: 11px; }
    .search-filter-strip {
        padding-left: 8px;
        padding-right: 8px;
    }
    .filter-chip {
        min-height: 32px;
        padding: 0 10px;
        font-size: 11px;
    }
    .search-results-wrap {
        padding-left: 8px;
        padding-right: 8px;
    }
    .search-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}
