:root {
    --primary: #03ac0e; /* Tokopedia Green */
    --primary-dark: #028a0b;
    --secondary: #fa591d; /* Shopee Orange */
    --accent: #2d9cdb; /* Blue */
    --bg-light: #f3f4f5;
    --white: #ffffff;
    --text-dark: #212121;
    --text-grey: #6c757d;
    --border: #e0e0e0;
    --radius: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08); /* More elegant, diffuse shadow */
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
    --bg-light: #121212;
    --white: #1e1e1e;
    --text-dark: #e0e0e0;
    --text-grey: #a0a0a0;
    --border: #333;
    --shadow: 0 1px 6px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-light);
    color: var(--text-dark);
    padding-bottom: 70px; /* Space for bottom nav */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; transition: 0.2s; text-align: center;}
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: transparent; }
.btn-block { display: block; width: 100%; }
.d-flex { display: flex; align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.text-primary { color: var(--primary); }

/* Header */
header { background: var(--white); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.top-bar { background: var(--bg-light); padding: 4px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.main-header { padding: 12px 0; }
.logo { font-size: 24px; font-weight: 800; color: var(--primary); }
.search-bar { flex: 1; margin: 0 20px; position: relative; }
.search-bar input { width: 100%; padding: 10px 40px 10px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-light); color: var(--text-dark); }
.search-bar button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-grey); }

/* Mobile Bottom Nav (Curved) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--white);
    display: flex; justify-content: space-around; align-items: center;
    height: 60px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1001;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 10px; color: var(--text-grey);
    width: 20%;
}
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 20px; margin-bottom: 2px; }

/* Central Plus Button */
.nav-plus {
    position: relative;
    top: -25px;
    background: var(--primary);
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: white; font-size: 24px;
    box-shadow: 0 4px 10px rgba(3, 172, 14, 0.4);
    border: 4px solid var(--bg-light); /* Cutout effect */
}
/* Cutout SVG Background for smooth curve - simplified with CSS for now */

/* Homepage */
.hero-slider { margin: 16px 0; border-radius: var(--radius-lg); overflow: hidden; position: relative; height: 180px; background: #eee; }
.hero-slider img { width: 100%; height: 100%; object-fit: cover; }

.category-scroll { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 8px; scrollbar-width: none; }
.category-item { min-width: 80px; text-align: center; }
.cat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-size: 24px; color: white; }

.item-card { position: relative; transition: transform 0.2s; }
.item-card:hover { transform: translateY(-4px); }
.item-img { height: 160px; width: 100%; object-fit: cover; }
.item-info { padding: 12px; }
.item-title { font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px; font-size: 14px; }
.item-meta { font-size: 12px; color: var(--text-grey); display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.badge-urgent { position: absolute; top: 8px; left: 8px; background: red; color: white; padding: 2px 8px; font-size: 10px; border-radius: 4px; font-weight: bold; }

/* Forms */
.form-control { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; background: var(--bg-light); color: var(--text-dark); }
.file-upload-wrapper { border: 2px dashed var(--border); padding: 30px; text-align: center; border-radius: var(--radius); background: var(--bg-light); cursor: pointer; }

/* Responsive Grid Overrides */
@media (max-width: 767px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; } /* Force stack on mobile */
    .desktop-nav { display: none; }
    .search-bar { display: none; } /* Simplify header on mobile */
    .mobile-header-search { display: block; margin: 0 16px 16px; }
}

@media (min-width: 768px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .bottom-nav { display: none; } /* Hide mobile nav on desktop */
    body { padding-bottom: 0; }
    .hero-slider { height: 350px; }
}

/* Color Blocks (Specific) */
.bg-gradient-green { background: linear-gradient(135deg, #03ac0e 0%, #028a0b 100%); color: white; }
.bg-gradient-orange { background: linear-gradient(135deg, #fa591d 0%, #f53d2d 100%); color: white; }

/* Animations */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(3, 172, 14, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(3, 172, 14, 0); } 100% { box-shadow: 0 0 0 0 rgba(3, 172, 14, 0); } }
.pulse-btn { animation: pulse 2s infinite; }

/* Product Detail Premium Layout */
.product-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mobile Order: Title (Header) -> Image (Gallery) -> Details (Body) */
.product-header { order: 1; }
.product-gallery { order: 2; }
.product-body { order: 3; }

/* Product Header Styles */
.product-header {
    background: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.product-title-main {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1.4;
}
.product-price-tag {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    background: #e8f5e9;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Gallery Styles */
.product-gallery .main-img-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}
.product-gallery .main-img {
    width: 100%;
    height: 350px; /* Taller on mobile for better view */
    object-fit: contain;
    background: #000;
}
.thumb-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.thumb-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
}
.thumb-img:hover { border-color: var(--primary); }

/* Body Styles */
.product-body .card {
    padding: 16px;
    margin-bottom: 16px;
}
.product-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-grey);
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

/* Share Modal Styles */
.share-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000;
    display: none; align-items: flex-end; justify-content: center;
}
.share-modal-content {
    background: var(--white);
    width: 100%; max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
}
.share-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dark); cursor: pointer; }
.share-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
    transition: transform 0.2s;
}
.share-item:hover .share-icon { transform: scale(1.1); }
.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-tw { background: #1DA1F2; }
.share-tg { background: #0088cc; }
.share-cp { background: #7f8c8d; }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Desktop Grid Layout */
@media (min-width: 768px) {
    .share-modal-overlay { align-items: center; }
    .share-modal-content { border-radius: 12px; animation: fadeIn 0.3s; }

    .product-layout {
        display: grid;
        grid-template-columns: 450px 1fr;
        grid-template-areas:
            "gallery header"
            "gallery body";
        gap: 24px;
        align-items: start;
    }
    .product-gallery { grid-area: gallery; order: unset; }
    .product-header { grid-area: header; order: unset; margin-bottom: 0; }
    .product-body { grid-area: body; order: unset; }

    .product-title-main { font-size: 28px; }
    .product-gallery .main-img { height: 450px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
