/* ==========================================================================
   1. MODERN RESET & DESIGN SYSTEM (Google Fonts & Custom Properties)
   ========================================================================== */
html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* BACKGROUND PUTIH untuk beranda */
    --bg-main: #ffffff;                  /* Putih bersih, override warna.css yang cream */
    --primary-light: #f0f7f0;            /* Hijau pudar transparan untuk background hover */
    --text-muted: #5c725a;               /* Abu-abu kehijauan — override warna.css yg #E7E1B1 */
    --card-bg: var(--bg-card);           /* Cream Sage untuk kartu produk (#E7E1B1) */
    
    /* Ukuran Radius & Bayangan Modern */
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-sm: 0 4px 6px -1px rgba(13, 83, 14, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(13, 83, 14, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(13, 83, 14, 0.12);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

/* ==========================================================================
   2. MAIN CONTAINER & HERO SECTION (Header, Logo, Info Toko)
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeInUp 0.8s var(--transition);
    overflow-x: hidden;
}

/* Efek Membuka Halaman */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid Header untuk Logo & Teks agar seimbang */
.hero-section {
    text-align: center;
    margin-bottom: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

img.logo {
    display: block;
    max-width: 140px;
    height: auto;
    border-radius: 24px;
    padding: 10px;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    transition: var(--transition);
    cursor: pointer;
}

img.logo:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: var(--shadow-lg);
}

.judul {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-dark) 30%, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;                  /* Standar W3C modern */
    -webkit-text-fill-color: transparent;   /* Untuk browser berbasis Webkit (Chrome, Safari, Edge) */
    color: transparent;                     /* Cadangan agar teks tetap transparan dan gradasi muncul */
}

.alamat-beranda {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 25px auto;
    font-weight: 500;
}

/* Modern Pill Button Alamat */
.button-alamat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    color: var(--text-dark);
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    gap: 8px;
}

/* PERBAIKAN: Mengubah efek hover tombol alamat agar masuk ke tema warna alam */
.button-alamat:hover {
    background-color: var(--primary-hover); /* Berubah menjadi hijau daun muda (#306D29) */
    color: #ffffff;                         /* Teks tetap putih agar kontras */
    border-color: var(--primary-hover);     /* Garis pinggir ikut berubah hijau */
    transform: translateY(-3px);            /* Efek sedikit melompat ke atas */
    box-shadow: var(--shadow-md);           /* Bayangan melembut */
}

/* ==========================================================================
   3. PREMIUM CATEGORY SELECTORS (Interaktif & Beranimasi)
   ========================================================================== */
.kotak-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 40px auto;
    background: rgba(48, 109, 41, 0.08); /* Menggunakan warna hijau daun transparan lembut */
    padding: 8px;
    border-radius: 50px;
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.kotak-produk {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    display: flex;
    flex-direction: row; /* Berjejer ke samping agar estetik di desktop */
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.kotak-produk i {
    font-size: 16px;
    transition: var(--transition);
}

/* Efek Hover Mouse */
.kotak-produk:hover {
    color: var(--text-dark);
}

/* State Tombol Aktif / Terpilih (Sangat Elegan) */
.kotak-produk.active {
    background-color: var(--card-bg) !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm) !important;
}

.kotak-produk.active i {
    transform: scale(1.2);
}

/* ==========================================================================
   4. PRODUCT GRID & EXQUISITE CARDS (Kartu Produk Eksklusif)
   ========================================================================== */
.produk-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.produk-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.produk-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
    position: relative;
    transition: var(--transition);
}

/* Efek Mengambang Premium Saat Card Didekati Cursor */
.produk-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

/* Area Frame Gambar */
.image-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f8fafc;
    position: relative;
}

.produk-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gambar nge-zoom halus saat card di-hover */
.produk-card:hover .produk-img {
    transform: scale(1.06);
}

/* Informasi Detail Di dalam Card */
.card-details {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.produk-nama {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.produk-harga {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
    margin-top: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.produk-ukuran {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 8px 12px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #f1f5f9;
}

/* Empty State Produk (AJAX & kategori kosong) */
.empty-state {
    text-align: center;
    grid-column: 1 / -1;
    margin: 40px auto;
    color: #64748b;
    font-weight: 500;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #cbd5e1;
}

/* Force inline-flex untuk price wrapper di fetch_produk */
.card-details .price-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 8px;
}

.card-details .produk-harga {
    display: inline-block !important;
    margin: 0 !important;
    white-space: nowrap;
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
}

.card-details .harga-coret {
    display: inline-block !important;
    margin: 0 !important;
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
}

/* Loading Fade Efek untuk AJAX */
.produk-list { 
    transition: opacity 0.3s ease; 
}
.loading-fade {
    opacity: 0.3;
}

/* ==========================================================================
   5. RESPONSIVE OPTIMIZATION (Mobile & Tablet Friendly)
   ========================================================================== */

/* Tampilan Tablet (Lebar Maksimal 768px) */
@media (max-width: 992px) {
    .produk-list { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .judul { font-size: 28px; }
}

@media (max-width: 768px) {
    .produk-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .kotak-container {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding: 6px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
        flex-wrap: nowrap;
        scrollbar-width: none;
        touch-action: pan-x pan-y;
    }
    /* Sembunyikan scrollbar kategori di mobile agar tetap bersih */
    .kotak-container::-webkit-scrollbar { display: none; }
    .kotak-produk { padding: 10px 18px; font-size: 13px; flex-shrink: 0; }
    
}

/* Tampilan Smartphone / HP Layar Kecil (Maksimal 480px) */
@media (max-width: 480px) {
    .container { padding: 25px 12px; }
    .hero-section { margin-bottom: 25px; }
    img.logo { max-width: 110px; border-radius: 20px; }
    
    /* FIX: Mengurangi font-size dari 22px menjadi 18px agar muat 1 baris */
    .judul { 
        font-size: 18px !important; 
        white-space: nowrap !important; /* Memaksa teks tetap dalam satu baris (tidak boleh patah) */
    }
    
    .alamat-beranda { font-size: 13px; margin-bottom: 15px; }
    .button-alamat { padding: 10px 20px; font-size: 13px; }
    
    /* Tombol Kategori Di HP: Menjadi Grid 2 Kolom Rapi & Kokoh */
    .kotak-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 6px !important;
        border-radius: var(--radius-md) !important;
        width: 100% !important;
    }
    
    .kotak-produk {
        flex-direction: column !important; /* Susun ikon di atas, teks di bawah khusus HP */
        padding: 10px 4px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
        gap: 4px !important;
    }
    
    .kotak-produk i { font-size: 14px !important; }
    
    /* Grid List Produk di Mobile */
    .produk-list { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .card-details { padding: 12px; }
    .produk-nama { font-size: 13px; min-height: 2.8em; margin-bottom: 4px; }
    .produk-harga { font-size: 15px; margin-bottom: 8px; }
    .produk-ukuran { font-size: 11px; padding: 6px 10px; }
}

/* ==========================================================================
   LOGO MODAL POPUP (BAHAN NO. 5)
   ========================================================================== */
.logo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.logo-modal.show {
    display: flex;
}

.logo-modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    text-align: center;
    animation: modalZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin-bottom: 20px;
}

.logo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.logo-modal-close:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.logo-modal-nama {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .logo-modal-content {
        padding: 20px;
        width: 85%;
        border-radius: 20px;
    }
    .logo-modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .logo-modal-nama {
        font-size: 15px;
    }
}

/* ==========================================================================
   JUDUL TAMBAHAN (Sepatu dan Sendal Pria dan Wanita)
   ========================================================================== */
.judul-tambahan {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    letter-spacing: 0.8px;
    line-height: 1.3;
    position: relative;
    display: inline-block;
    padding: 0 4px;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(13, 83, 14, 0.1);
}

.judul-tambahan::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
    margin: 8px auto 0;
}

@media (max-width: 480px) {
    .judul-tambahan {
        font-size: 16px;
        letter-spacing: 0.3px;
    }
    .judul-tambahan::after {
        width: 40px;
        height: 2px;
    }
}

/* ==========================================================================
   STYLE FLOATING WHATSAPP BUTTON (BAHAN NO. 2)
   ========================================================================== */
.wa-floating {
    position: fixed;
    bottom: 25px;            /* Jarak dari bawah layar */
    right: 25px;             /* Jarak dari kanan layar */
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 9999;           /* Memastikan tombol selalu berada di lapisan paling atas */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    overflow: hidden;
}

/* Efek interaktif saat kursor mendekat (PC / Laptop) */
.wa-floating:hover {
    transform: scale(1.1) translateY(-5px); /* Membesar & melompat sedikit ke atas */
    background-color: #1ebd54;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
}

/* Efek animasi denyut nadi lembut agar menarik perhatian pembeli */
.wa-floating::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #25d366;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.4;
    animation: waPulse 2s infinite;
}

@keyframes waPulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Penyesuaian ukuran khusus untuk layar HP agar tidak terlalu besar */
@media (max-width: 480px) {
    .wa-floating {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }
    .wa-floating svg {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   PERBAIKAN TOTAL LAYOUT TERLARIS & HARGA CORET (BAHAN NO. 3 & 5)
   ========================================================================== */
.terlaris-section {
    width: 100%;
    max-width: 1000px;
    margin: 30px auto 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.terlaris-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.terlaris-scroll {
    display: flex;
    gap: 14px;
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 4px 15px 4px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.terlaris-scroll::-webkit-scrollbar {
    display: none;
}

.terlaris-card {
    flex: 0 0 310px; /* Lebar ditambah sedikit agar harga tidak menumpuk */
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 12px;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    scroll-snap-align: start;
}

.terlaris-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: #fff0ea;
}

.terlaris-img-box {
    width: 75px;
    height: 75px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
}

.terlaris-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info Teks */
.terlaris-info {
    margin-left: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Badge Top Hit Dipindah Ke Atas Judul Agar Rapi */
.terlaris-badge {
    align-self: flex-start;
    background: #fff0ea;
    color: #ff6b35;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.terlaris-info h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bungkus Harga Baru & Harga Coret Bersandingan */
.price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terlaris-harga {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #ff6b35;
}

/* Style Harga Coret Abu-abu Cantik */
.harga-coret {
    font-size: 11px;
    text-decoration: line-through;
    color: #94a3b8;
    font-weight: 500;
}

@media (max-width: 480px) {
    .terlaris-card { flex: 0 0 260px; padding: 10px; }
    .terlaris-img-box { width: 65px; height: 65px; }
    .terlaris-info h3 { font-size: 12px; }
    .terlaris-harga { font-size: 13px; }
    .harga-coret { font-size: 10px; }
}

/* MOBILE: terlaris-scroll bisa scroll horizontal (ditempatkan SETELAH default rule) */
@media (max-width: 768px) {
    .terlaris-scroll {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        touch-action: pan-x pan-y;
    }
}

/* ==========================================================================
   PENYELARASAN HARGA CORET DI GRID LIST PRODUK UTAMA
   ========================================================================== */
/* Penyesuaian responsif ukuran harga coret di HP */
@media (max-width: 480px) {
    .card-details .price-wrapper {
        gap: 6px;
    }
    .card-details .harga-coret {
        font-size: 10px;
    }
}

/* ==========================================================================
   STYLE HARGA CORET DI HALAMAN DETAIL PRODUK
   ========================================================================== */
.detail-price-wrapper {
    display: flex;
    align-items: center;
    gap: 15px; /* Jarak antara harga utama orange dan harga coret */
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Mengatur ukuran harga coret di detail produk agar proporsional dengan harga orange */
.detail-harga-coret {
    font-size: 18px;
    text-decoration: line-through;
    color: #94a3b8; /* Warna abu-abu soft */
    font-weight: 600;
}

/* Responsif untuk Layar HP */
@media (max-width: 480px) {
    .detail-price-wrapper {
        gap: 10px;
    }
    .detail-harga-coret {
        font-size: 14px;
    }
}