/* =========================================
   1. VARIABEL & RESET
   ========================================= */
:root {
    --primary: #2e1065;       /* Ungu Kebiruan Tua */
    --primary-hover: #1e0a45;
    --accent: #4338ca;        /* Indigo */
    --accent-hover: #3730a3;
    --bg-body: #f8fafc;       /* Background utama terang */
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --footer-bg: #0f172a;     /* Hitam */
    --footer-text: #cbd5e1;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
    background-color: var(--bg-body); 
    color: var(--text-dark); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* =========================================
   2. HEADER & PENCARIAN
   ========================================= */
.site-header { 
    background-color: var(--primary); 
    color: var(--bg-white); 
    padding: 30px 20px; 
    text-align: center; 
}

.site-header h1 { 
    font-size: 26px; 
    margin-bottom: 5px; 
    letter-spacing: 1px;
}

.site-header p { 
    font-size: 14px; 
    margin-bottom: 20px; 
    opacity: 0.9; 
}

.search-container { 
    max-width: 500px; 
    margin: 0 auto; 
    display: flex; 
}

.search-container input { 
    flex: 1; 
    padding: 12px 16px; 
    border: none; 
    border-radius: 25px 0 0 25px; 
    outline: none; 
    font-size: 15px; 
}

.search-container button { 
    padding: 0 24px; 
    border: none; 
    background-color: var(--accent); 
    color: var(--bg-white); 
    border-radius: 0 25px 25px 0; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 15px;
    transition: background 0.3s; 
}

.search-container button:hover { 
    background-color: var(--accent-hover); 
}

/* =========================================
   3. MAIN & FILTER KATEGORI
   ========================================= */
.main-content { 
    flex: 1; 
    padding-bottom: 40px; 
}

.filter-container { 
    max-width: 1200px; 
    margin: 24px auto; 
    padding: 0 20px; 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    justify-content: center; 
}

.btn-filter { 
    background-color: var(--bg-white); 
    border: 2px solid var(--border-color); 
    padding: 8px 18px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600; 
    color: var(--text-muted); 
    transition: all 0.3s; 
}

.btn-filter:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
}

.btn-filter.active { 
    background-color: var(--primary); 
    color: var(--bg-white); 
    border-color: var(--primary); 
}

/* =========================================
   4. GRID KATALOG PRODUK
   ========================================= */
.product-grid { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 24px; 
    justify-content: flex-start; 
    align-content: flex-start; 
    min-height: 300px; 
}

.product-card { 
    background-color: var(--bg-white); 
    border-radius: 12px; 
    width: calc(25% - 18px); 
    min-width: 220px; 
    max-width: 300px; 
    overflow: hidden; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); 
    cursor: pointer; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.product-image { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    border-bottom: 1px solid var(--border-color);
}

.product-info { 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
}

.product-title { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 6px; 
    color: var(--text-dark); 
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
}

.product-desc { 
    font-size: 13px; 
    color: var(--text-muted); 
    margin-bottom: 16px; 
    flex: 1; 
    line-height: 1.5;
    height: 40px;
    overflow: hidden;
}

.product-price { 
    font-size: 18px; 
    font-weight: 800; 
    color: var(--primary); 
}

.product-card.out-of-stock .product-image { 
    filter: grayscale(100%); 
    opacity: 0.5; 
}

.badge-out-of-stock { 
    position: absolute; 
    top: 12px; 
    left: 12px; 
    background-color: #dc2626; 
    color: var(--bg-white); 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 12px; 
    font-weight: bold; 
    z-index: 2;
}

/* =========================================
   5. PAGINASI
   ========================================= */
.pagination-container { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    margin-top: 40px; 
}

.page-btn { 
    width: 40px; 
    height: 40px; 
    border: 1px solid var(--border-color); 
    background-color: var(--bg-white); 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    color: var(--text-dark); 
    transition: all 0.2s; 
}

.page-btn:hover:not(:disabled) { 
    background-color: var(--primary); 
    color: var(--bg-white); 
    border-color: var(--primary); 
}

.page-btn.active { 
    background-color: var(--primary); 
    color: var(--bg-white); 
    border-color: var(--primary); 
}

.page-btn:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
}

/* =========================================
   6. MODAL POPUP
   ========================================= */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background-color: var(--bg-white); /* Latar belakang putih penuh */
    display: none; 
    justify-content: center; 
    align-items: center; 
    overflow-y: auto; 
    padding: 20px; 
    z-index: 100; 
}

.modal-overlay.active { 
    display: flex; 
}

body.modal-open { 
    overflow: hidden; 
}

.modal-box { 
    background-color: var(--bg-white); 
    border: 1px solid var(--border-color); /* Garis tepi agar jelas di latar putih */
    border-radius: 12px; 
    width: 100%; 
    max-width: 450px; 
    position: relative; 
    margin: auto; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    overflow: hidden;
}

.btn-close { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background-color: rgba(0,0,0,0.5); 
    color: var(--bg-white); 
    border: none; 
    width: 28px; 
    height: 28px; 
    border-radius: 50%; 
    cursor: pointer; 
    font-size: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    line-height: 1;
    padding: 0;
    z-index: 10; 
    transition: background 0.2s; 
}

.btn-close:hover { 
    background-color: var(--primary); 
}

.modal-image { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
}

.modal-content { 
    padding: 20px; 
}

.modal-title { 
    font-size: 20px; 
    margin-bottom: 8px; 
    color: var(--text-dark); 
    line-height: 1.3;
}

.modal-price { 
    font-size: 20px; 
    color: var(--primary); 
    font-weight: 800; 
    margin-bottom: 12px; 
}

.modal-desc { 
    font-size: 13px; 
    color: #475569; 
    margin-bottom: 16px; 
    line-height: 1.5; 
}

.detail-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 20px; 
    font-size: 13px; 
}

.detail-table th, .detail-table td { 
    padding: 10px 8px; 
    border-bottom: 1px solid var(--border-color); 
    text-align: left; 
}

.detail-table th { 
    color: var(--text-muted); 
    font-weight: 600; 
    width: 40%; 
}

.detail-table td { 
    font-weight: 700; 
    color: var(--text-dark); 
}

/* Tombol WhatsApp */
.btn-whatsapp { 
    display: block; 
    text-align: center; 
    background-color: var(--accent); 
    color: var(--bg-white); 
    padding: 12px; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 14px; 
    transition: background 0.3s; 
}

.btn-whatsapp:hover { 
    background-color: var(--accent-hover); 
}

.btn-disabled { 
    background-color: #cbd5e1; 
    cursor: not-allowed; 
    color: #94a3b8;
}

.btn-disabled:hover { 
    background-color: #cbd5e1; 
}

/* =========================================
   7. FOOTER
   ========================================= */
.site-footer { 
    background-color: var(--footer-bg); 
    color: var(--footer-text); 
    padding: 50px 20px 30px; 
    text-align: center; 
    margin-top: auto; 
}

.footer-grid { 
    max-width: 800px; 
    margin: 0 auto 30px auto; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    text-align: left;
}

.footer-grid h3 { 
    color: var(--bg-white); 
    font-size: 16px; 
    margin-bottom: 12px; 
}

.footer-grid p { 
    font-size: 14px; 
    line-height: 1.8; 
}

.footer-bottom { 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 24px; 
    font-size: 13px; 
    color: #94a3b8; 
    text-align: center;
}

/* =========================================
   8. TESTIMONI
   ========================================= */
.testimoni-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}
.testimoni-section h2 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 30px;
}
.testimoni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.testimoni-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: left;
    border-left: 4px solid var(--accent);
}
.testimoni-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.testimoni-nama {
    font-weight: bold;
    color: var(--text-dark);
    font-size: 16px;
}
.testimoni-rating {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
}
.testimoni-pesan {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    font-style: italic;
}

/* =========================================
   9. RESPONSIVE
   ========================================= */
@media (max-width: 992px) { 
    .product-card { width: calc(33.333% - 16px); } 
}

@media (max-width: 768px) {
    .product-card { width: calc(50% - 12px); }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 20px;}
}

@media (max-width: 480px) { 
    .product-card { width: 100%; max-width: 100%; } 
    .search-container input { padding: 10px; }
    .search-container button { padding: 0 16px; }
    
    /* Modal lebih kecil lagi di HP */
    .modal-image { height: 150px; }
    .modal-content { padding: 15px; }
    .modal-title { font-size: 18px; }
    .modal-price { font-size: 18px; }
}
