:root {
    --mp-primary: #03ac0e;
    --mp-primary-dark: #028a0b;
    --mp-primary-soft: #e8f8e9;
    --mp-accent: #f59e0b;
    --mp-bg: #f0f3f7;
    --mp-surface: #ffffff;
    --mp-text: #212121;
    --mp-muted: #6d7588;
    --mp-border: #e5e7e9;
    --mp-radius: 12px;
    --mp-shadow: 0 1px 6px rgba(49, 53, 59, 0.12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    background: var(--mp-bg);
    color: var(--mp-text);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* TOP UTILITY BAR (TIPIS SEPERTI TOKOPEDIA/SHOPEE) */
.mp-topbar {
    background: #f3f4f5;
    border-bottom: 1px solid var(--mp-border);
    font-size: 12px;
    color: var(--mp-muted);
}
.mp-topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.mp-topbar-links {
    display: flex;
    gap: 16px;
}
.mp-topbar-links a:hover { color: var(--mp-primary); }

/* MAIN STICKY E-COMMERCE HEADER */
.mp-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--mp-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.mp-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.mp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.mp-brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}
.mp-brand-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--mp-primary);
    letter-spacing: -0.02em;
}
.mp-brand-sub {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--mp-muted);
    margin-top: -3px;
}

/* SEARCH BAR TENGAH */
.mp-search {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mp-search:focus-within {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px rgba(3, 172, 14, 0.12);
}
.mp-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--mp-text);
}
.mp-search button {
    background: var(--mp-primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.mp-search button:hover { background: var(--mp-primary-dark); }
.mp-search button svg { width: 16px; height: 16px; fill: currentColor; }

/* AKSI KANAN */
.mp-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.mp-btn-outline {
    padding: 8px 15px;
    border-radius: 9px;
    border: 1.5px solid var(--mp-primary);
    color: var(--mp-primary);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}
.mp-btn-outline:hover { background: var(--mp-primary-soft); }
.mp-btn-solid {
    padding: 9px 16px;
    border-radius: 9px;
    background: var(--mp-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
}
.mp-btn-solid:hover { background: var(--mp-primary-dark); }

/* CONTAINER UTAMA */
.mp-container {
    max-width: 1240px;
    margin: 20px auto 60px;
    padding: 0 20px;
}

/* BANNER PROMO MARKETPLACE */
.mp-promo {
    background: linear-gradient(120deg, #065f29 0%, #03ac0e 60%, #16a34a 100%);
    border-radius: 16px;
    padding: 28px 34px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(3, 172, 14, 0.18);
    overflow: hidden;
    position: relative;
}
.mp-promo::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.mp-promo-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 10px;
}
.mp-promo h1 {
    margin: 0 0 6px;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
}
.mp-promo p {
    margin: 0;
    font-size: 14px;
    color: #ecfdf5;
    max-width: 560px;
}
.mp-promo img {
    width: 120px;
    height: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

/* KATEGORI PILLS HORIZONTAL */
.mp-cat-wrap {
    background: var(--mp-surface);
    border-radius: var(--mp-radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mp-cat-wrap::-webkit-scrollbar { display: none; }
.mp-cat-pill {
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.mp-cat-pill:hover {
    background: var(--mp-primary-soft);
    color: var(--mp-primary);
}
.mp-cat-pill.active {
    background: var(--mp-primary);
    color: #fff;
}

/* BAR HASIL & URUTKAN */
.mp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.mp-count {
    font-size: 14px;
    color: var(--mp-muted);
}
.mp-count strong { color: var(--mp-text); }
.mp-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mp-muted);
}
.mp-sort select {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--mp-text);
    cursor: pointer;
}

/* PRODUCT GRID ALA TOKOPEDIA / SHOPEE (5 KOLOM DESKTOP, 2 KOLOM HP) */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.mp-card {
    background: var(--mp-surface);
    border-radius: var(--mp-radius);
    overflow: hidden;
    box-shadow: var(--mp-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(49, 53, 59, 0.14);
}
.mp-thumb {
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
    color: #9ca3af;
    font-size: 12.5px;
}
.mp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.mp-card:hover .mp-thumb img { transform: scale(1.06); }
.mp-kat-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(17, 24, 39, 0.68);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.mp-body {
    padding: 11px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.mp-title {
    margin: 0 0 6px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--mp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}
.mp-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--mp-text);
    margin-bottom: 8px;
}
.mp-meta {
    font-size: 11.5px;
    color: var(--mp-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 11px;
}
.mp-shop {
    font-weight: 700;
    color: var(--mp-primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-btn-buy {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--mp-primary);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    transition: background 0.2s;
}
.mp-btn-buy:hover { background: var(--mp-primary-dark); }
.mp-btn-buy svg { width: 15px; height: 15px; fill: currentColor; }
.mp-btn-off {
    margin-top: auto;
    text-align: center;
    background: #e5e7eb;
    color: #6b7280;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* EMPTY STATE */
.mp-empty {
    grid-column: 1 / -1;
    background: var(--mp-surface);
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    box-shadow: var(--mp-shadow);
}
.mp-empty h3 { margin: 0 0 8px; font-size: 18px; color: var(--mp-text); }
.mp-empty p { margin: 0 0 20px; font-size: 14px; color: var(--mp-muted); }

/* FOOTER SIMPLE */
.mp-footer {
    background: var(--mp-surface);
    border-top: 1px solid var(--mp-border);
    text-align: center;
    padding: 22px 20px;
    font-size: 13px;
    color: var(--mp-muted);
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .mp-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
    .mp-grid { grid-template-columns: repeat(3, 1fr); }
    .mp-header-inner { flex-wrap: wrap; gap: 12px; }
    .mp-search { order: 3; flex: 1 1 100%; }
    .mp-actions { margin-left: auto; }
    .mp-promo { padding: 22px 20px; }
    .mp-promo img { width: 82px; }
}
@media (max-width: 540px) {
    .mp-topbar { display: none; }
    .mp-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .mp-brand-text { font-size: 17px; }
    .mp-promo img { display: none; }
    .mp-btn-outline { display: none; }
}

/* === KOMPATIBILITAS LINTAS-BROWSER (HP & DESKTOP) === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}
body {
    overflow-x: hidden;
    overflow-x: clip;
    min-height: 100vh;
    min-height: 100dvh;
}
a, button, input, select, textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
button, input[type="submit"], input[type="button"] {
    -webkit-appearance: none;
    appearance: none;
}
.mp-kat-tag {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px !important;
    }
}
