/*
Theme Name: MBT Market
Theme URI: https://yantonaim.web.id
Author: MBT Market
Description: Tema marketplace untuk MBT Plugin (produk & jasa digital, eCourse, artikel, member & affiliate). Memakai halaman, shortcode, dan topbar/footer bawaan plugin tanpa bentrok, dengan beranda landing sendiri.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mbt-market
Tags: e-commerce, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, one-column, two-columns
*/

/* =========================================================================
   Token
   ========================================================================= */
:root {
	--mm-primary: #2563eb;
	--mm-ink: #0f1a33;
	--mm-accent: #f5a524;
	--mm-paper: #f6f7fb;
	--mm-line: #e2e6ef;
	--mm-text: #1f2937;
	--mm-muted: #5b6475;
	--mm-radius: 10px;
	--mm-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--mm-wrap: 1180px;
	--mm-narrow: 760px;
}

/* =========================================================================
   Dasar. Sengaja TIDAK ada reset global untuk label/img/ul/h1-h6:
   plugin MBT mengunci tampilannya sendiri dan pernah bentrok dengan tema
   yang agresif. Semua gaya elemen di bawah dibatasi ke komponen tema.
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--mm-paper);
	color: var(--mm-text);
	font-family: var(--mm-font);
	font-size: 16px;
	line-height: 1.65;
}
a { color: var(--mm-primary); }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--mm-primary); outline-offset: 2px; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal;
}
.screen-reader-text:focus {
	background: #fff; clip: auto; clip-path: none; color: #000; display: block; height: auto; width: auto;
	left: 8px; top: 8px; padding: 10px 14px; z-index: 100000; border-radius: 6px;
}
.skip-link:focus { position: fixed; }

.container { width: 100%; max-width: var(--mm-wrap); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: calc(var(--mm-narrow) + 40px); }

/* Halaman MBT: biarkan plugin yang mengatur lebar & latar. */
.app-main { display: block; }

/* =========================================================================
   Tombol
   ========================================================================= */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 9px 18px; border-radius: 8px; border: 1.5px solid transparent;
	font: 600 15px/1.2 var(--mm-font); text-decoration: none; cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--mm-primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--mm-primary) 82%, #000); color: #fff; }
.btn-ghost { background: transparent; color: var(--mm-ink); border-color: var(--mm-line); }
.btn-ghost:hover { border-color: var(--mm-ink); }
.btn-quiet { background: transparent; color: var(--mm-muted); }
.btn-quiet:hover { color: var(--mm-ink); }
.btn-accent { background: var(--mm-accent); color: var(--mm-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--mm-accent) 85%, #fff); color: var(--mm-ink); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: #fff; border-bottom: 1px solid var(--mm-line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-inner { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.site-branding { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--mm-ink); flex-shrink: 0; }
.site-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 8px; background: var(--mm-primary); color: #fff; font-weight: 800;
}
.site-title { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.site-logo-img { display: block; max-height: 40px; width: auto; }

.site-nav { display: flex; align-items: center; flex: 1; gap: 24px; }
.primary-nav { flex: 1; }
.primary-nav ul, .footer-col ul { list-style: none; margin: 0; padding: 0; }
.primary-nav ul { display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav a {
	display: block; padding: 8px 12px; border-radius: 8px;
	color: var(--mm-ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { background: var(--mm-paper); }
.primary-nav .sub-menu { display: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--mm-line); border-radius: 8px; background: #fff; cursor: pointer; position: relative; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
	content: ""; position: absolute; left: 11px; width: 18px; height: 2px; background: var(--mm-ink); border-radius: 2px;
}
.nav-toggle-bars { top: 19px; }
.nav-toggle-bars::before { left: 0; top: -6px; }
.nav-toggle-bars::after { left: 0; top: 6px; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.js .site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 12px;
		padding: 14px 20px 20px; background: #fff; border-bottom: 1px solid var(--mm-line);
	}
	.js .site-nav.is-open { display: flex; }
	.site-nav { flex-wrap: wrap; }
	.primary-nav ul { flex-direction: column; }
	.header-actions { padding-top: 12px; border-top: 1px solid var(--mm-line); }
	.header-actions .btn { flex: 1; }
}

/* =========================================================================
   Mode "header & footer tema" di halaman MBT.
   CSS plugin menyembunyikan <header>/<footer> di body.mbt-app-page; kita menang
   lewat spesifisitas yang lebih tinggi, lalu menyembunyikan topbar/footer plugin.
   ========================================================================= */
body.mbt-app-page .site-header.mbt-keep { display: block !important; }
body.mbt-app-page .site-footer.mbt-keep { display: block !important; }
body.mbt-app-page.mbt-chrome-theme .mbt-topbar,
body.mbt-app-page.mbt-chrome-theme .mbt-app-footer { display: none !important; }

/* =========================================================================
   Beranda
   ========================================================================= */
.hero { background: var(--mm-ink); color: #fff; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; padding-block: 72px; }
.hero-copy h1 { margin: 0 0 18px; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; max-width: 17ch; }
.hero-copy p { margin: 0 0 30px; font-size: 1.125rem; color: rgba(255,255,255,.78); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-shelf { list-style: none; margin: 0; padding: 8px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; }
.hero-shelf li + li { border-top: 1px solid rgba(255,255,255,.1); }
.hero-shelf a { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 10px; color: #fff; text-decoration: none; }
.hero-shelf a:hover { background: rgba(255,255,255,.08); }
.shelf-thumb {
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
	background: rgba(255,255,255,.14); font-weight: 800; font-size: 20px;
}
.shelf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-text { display: flex; flex-direction: column; min-width: 0; }
.shelf-title { font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-price { color: var(--mm-accent); font-weight: 700; font-size: .95rem; }
.hero-empty { padding: 24px; border: 1px dashed rgba(255,255,255,.3); border-radius: 12px; color: rgba(255,255,255,.75); }

@media (max-width: 860px) {
	.hero-inner { grid-template-columns: 1fr; gap: 36px; padding-block: 48px; }
}

.section { padding-block: 64px; }
.section-tight { padding-block: 36px 0; }
.section-tint { background: #fff; border-block: 1px solid var(--mm-line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-title { margin: 0 0 20px; font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; color: var(--mm-ink); }
.section-head .section-title { margin: 0; }
.text-link { font-weight: 600; white-space: nowrap; }

.chip-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--mm-line); border-radius: 999px; background: #fff; color: var(--mm-ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.chip:hover { border-color: var(--mm-primary); color: var(--mm-primary); }
.chip-count { color: var(--mm-muted); font-weight: 500; font-size: 13px; }

/* Kartu produk */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--mm-line); border-radius: var(--mm-radius); overflow: hidden; transition: border-color .15s; }
.product-card:hover { border-color: var(--mm-primary); }
.product-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--mm-paper); }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; color: var(--mm-line); }
.product-card-flag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 6px; background: var(--mm-accent); color: var(--mm-ink); font-weight: 700; font-size: 13px; }
.product-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px; }
.product-card-kind { margin: 0; color: var(--mm-muted); font-size: 13px; }
.product-card-title { margin: 0; font-size: 1.05rem; line-height: 1.35; color: var(--mm-ink); }
.product-card-price { margin: 4px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 6px; }
.product-card-price strong { font-size: 1.15rem; color: var(--mm-ink); }
.product-card-price s { color: var(--mm-muted); font-size: .9rem; }
.product-card-price .unit { color: var(--mm-muted); font-size: .85rem; }

/* eCourse: baris horizontal */
.course-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-row { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--mm-paper); border: 1px solid var(--mm-line); border-radius: var(--mm-radius); text-decoration: none; color: var(--mm-ink); }
.course-row:hover { border-color: var(--mm-primary); }
.course-thumb { flex-shrink: 0; width: 112px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--mm-line); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.course-title { font-weight: 700; line-height: 1.3; }
.course-meta { color: var(--mm-muted); font-size: 14px; }
.course-price { font-weight: 800; white-space: nowrap; }
@media (max-width: 860px) { .course-list { grid-template-columns: 1fr; } }

/* Artikel: daftar tanggal + judul */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { display: flex; gap: 24px; padding: 14px 0; border-top: 1px solid var(--mm-line); }
.article-list li:last-child { border-bottom: 1px solid var(--mm-line); }
.article-list time { flex: 0 0 100px; color: var(--mm-muted); font-size: 14px; padding-top: 2px; }
.article-list a { font-weight: 650; font-size: 1.1rem; color: var(--mm-ink); text-decoration: none; }
.article-list a:hover { color: var(--mm-primary); }

/* Banner affiliate */
.section-banner { background: var(--mm-ink); color: #fff; margin-top: 24px; }
.banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 48px; }
.banner-inner h2 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -.02em; }
.banner-inner p { margin: 0; color: rgba(255,255,255,.75); max-width: 56ch; }
@media (max-width: 700px) { .banner-inner { flex-direction: column; align-items: flex-start; } }

/* =========================================================================
   Konten (halaman, blog, arsip)
   ========================================================================= */
.site-main:not(.app-main):not(.home) { padding-block: 48px; }

.layout-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.layout-with-sidebar.no-sidebar { grid-template-columns: minmax(0, var(--mm-narrow)); justify-content: center; }
@media (max-width: 900px) { .layout-with-sidebar { grid-template-columns: 1fr; } }

.archive-title { margin: 0 0 28px; font-size: 1.8rem; letter-spacing: -.02em; color: var(--mm-ink); }
.archive-desc { margin: -16px 0 28px; color: var(--mm-muted); }

.post-list { display: flex; flex-direction: column; }
.post-item { display: flex; gap: 22px; padding: 24px 0; border-top: 1px solid var(--mm-line); }
.post-item:first-child { border-top: 0; padding-top: 0; }
.post-item-thumb { flex: 0 0 200px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--mm-line); }
.post-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-item-title { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.3; }
.post-item-title a { color: var(--mm-ink); text-decoration: none; }
.post-item-title a:hover { color: var(--mm-primary); }
.post-item-body p:last-child { margin-bottom: 0; }
@media (max-width: 600px) { .post-item { flex-direction: column; } .post-item-thumb { flex-basis: auto; width: 100%; } }

.entry { background: #fff; border: 1px solid var(--mm-line); border-radius: var(--mm-radius); padding: 36px; }
@media (max-width: 600px) { .entry { padding: 22px; } }
.entry-title { margin: 0 0 8px; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; color: var(--mm-ink); }
.entry-meta { margin: 0 0 20px; color: var(--mm-muted); font-size: 14px; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { display: block; width: 100%; height: auto; border-radius: 8px; }
.entry-content { max-width: 70ch; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content h2, .entry-content h3 { color: var(--mm-ink); line-height: 1.3; letter-spacing: -.01em; margin: 1.8em 0 .6em; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--mm-primary); color: var(--mm-muted); }
.entry-content pre { overflow-x: auto; padding: 16px; background: var(--mm-ink); color: #e6ecf8; border-radius: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 8px 10px; border: 1px solid var(--mm-line); text-align: left; }
@media (min-width: 1000px) {
	.entry-content .alignwide { max-width: calc(100% + 120px); margin-inline: -60px; }
}
.alignleft { float: left; margin: 0 20px 12px 0; }
.alignright { float: right; margin: 0 0 12px 20px; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { color: var(--mm-muted); font-size: 14px; text-align: center; }

.page-links, .navigation { margin-top: 28px; }
.pagination .nav-links, .post-navigation .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.page-numbers { display: inline-block; padding: 7px 14px; border: 1px solid var(--mm-line); border-radius: 8px; background: #fff; color: var(--mm-ink); text-decoration: none; font-weight: 600; }
.page-numbers.current { background: var(--mm-ink); border-color: var(--mm-ink); color: #fff; }
.post-navigation a { text-decoration: none; font-weight: 600; }

.not-found { text-align: center; }
.not-found h1 { font-size: 2rem; color: var(--mm-ink); }

/* Form pencarian */
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form label { flex: 1; margin: 0; }
.search-field { width: 100%; padding: 10px 14px; border: 1.5px solid var(--mm-line); border-radius: 8px; font: inherit; background: #fff; }
.search-submit { padding: 10px 18px; border: 0; border-radius: 8px; background: var(--mm-primary); color: #fff; font-weight: 600; cursor: pointer; }

/* Sidebar & widget */
.sidebar .widget { background: #fff; border: 1px solid var(--mm-line); border-radius: var(--mm-radius); padding: 20px; margin-bottom: 20px; }
.widget-title { margin: 0 0 12px; font-size: 1.05rem; color: var(--mm-ink); }
.sidebar .widget ul { margin: 0; padding-left: 18px; }

/* Komentar */
.comments-area { margin-top: 36px; }
.comments-title { font-size: 1.3rem; color: var(--mm-ink); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-top: 1px solid var(--mm-line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--mm-line); border-radius: 8px; font: inherit; }
.comment-form .submit { padding: 10px 20px; border: 0; border-radius: 8px; background: var(--mm-primary); color: #fff; font-weight: 600; cursor: pointer; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--mm-ink); color: rgba(255,255,255,.78); margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; padding-block: 56px 32px; }
.footer-brand { margin: 0 0 8px; color: #fff; font-weight: 800; font-size: 1.2rem; }
.footer-col p { margin: 0 0 10px; }
.footer-col .widget-title { color: #fff; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col .widget { background: transparent; border: 0; padding: 0; margin: 0 0 20px; }
.footer-bottom { padding-block: 20px 28px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; color: rgba(255,255,255,.6); }
.footer-bottom p { margin: 0; }

/* =========================================================================
   Gerak: hormati preferensi pengguna
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
