/* KISHWOOD public site. Mobile-first. Colours and radius come from settings (CSS variables in the page head). */
:root {
    --primary: #7a4b2a; --secondary: #1f2937; --accent: #c8963e; --radius: 12px;
    --bg: #faf8f5; --surface: #ffffff; --text: #1f2937; --muted: #6b7280; --border: #ebe5dd;
    --danger: #b42318; --success: #1a7f37; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(31,41,55,.07);
}
[data-theme="dark"] { --bg: #14161a; --surface: #1d2026; --text: #e7e9ee; --muted: #9aa1ad; --border: #2c313a; --shadow: 0 10px 30px rgba(0,0,0,.4); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.75; font-size: 15px;
    font-family: Vazirmatn, "IRANSans", "Segoe UI", Tahoma, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1 { font-size: 1.4rem; margin: 18px 0 10px; }
h2 { font-size: 1.1rem; margin: 26px 0 12px; }
.muted, small { color: var(--muted); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.wrap { min-height: 60vh; padding-bottom: 40px; }

.notice { background: var(--primary); color: #fff; text-align: center; padding: 6px 12px; font-size: .9rem; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { font-size: 1.35rem; font-weight: 800; letter-spacing: .05em; color: var(--primary); }
.logo img { max-height: 40px; display: block; }
.search { flex: 1; min-width: 150px; order: 3; flex-basis: 100%; }
.tools { display: flex; align-items: center; gap: 14px; margin-inline-start: auto; font-size: .95rem; }
.cart-link b { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; font-size: .85rem; }
.menu { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; white-space: nowrap; font-size: .95rem; color: var(--muted); }
.menu a:hover, .tools a:hover { color: var(--primary); }

input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); padding: 10px 12px;
    border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; padding: 10px 20px;
    border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--danger); cursor: pointer; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 14px 0; border: 1px solid; }
.alert.success { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }

.banner { display: flex; align-items: flex-end; min-height: 200px; margin: 16px 0; padding: 22px; border-radius: calc(var(--radius) + 6px);
    background: linear-gradient(135deg, var(--secondary), var(--primary)); background-size: cover; background-position: center; color: #fff; }
.banner strong { display: block; font-size: 1.5rem; }
.banner small { color: rgba(255,255,255,.85); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head form { margin: 0; }
.sort select { width: auto; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.chips a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px; }
.chips a:hover { border-color: var(--primary); color: var(--primary); }

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card .image { position: relative; display: block; aspect-ratio: 1; background: color-mix(in srgb, var(--muted) 10%, var(--surface)); }
.product-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card em { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--accent); color: #fff; font-style: normal; font-size: .8rem; padding: 1px 10px; border-radius: 999px; }
.product-card .name { padding: 10px 12px 0; font-weight: 600; }
.product-card .code { padding: 0 12px; color: var(--muted); font-size: .82rem; }
.product-card .price { padding: 4px 12px 12px; color: var(--primary); font-weight: 700; margin-top: auto; }

.product { display: grid; gap: 22px; margin-top: 16px; }
.stage { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); aspect-ratio: 1; overflow: hidden; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; cursor: zoom-in; }
.stage img.on { opacity: 1; pointer-events: auto; }
.stage img.zoom { transform: scale(1.9); cursor: zoom-out; }
.no-image { position: absolute; inset: 0; background: color-mix(in srgb, var(--muted) 10%, var(--surface)); }
.strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.strip button { flex: none; width: 64px; height: 64px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: none; cursor: pointer; }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crumb { color: var(--muted); font-size: .9rem; }
.info h1 { margin-top: 4px; }
.info .code { color: var(--muted); margin: 0 0 8px; }
.price-box { margin: 14px 0; }
.price-box .price { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.price-box s { color: var(--muted); margin-inline-start: 10px; }
.price-box small { display: block; }
.option { border: 0; padding: 0; margin: 0 0 14px; }
.option legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.option label { display: inline-flex; align-items: center; margin: 0 0 8px; margin-inline-end: 8px; cursor: pointer; }
.option input { position: absolute; opacity: 0; width: 0; }
.pill span { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 16px; }
.pill input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.swatch { gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; }
[dir=rtl] .swatch { padding: 4px 4px 4px 12px; }
.swatch i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); display: block; }
.swatch:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.stock { font-weight: 600; margin: 6px 0; }
.stock.in { color: var(--success); } .stock.out { color: var(--danger); }
.buy-row { display: flex; gap: 10px; margin-bottom: 8px; }
.buy-row input { width: 84px; text-align: center; }
.buy-row .btn { flex: 1; }
.specs { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.specs th, .specs td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--border); }
.specs th { width: 40%; color: var(--muted); font-weight: 500; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.description { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

.cart-layout { display: grid; gap: 20px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr; gap: 10px 12px; align-items: center; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.cart-item .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--muted) 10%, var(--surface)); display: block; }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item .what small { display: block; }
.cart-item input { width: 84px; text-align: center; }
.cart-item .sum { text-align: end; }
.cart-side, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cart-side { align-self: start; }
.cart-side h2, .panel h2 { margin-top: 0; }
.discount { display: flex; gap: 8px; margin-bottom: 8px; }
.totals { width: 100%; border-collapse: collapse; margin: 10px 0; }
.totals th { text-align: start; font-weight: 400; color: var(--muted); padding: 6px 0; }
.totals td { text-align: end; padding: 6px 0; white-space: nowrap; }
.totals .minus td { color: var(--success); }
.totals .grand th, .totals .grand td { border-top: 1px solid var(--border); padding-top: 12px; font-weight: 800; color: var(--text); font-size: 1.1rem; }
.mini-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.form label { display: block; margin-bottom: 14px; }
.form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .92rem; }
.two { display: grid; gap: 0 14px; }
.table-wrap { overflow-x: auto; }
.lines { width: 100%; border-collapse: collapse; }
.lines th, .lines td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lines th { color: var(--muted); font-weight: 500; font-size: .9rem; }
.lines td small { display: block; white-space: normal; }
.tag { display: inline-block; padding: 1px 12px; border-radius: 999px; font-size: .85rem; background: color-mix(in srgb, var(--muted) 15%, transparent); }
.tag.paid { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.tag.pending, .tag.partially_paid { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.tag.cancelled, .tag.refunded { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.done { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.qr { width: 220px; max-width: 70%; margin: 10px auto; background: #fff; padding: 8px; border-radius: 12px; }
.qr.small { width: 150px; }
.qr svg { display: block; width: 100%; height: auto; }
.tracking b { font-size: 1.5rem; letter-spacing: .08em; }
.credentials { text-align: start; margin: 18px auto 0; max-width: 460px; border: 1px dashed var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.credentials h2 { margin: 0 0 6px; }
.pagination { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 18px 0; }

.site-footer { background: var(--secondary); color: #cbd5e1; margin-top: 30px; padding: 26px 0 14px; }
.site-footer strong { display: block; color: #fff; margin-bottom: 6px; }
.site-footer a { display: block; }
.site-footer p { margin: 2px 0; }
.cols { display: grid; gap: 18px; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 18px; padding-top: 12px; font-size: .88rem; }

@media (min-width: 700px) {
    .search { order: 0; flex-basis: auto; max-width: 420px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .product { grid-template-columns: 1fr 1fr; gap: 34px; }
    .cart-layout { grid-template-columns: 1fr 340px; }
    .cart-item { grid-template-columns: 64px 1fr 84px 150px auto; }
    .two { grid-template-columns: 1fr 1fr; }
    .cols { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* sizes such as "90×200" keep their reading order inside right-to-left pages */
.pill span, .swatch span, .specs td, .cart-item small, .lines td small { unicode-bidi: plaintext; }

/* ======================================================================
   v3 — refreshed look + catalog filters
   ====================================================================== */
@font-face { font-family: Vazirmatn; font-weight: 100 900; font-display: swap;
    src: local("Vazirmatn"), local("Vazirmatn Variable"), url("fonts/Vazirmatn.woff2") format("woff2"); }
:root { --ring: color-mix(in srgb, var(--primary) 22%, transparent); --surface-2: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
h1 { font-weight: 800; letter-spacing: -.01em; }
.site-header { backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--surface) 90%, transparent); }
.logo { letter-spacing: .08em; }
.search input { background: var(--surface-2); border-radius: 999px; padding-inline: 18px; }
.btn { font-weight: 600; transition: background .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, #fff), var(--primary)); box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 32%, transparent); }
.btn.primary:hover { background: var(--primary); filter: brightness(1.08); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--ring); }
.banner { box-shadow: var(--shadow); }
.product-card { border-radius: calc(var(--radius) + 2px); }
.product-card:hover { box-shadow: 0 14px 34px rgba(31,41,55,.14); transform: translateY(-3px); }
.product-card img { transition: transform .35s; }
.product-card:hover img { transform: scale(1.04); }
.product-card .image { overflow: hidden; }
.chips a { transition: all .15s; }
.chips a:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.panel { border-radius: calc(var(--radius) + 2px); }

/* ---- catalog filters ---- */
.catalog-layout { display: grid; gap: 18px; margin-top: 12px; }
.filters-panel details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; }
.filters-panel summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.filters-panel summary::-webkit-details-marker { display: none; }
.filters-panel summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.filters-panel details[open] summary::after { content: "▴"; }
.filters-panel .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.filters-form { padding-bottom: 14px; }
.filters-form fieldset { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 12px 0; }
.filters-form legend { padding: 0; font-weight: 600; float: left; width: 100%; margin-bottom: 8px; }
.filters-form legend + * { clear: both; }
.filters-form .opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.filters-form .opt input { width: 17px; height: 17px; accent-color: var(--primary); }
.filters-form .swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); display: inline-block; }
.filters-form .range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters-form .btn { margin-top: 8px; }
@media (min-width: 900px) {
    .catalog-layout { grid-template-columns: 250px 1fr; align-items: start; }
    .filters-panel { position: sticky; top: 110px; }
}
.description h3, .description h4 { margin: 1em 0 .4em; }
.description blockquote { margin: .8em 0; padding: 4px 14px; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.description ul, .description ol { padding-inline-start: 1.6em; }

/* bundled IRANSans (files in assets/fonts) */
@font-face { font-family: "IRANSans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/iransans-regular.woff2") format("woff2"); }
@font-face { font-family: "IRANSans"; font-weight: 500 700; font-style: normal; font-display: swap; src: url("fonts/iransans-bold.woff2") format("woff2"); }
body, button, input, select, textarea { font-family: "IRANSans", Vazirmatn, "Segoe UI", Tahoma, system-ui, sans-serif; }
