/* Reset & Base Styles */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; transition: background-color 0.3s, color 0.3s; }

:root {
    --bg-body: #f4f4f4;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-heading: #2c3e50;
    --border-color: #dddddd;
    --shadow-color: rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-heading: #ecf0f1;
    --border-color: #333333;
    --shadow-color: rgba(0,0,0,0.5);
    
    /* Helper colors for dark mode specific elements */
    --text-muted: #b0b0b0;
}

body { background-color: var(--bg-body); color: var(--text-main); padding-bottom: 50px; }

/* Navbar */
.navbar {
    background: var(--bg-card); color: var(--text-main); padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform 0.3s ease-in-out, background-color 0.3s;
}
.navbar-hidden { transform: translateY(-100%); }
.logo { font-size: 1.5rem; font-weight: bold; display: flex; align-items: center; }
.logo img { max-height: 40px; }
body.dark-mode .logo img { filter: brightness(0) invert(1); }
.cart-icon { position: relative; cursor: pointer; }
#cart-count {
    position: absolute; top: -8px; right: -8px;
    background: #e74c3c; color: white; border-radius: 50%;
    padding: 2px 6px; font-size: 0.8rem;
}
.wishlist-icon { position: relative; cursor: pointer; margin-right: 15px; }
#wishlist-count {
    position: absolute; top: -8px; right: -8px;
    background: #e74c3c; color: white; border-radius: 50%;
    padding: 2px 6px; font-size: 0.8rem;
}

/* Product Grid */
.container { max-width: 1000px; margin: 20px auto; padding: 0 15px; }
.product-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px; margin-top: 20px;
}
/* Search Box */
.search-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card); color: var(--text-main);
}
.product-card {
    position: relative;
    background: var(--bg-card); border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 5px var(--shadow-color); transition: transform 0.2s;
}
.product-card:hover { transform: translateY(-5px); }
.product-img { width: 100%; height: 200px; object-fit: contain; background: #fff; }
.product-info { padding: 15px; }
.product-title { font-size: 1rem; margin-bottom: 5px; font-weight: bold; color: var(--text-heading); }
.product-price { color: #27ae60; font-weight: bold; margin-bottom: 10px; }
.product-short-desc {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Batasi maksimal 2 baris */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.dark-mode .product-short-desc { color: #b0b0b0; }
.btn-add {
    width: 100%; background: #3498db; color: white; border: none;
    padding: 8px; border-radius: 4px; cursor: pointer;
}
.btn-add:hover { background: #2980b9; }
.btn-wishlist {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.9); border: none;
    border-radius: 50%; width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; color: #ccc; box-shadow: 0 2px 5px var(--shadow-color);
}
.btn-wishlist:hover, .btn-wishlist.active { color: #e74c3c; }
.btn-wishlist .material-icons { font-size: 20px; }

/* Modal Keranjang */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 200;
}
.modal-content {
    background: var(--bg-card); margin: 5% auto; padding: 20px; width: 90%; max-width: 500px;
    border-radius: 8px; max-height: 90vh; overflow-y: auto; position: relative;
}
.close-btn { position: absolute; right: 15px; top: 10px; font-size: 24px; cursor: pointer; }

/* Cart Items */
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color); padding: 10px 0;
}
.qty-controls button {
    background: var(--bg-body); color: var(--text-main); border: none; width: 25px; height: 25px; cursor: pointer;
}

/* Wishlist Items */
.wishlist-item {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color); padding: 10px 0;
}

/* Form Checkout */
.checkout-form { margin-top: 20px; border-top: 2px solid var(--border-color); padding-top: 20px; }
.checkout-form input, .checkout-form textarea, .checkout-form select {
    width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 4px;
    background: var(--bg-card); color: var(--text-main);
}
.summary { background: var(--bg-body); padding: 10px; border-radius: 4px; margin-bottom: 15px; }
.total { font-weight: bold; font-size: 1.2rem; color: var(--text-heading); border-top: 1px solid var(--border-color); margin-top: 5px; padding-top: 5px;}
.btn-wa {
    width: 100%; background: #25D366; color: white; border: none;
    padding: 12px; border-radius: 4px; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-wa:hover { background: #128C7E; }

/* Halaman Detail Produk */
.detail-container { max-width: 900px; margin: 30px auto; padding: 20px; background: var(--bg-card); border-radius: 8px; box-shadow: 0 2px 10px var(--shadow-color); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.detail-img { width: 100%; height: auto; max-height: 400px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border-color); cursor: zoom-in; background: #fff; }
.detail-info h1 { font-size: 1.8rem; margin-bottom: 10px; color: var(--text-heading); }
.detail-price { font-size: 1.5rem; color: #27ae60; font-weight: bold; margin-bottom: 20px; }
.detail-desc { line-height: 1.6; color: var(--text-main); margin-bottom: 30px; white-space: pre-line; }
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

/* Breadcrumb Navigation */
.breadcrumb { margin-bottom: 20px; font-size: 0.9rem; color: var(--text-main); background: var(--bg-body); padding: 10px 15px; border-radius: 6px; }
.breadcrumb ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 10px; color: #999; font-size: 1.2rem; line-height: 1; }
body.dark-mode .breadcrumb li + li::before { color: #bbb; } /* Separator lebih terang di dark mode */
.breadcrumb a { text-decoration: none; color: #3498db; transition: 0.2s; }
.breadcrumb a:hover { color: #2980b9; text-decoration: underline; }
body.dark-mode .breadcrumb a { color: #5dade2; } /* Biru lebih muda agar kontras di background gelap */
.breadcrumb li:last-child { color: var(--text-main); opacity: 0.7; pointer-events: none; font-weight: bold; }

/* Thumbnails di Detail */
.thumbnail-container { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; }
.thumbnail {
    width: 60px; height: 60px; object-fit: cover;
    border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer;
    opacity: 0.6; transition: 0.3s;
}
.thumbnail:hover, .thumbnail.active {
    opacity: 1; border-color: #2c3e50; border-width: 2px;
}

/* Zoom Modal */
.zoom-modal {
    display: none; position: fixed; z-index: 1000; padding-top: 50px;
    left: 0; top: 0; width: 100%; height: 100%; overflow: auto;
    background-color: rgba(0,0,0,0.9);
}
.zoom-modal-content {
    margin: auto; display: block; width: 80%; max-width: 700px;
    max-height: 80vh; object-fit: contain;
}
.zoom-close {
    position: absolute; top: 15px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer;
}
.zoom-close:hover, .zoom-close:focus {
    color: #bbb; text-decoration: none; cursor: pointer;
}

/* Category Menu (Horizontal) */
.category-menu {
    display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 20px;
}

.cat-link {
    display: inline-block; padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 20px; text-decoration: none; color: var(--text-heading); font-size: 0.9rem; transition: 0.2s;
}
.cat-link:hover, .cat-link.active { background: #2c3e50; color: white; border-color: #2c3e50; }

/* Toast Notification */
#toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 1000;
}
.toast {
    background-color: #333; color: #fff; padding: 12px 20px; border-radius: 4px;
    margin-top: 10px; opacity: 0; transition: opacity 0.3s, transform 0.3s;
    transform: translateY(20px); box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Share Buttons */
.share-container { margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 15px; }
.share-label { font-weight: bold; margin-bottom: 10px; display: block; color: var(--text-main); font-size: 0.9rem; }
.btn-share {
    border: none; color: white; width: 35px; height: 35px; border-radius: 50%;
    cursor: pointer; margin-right: 8px; font-size: 0.9rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: 0.2s; text-decoration: none; font-weight: bold;
}
.btn-share:hover { opacity: 0.8; transform: translateY(-2px); }
.share-fb { background: #3b5998; }
.share-tw { background: #000000; }
.share-wa { background: #25d366; }
.share-copy { background: #7f8c8d; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 30px; }
.page-btn {
    padding: 8px 12px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main);
    cursor: pointer; border-radius: 4px; transition: 0.2s;
}
.page-btn:hover { background: #f0f0f0; }
.page-btn.active { background: #2c3e50; color: white; border-color: #2c3e50; }

/* Floating WhatsApp Button */
.fab-wa {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.3s;
}
.fab-wa:hover { transform: scale(1.1); }
@media (min-width: 769px) {
    .fab-wa { bottom: 30px; }
}

/* Skeleton Loading Animation */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
body.dark-mode .skeleton {
    background: #2c3e50;
    background: linear-gradient(90deg, #2c3e50 25%, #34495e 50%, #2c3e50 75%);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 5px var(--shadow-color);
}
.skeleton-img { width: 100%; height: 200px; }
.skeleton-info { padding: 15px; }
.skeleton-text { height: 20px; margin-bottom: 10px; width: 80%; }
.skeleton-text-sm { height: 15px; width: 50%; margin-bottom: 15px; }
.skeleton-btn { height: 35px; width: 100%; border-radius: 4px; }

/* Discount Badge & Strikethrough Price */
.badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.price-strikethrough {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.85rem;
    margin-right: 5px;
}

/* Modern Login Modal Styles */
.login-header {
    text-align: center;
    margin-bottom: 25px;
}
.login-header img {
    max-width: 120px;
    margin-bottom: 15px;
}
.login-header h2 {
    color: var(--text-heading);
    font-size: 1.6rem;
    margin-bottom: 5px;
}
.login-header p {
    color: var(--text-main);
    opacity: 0.7;
    font-size: 0.95rem;
}
.login-form input {
    width: 100%;
    padding: 14px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}
.login-form input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
.btn-login-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}
.btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}
.login-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-main);
}
.login-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

/* Reviews & Ratings */
.rating-summary { display: flex; align-items: center; gap: 5px; margin-bottom: 15px; color: #f39c12; font-weight: bold; font-size: 1.1rem; }
.star-filled { color: #f39c12; }
.star-empty { color: #ccc; }

.reviews-section { margin-top: 40px; border-top: 1px solid var(--border-color); padding-top: 30px; }
.review-form { background: var(--bg-body); padding: 20px; border-radius: 8px; margin-bottom: 30px; border: 1px solid var(--border-color); }
.star-input { display: flex; gap: 5px; margin-bottom: 15px; cursor: pointer; }
.star-input .material-icons { font-size: 2rem; color: #ccc; transition: 0.2s; }
.star-input .material-icons.active, .star-input .material-icons:hover, .star-input:hover .material-icons:hover ~ .material-icons { color: #f39c12; } /* Hover effect logic handled by JS mostly, but CSS helps */

.review-list { display: flex; flex-direction: column; gap: 15px; }
.review-item { background: var(--bg-body); padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); }
.review-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: #666; }
body.dark-mode .review-header { color: var(--text-muted); } /* Warna teks header review diperbaiki */
.review-user { font-weight: bold; color: var(--text-heading); display: flex; align-items: center; gap: 8px; }
.review-text { margin-top: 5px; line-height: 1.5; color: var(--text-main); }

/* Proteksi Konten (Anti Copy/Right Click) - Kecuali Admin */
body:not(.admin-mode) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
body:not(.admin-mode) img {
    -webkit-user-drag: none;
}
/* Pastikan input tetap bisa diketik/dipilih */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Back to Top Button */
#btn-back-to-top {
    position: fixed;
    bottom: 110px; /* Di atas tombol WA (Desktop) */
    right: 20px;
    z-index: 1001; /* Lebih tinggi dari tombol WA (1000) */
    border: none;
    background-color: #2c3e50;
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: none; /* Hidden default */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
}
#btn-back-to-top:hover {
    background-color: #34495e;
    transform: translateY(-3px);
}
@media (max-width: 768px) {
    #btn-back-to-top {
        bottom: 170px; /* Di atas tombol WA (Mobile) */
    }
}