/*
Theme Name: Dhaka Source
Theme URI: https://dhakasource.com
Author: Dhaka Source
Description: প্লাগিন ছাড়া পূর্ণ ই-কমার্স থিম — পণ্য, ক্যাটাগরি, কার্ট, চেকআউট ও অর্ডার ম্যানেজমেন্টসহ। মধু, ঘি ও খাদ্যপণ্যের দোকানের জন্য।
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: dhaka-source
*/

:root {
	--green: #2f4a2b;
	--green-d: #213820;
	--gold: #d99a1e;
	--gold-d: #b87f10;
	--gold-soft: #fbe8b8;
	--cream: #fbf6ea;
	--ink: #241f17;
	--muted: #6d655a;
	--line: #e6dcc6;
	--white: #fff;
	--danger: #b3261e;
	--radius: 14px;
	--shadow: 0 6px 22px rgba(36, 31, 23, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", "Noto Sans Bengali", sans-serif;
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--gold-d); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; color: var(--green-d); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; background: var(--white); padding: 8px 14px; z-index: 999; border-radius: 8px; }
.hp { position: absolute; left: -9999px; }

/* বোতাম */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--gold); color: #1d1608; border: 0; border-radius: 999px;
	padding: 10px 22px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--gold-d); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #ddd5c4; color: #8b8372; cursor: not-allowed; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; }

/* টপবার ও হেডার */
.topbar { background: var(--green-d); color: #f3ecd6; font-size: .9rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.topbar a { color: #f3ecd6; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand-text { font-size: 1.5rem; font-weight: 700; color: var(--green-d); letter-spacing: -.01em; }
.brand img { max-height: 48px; width: auto; }
.primary-nav .menu { display: flex; gap: 6px; }
.primary-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--gold-soft); color: var(--green-d); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-mini input { width: 190px; border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 8px 16px; }
.cart-link { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--green-d); background: var(--gold-soft); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--green); color: #fff; font-size: .75rem; line-height: 20px; text-align: center; }
.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--green-d); margin: 6px 0; transition: transform .2s, opacity .2s; }

/* হিরো */
.hero { background: linear-gradient(135deg, var(--cream), #f6ebcb); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 28px; padding: 56px 0; }
.eyebrow { color: var(--gold-d); font-weight: 600; letter-spacing: .04em; margin-bottom: .3em; }
.lead { font-size: 1.15rem; color: #4a4336; max-width: 34em; }
.hero-art { max-width: 340px; justify-self: center; width: 100%; }

.trust { border-block: 1px solid var(--line); background: var(--white); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 18px 0; }
.trust-grid div { display: flex; flex-direction: column; }
.trust-grid span { color: var(--muted); font-size: .9rem; }

/* সেকশন */
.section { padding: 48px 0; }
.section-alt { background: var(--cream); }
.section-title { margin-bottom: 1em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head .more { font-weight: 600; }
.page-head { background: var(--cream); border-bottom: 1px solid var(--line); padding: 32px 0 18px; }
.page-head h1 { margin: 0; }
.empty { padding: 28px; text-align: center; background: var(--cream); border-radius: var(--radius); color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; justify-content: flex-end; min-height: 130px; padding: 20px; border-radius: var(--radius); background: linear-gradient(160deg, var(--green), var(--green-d)); color: #fff; transition: transform .15s; }
.cat-tile:hover { transform: translateY(-3px); color: #fff; }
.cat-name { font-size: 1.35rem; font-weight: 700; }
.cat-count { opacity: .8; font-size: .9rem; }

/* গ্রিড ও কার্ড */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { position: relative; display: block; aspect-ratio: 1; background: var(--cream); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.no-img { display: grid; place-items: center; height: 100%; color: var(--muted); }
.no-img.big { aspect-ratio: 1; background: var(--cream); border-radius: var(--radius); }
.badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge.sale { background: var(--danger); color: #fff; }
.badge.out { background: #4a4336; color: #fff; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-title a { color: var(--ink); }
.unit { color: var(--muted); font-size: .9rem; margin: 0; }
.price { margin: 4px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.price strong { font-size: 1.25rem; color: var(--green-d); }
.price del { color: var(--muted); font-size: .95rem; }
.price.big strong { font-size: 1.9rem; }
.card .btn { margin-top: auto; }

.post-card h2, .post-card h3 { font-size: 1.15rem; margin-top: 12px; }
.post-card img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.post-row { padding: 18px 0; border-bottom: 1px solid var(--line); }

/* শপ টুলবার */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); }
.chip.on, .chip:hover { background: var(--green); color: #fff; border-color: var(--green); }
.sort select { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: var(--white); }
.pagination { margin-top: 32px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }

/* একক পণ্য */
.crumbs { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 42px; height: 46px; border: 0; background: var(--cream); cursor: pointer; font-size: 1.2rem; }
.qty input { width: 54px; height: 46px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.warn { color: var(--danger); font-weight: 600; }
.perks li { padding-left: 24px; position: relative; color: var(--muted); }
.perks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.product-desc { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.entry { font-size: 1.05rem; }
.entry img { border-radius: var(--radius); }
.entry h2, .entry h3 { margin-top: 1.4em; }
.entry ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.entry ol { list-style: decimal; padding-left: 1.4em; margin-bottom: 1em; }
.hero-img { border-radius: var(--radius); margin-bottom: 24px; width: 100%; }

.why { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 10px; background: var(--cream); border-radius: var(--radius); }
.steps b { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #1d1608; }

/* কার্ট */
.cart-empty { text-align: center; padding: 48px 0; }
.cart-layout, .checkout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--cream); }
.cart-item h3 { font-size: 1.02rem; margin: 0 0 4px; }
.cart-item .qty { margin-top: 6px; }
.cart-item .qty button { height: 36px; width: 36px; }
.cart-item .qty input { height: 36px; width: 44px; }
.cart-item .line-total { font-weight: 700; text-align: right; }
.link-btn { background: none; border: 0; color: var(--danger); cursor: pointer; padding: 4px 0; font-size: .9rem; }
.summary { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 90px; }
.summary h2 { font-size: 1.25rem; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 1.2rem; font-weight: 700; color: var(--green-d); }
.free-note { font-size: .9rem; color: var(--green); background: var(--gold-soft); padding: 8px 12px; border-radius: 10px; margin: 8px 0; }

/* চেকআউট ফর্ম */
.checkout-form label { display: block; margin-bottom: 14px; font-weight: 500; }
.checkout-form input[type="text"], .checkout-form input[type="tel"], .checkout-form textarea {
	display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); font-weight: 400;
}
.checkout-form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.checkout-form legend { padding: 0 8px; font-weight: 600; }
.checkout-form .opt { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-weight: 400; cursor: pointer; }
.pay-box { background: var(--gold-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.pay-box[hidden] { display: none; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.4em; }
.order-done { text-align: center; padding: 40px 20px; background: var(--cream); border-radius: var(--radius); grid-column: 1 / -1; }
.order-done .no { font-size: 1.6rem; font-weight: 700; color: var(--green-d); }

/* ফুটার */
.site-footer { background: var(--green-d); color: #e9e1c9; padding-top: 44px; }
.site-footer h3, .site-footer h4 { color: #fff; }
.site-footer a { color: #f3ecd6; }
.site-footer a:hover { color: var(--gold); }
.site-footer li { margin-bottom: 6px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.social { display: flex; gap: 14px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9rem; }

.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #25a244; color: #fff; box-shadow: var(--shadow); }
.wa-float:hover { color: #fff; background: #1c8a38; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; background: var(--green-d); color: #fff; padding: 12px 22px; border-radius: 999px; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* মোবাইল */
@media (max-width: 900px) {
	.hero-inner, .why, .product-layout, .cart-layout, .checkout { grid-template-columns: 1fr; }
	.hero-art { max-width: 200px; order: -1; }
	.trust-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.summary { position: static; }
	.nav-toggle { display: block; order: -1; margin-left: -10px; }
	.brand { margin-right: auto; }
	.search-mini { display: none; }
	.primary-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); display: none; padding: 8px 16px 14px; }
	.primary-nav.open { display: block; }
	.primary-nav .menu { flex-direction: column; }
	.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
	.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
@media (max-width: 560px) {
	body { font-size: 16px; }
	.topbar .wrap { flex-direction: column; align-items: center; gap: 0; }
	.grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.grid-3 { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.section { padding: 32px 0; }
	.cart-item { grid-template-columns: 70px 1fr; }
	.cart-item img { width: 70px; height: 70px; }
	.cart-item .line-total { grid-column: 2; text-align: left; }
	.buy-row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
