/* ===== Maktaba-e-Nomania online shop (Urdu, right to left) =====
   Fonts: Noto Naskh Arabic for normal text, Noto Nastaliq Urdu for headings and category names
   (loaded in the <head> of every page). */

:root {
    --green: #0f4d34;
    --green-2: #176b45;
    --green-3: #e7f3ec;
    --gold: #c9971c;
    --gold-2: #e3b53d;
    --ink: #1b2a22;
    --muted: #66786e;
    --line: #e3ebe5;
    --bg: #f7f8f6;
    --white: #ffffff;
    --red: #c0392b;
    --radius: 14px;
    --naskh: "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    --nastaliq: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--naskh);
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
input, textarea, select { direction: rtl; }
input[type="email"], input[type="tel"], input[type="password"] { direction: ltr; text-align: right; }
bdi[dir="ltr"] { unicode-bidi: isolate; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.loading, .empty { padding: 40px 0; text-align: center; color: var(--muted); }
.empty a { color: var(--green-2); font-weight: 700; text-decoration: underline; }
.cat-ur { font-family: var(--nastaliq); }

/* ----- top bar ----- */

.topbar { color: #e8f3ec; background: var(--green); font-size: 13.5px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.topbar-info, .topbar-links { display: flex; align-items: center; gap: 18px; }
.tb-item { display: inline-flex; align-items: center; gap: 6px; }
.tb-wa { font-weight: 700; color: var(--gold-2); }
.topbar-links a:hover { color: #fff; text-decoration: underline; }

/* ----- header ----- */

.header { position: sticky; top: 0; z-index: 30; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15, 77, 52, 0.04); }
.header-row { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 50px; width: auto; }
.brand-text { display: flex; flex-direction: column; font-family: "Segoe UI", Arial, sans-serif; line-height: 1.15; }
.brand-text b { font-size: 19px; font-weight: 800; color: var(--green); }
.brand-text small { font-size: 11px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }

.search { flex: 1; display: flex; max-width: 560px; margin: 0 auto; background: #f4f7f5; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.search:focus-within { border-color: var(--green-2); background: #fff; }
.search input { flex: 1; min-width: 0; padding: 10px 18px; background: none; border: 0; outline: none; }
.search button { display: flex; align-items: center; padding: 0 16px; color: var(--green-2); background: none; border: 0; cursor: pointer; }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.hdr-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 56px; padding: 4px 6px; font-size: 13px; font-weight: 600; color: var(--green); border-radius: 10px; }
.hdr-btn:hover { background: var(--green-3); }
.hdr-btn span { line-height: 1.5; }

.badge { position: absolute; top: 0; right: 6px; min-width: 19px; padding: 0 5px; font-size: 11px; font-style: normal; font-weight: 700; line-height: 19px; text-align: center; color: #fff; background: var(--red); border-radius: 10px; font-family: Arial, sans-serif; }
.badge[hidden] { display: none; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; color: var(--green); background: none; border: 0; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--green-3); }
.menu-btn { display: none; }

.nav { background: var(--white); border-top: 1px solid var(--line); }
.nav .wrap { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-link { display: block; padding: 9px 14px 7px; font-size: 15.5px; font-weight: 600; color: var(--ink); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; }
.nav-link:hover, .nav-link.on { color: var(--green-2); border-bottom-color: var(--gold); }

.nav-drop { position: relative; }
.nav-drop-list { position: absolute; top: 100%; inset-inline-start: 0; z-index: 40; display: none; min-width: 240px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 77, 52, 0.16); }
.nav-drop:hover .nav-drop-list, .nav-drop:focus-within .nav-drop-list { display: block; }
.nav-drop-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border-radius: 8px; font-size: 15px; }
.nav-drop-list a:hover { color: var(--green-2); background: var(--green-3); }
.nav-drop-list .all-link { font-weight: 700; color: var(--green-2); }
.nav-sub { position: relative; }
.nav-sub-list { position: absolute; top: 0; inset-inline-start: 100%; display: none; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 77, 52, 0.16); }
.nav-sub:hover .nav-sub-list, .nav-sub:focus-within .nav-sub-list { display: block; }
.nav-sub-head span { color: var(--muted); }

/* ----- drawer (phone menu, opens from the right) ----- */

.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(310px, 86vw); padding: 10px 0 30px; overflow-y: auto; background: #fff; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 14px 12px; border-bottom: 1px solid var(--line); }
.drawer-head img { height: 40px; }
.drawer-head b { flex: 1; font-family: "Segoe UI", Arial, sans-serif; color: var(--green); }
.drawer-link, .drawer-cat summary, .drawer-cat a { display: block; padding: 10px 20px; font-weight: 600; }
.drawer-link.on { color: var(--green-2); background: var(--green-3); }
.drawer-link.all-link { color: var(--green-2); }
.drawer-title { margin: 12px 20px 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.drawer-cat summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; }
.drawer-cat summary::-webkit-details-marker { display: none; }
.drawer-cat summary::after { content: "+"; color: var(--green-2); font-size: 20px; line-height: 1; }
.drawer-cat[open] summary::after { content: "−"; }
.drawer-cat a { padding-inline-start: 34px; font-weight: 500; background: #f8faf8; }

/* ----- buttons ----- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; font-size: 15.5px; font-weight: 700; border: 2px solid transparent; border-radius: 12px; cursor: pointer; text-align: center; }
.btn-green { color: #fff; background: var(--green-2); }
.btn-green:hover { background: var(--green); }
.btn-gold { color: var(--green); background: var(--gold-2); }
.btn-gold:hover { background: #f0c453; }
.btn-white { color: var(--green); background: #fff; }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-wa { color: #fff; background: #1fa855; }
.btn-wa:hover { background: #178a45; }
.btn-outline { color: var(--green-2); background: #fff; border-color: var(--green-2); }
.btn-outline:hover { background: var(--green-3); }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link-btn { display: inline-block; padding: 6px 0; font-size: 15px; font-weight: 600; color: var(--green-2); background: none; border: 0; cursor: pointer; text-decoration: underline; }

/* ----- banner slider ----- */

.hero-wrap { padding-top: 16px; }
.hero { position: relative; overflow: hidden; background: #f3ecd8; border-radius: 18px; box-shadow: 0 8px 26px rgba(15, 77, 52, 0.12); }
.hero-track { display: flex; transition: transform 0.6s ease; }
.slide { flex: none; display: block; width: 100%; }
.slide img { width: 100%; height: auto; aspect-ratio: 1600 / 560; object-fit: cover; }
.hero-arrow { position: absolute; top: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-top: -20px; font-size: 26px; line-height: 1; color: var(--green); background: rgba(255, 255, 255, 0.92); border: 0; border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); cursor: pointer; }
.hero-next { left: 14px; }
.hero-prev { right: 14px; }
.dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 7px; }
.dots button { width: 9px; height: 9px; padding: 0; background: rgba(255, 255, 255, 0.7); border: 0; border-radius: 50%; cursor: pointer; }
.dots button.on { width: 24px; border-radius: 6px; background: var(--green-2); }

/* ----- sections ----- */

.sec { padding: 26px 0 4px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-family: var(--nastaliq); font-size: 24px; font-weight: 700; line-height: 1.9; color: var(--ink); }
.sec-head-gap { margin-top: 30px; }
.sec-more { flex: none; font-size: 15px; font-weight: 700; color: var(--green-2); }
.sec-more:hover { text-decoration: underline; }
.sec-season { margin-top: 14px; padding: 22px 0 14px; background: linear-gradient(180deg, #fbf3dc, #f7f8f6); }
.sec-offers .sec-head h2 { color: #b4400c; }

.page-head { padding: 22px 0 10px; background: #fff; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--nastaliq); font-size: 30px; font-weight: 700; line-height: 1.9; color: var(--green); }
.page-head p { margin: 0 0 6px; }

/* ----- category cards: same size, picture + Urdu name ----- */

.cat-grid { display: grid; gap: 12px; }
.cat-grid-home { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cat-grid-big { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.cc { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 100%; padding: 12px 8px 10px; text-align: center; background: var(--cc-bg, #eef5f0); border: 1px solid rgba(0, 0, 0, 0.04); border-radius: 16px; transition: transform 0.15s, box-shadow 0.15s; }
.cc:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 77, 52, 0.14); }
.cc-pic { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 0.72; }
.cc-pic img, .cc-pic svg { width: 86%; height: 100%; object-fit: contain; }
.cc-icon { display: flex; align-items: center; justify-content: center; width: 62%; aspect-ratio: 1; color: #fff; border-radius: 22%; }
.cc-icon svg { width: 54%; height: 54%; }
.cc-text { display: flex; flex-direction: column; align-items: center; min-height: 3.4em; justify-content: center; }
.cc-name { display: -webkit-box; overflow: hidden; font-family: var(--nastaliq); font-size: 16px; font-weight: 700; line-height: 1.9; color: var(--cc-ac, var(--green)); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.cc-big { align-items: stretch; padding: 14px 14px 12px; text-align: right; }
.cc-big .cc-pic { aspect-ratio: 1 / 0.7; }
.cc-big .cc-text { align-items: flex-start; min-height: 0; padding-inline-end: 40px; }
.cc-big .cc-name { font-size: 20px; color: var(--ink); }
.cc-count { font-size: 14px; color: var(--muted); }
.cc-go { position: absolute; bottom: 14px; inset-inline-end: 12px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: #fff; background: var(--cc-ac, var(--green-2)); border-radius: 50%; }

/* ----- product cards ----- */

.prod-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.prod-row .card:nth-child(n + 7) { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

.card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow 0.15s, transform 0.15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15, 77, 52, 0.14); }
.card-img { position: relative; display: block; aspect-ratio: 1 / 1.08; padding: 10px; background: #fff; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.95); border-radius: 10px; }
.ph svg { width: 36%; height: 36%; }
.ph.big svg { width: 38%; height: 38%; }

.tag { position: absolute; top: 10px; inset-inline-start: 10px; padding: 1px 9px; font-size: 12px; font-weight: 700; border-radius: 8px; }
.tag-out { color: #fff; background: rgba(60, 60, 60, 0.85); }
.tag-new { color: var(--green); background: var(--gold-2); }
.tag-offer { color: #fff; background: #c2410c; }

.heart { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: #c3cfc8; background: rgba(255, 255, 255, 0.95); border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.heart.on { color: #d6336c; }

.card-body { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 4px 12px 12px; border-top: 1px solid #f0f3f1; }
.card-name { display: -webkit-box; overflow: hidden; min-height: 3.4em; font-size: 15px; font-weight: 700; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: right; }
.card-name:hover { color: var(--green-2); }
.card-sub { margin: 0; overflow: hidden; font-size: 13px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.card-price { margin: 0; font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; font-weight: 800; color: var(--ink); direction: ltr; text-align: right; white-space: nowrap; }
.old-price { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.card-cart { display: flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px; color: #fff; background: var(--green-2); border: 0; border-radius: 10px; cursor: pointer; }
.card-cart:hover { background: var(--green); }
.card-cart svg { width: 20px; height: 20px; }

/* ----- WhatsApp band ----- */

.band { margin-top: 34px; color: #fff; background: linear-gradient(115deg, #0b3d29, #176b45); }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 26px; padding-bottom: 26px; }
.band h2 { font-family: var(--nastaliq); font-size: 24px; line-height: 2; }
.band p { margin: 0; color: #d6e8dd; }
.band-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ----- shop page (filters) ----- */

.filters { display: flex; gap: 10px; margin-bottom: 12px; }
.filters input, .filters select { padding: 9px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.filters input { flex: 1; min-width: 0; }
.filters input:focus, .filters select:focus { border-color: var(--green-2); }
.filters.filters-2 select { flex: 1; min-width: 0; }
.filters select[hidden], .filters[hidden] { display: none; }

.chips { display: flex; gap: 8px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip { flex: none; padding: 5px 16px; font-size: 14.5px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--green-2); }
.chip.on { color: #fff; background: var(--green-2); border-color: var(--green-2); }
.chips-cat .chip .cat-ur { font-size: 15px; line-height: 1.8; }
.chips-subcat .chip { background: #fbf6e7; border-color: #ecdcae; }
.chips-subcat .chip.on { color: var(--green); background: var(--gold-2); border-color: var(--gold-2); }

.more-wrap { display: flex; justify-content: center; padding: 22px 0 10px; }
.more-wrap [hidden] { display: none; }

/* ----- product page ----- */

.crumbs { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--green-2); text-decoration: underline; }

.detail { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 34px; align-items: start; }
.detail-img { overflow: hidden; aspect-ratio: 1 / 1; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-info h1 { margin: 6px 0; font-size: 27px; line-height: 1.6; }
.detail-price { margin: 0 0 4px; font-family: "Segoe UI", Arial, sans-serif; font-size: 28px; font-weight: 800; color: var(--green-2); direction: ltr; text-align: right; }
.detail-price .old-price { display: inline; margin-inline-end: 8px; font-size: 17px; }
.offer-note { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: #c2410c; }
.pill { display: inline-block; padding: 2px 12px; font-size: 13px; font-weight: 700; color: var(--green); background: #f6e9c4; border-radius: 999px; }
.status { display: inline-block; margin: 0 0 14px; padding: 2px 12px; font-size: 14px; font-weight: 700; border-radius: 999px; }
.status.ok { color: #0d6b3a; background: #dff3e7; }
.status.out { color: #8a1f2d; background: #fbe3e6; }
.notice { width: 100%; padding: 12px 14px; font-size: 15px; color: #7a4b08; background: #fff4de; border: 1px solid #f1d9a2; border-radius: 12px; }
.detail-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.detail-actions { display: flex; gap: 20px; margin-bottom: 18px; }

.specs { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.specs th, .specs td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--line); font-size: 15px; }
.specs th { width: 34%; color: var(--muted); font-weight: 600; background: #f8faf8; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

.qty-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 2px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; direction: ltr; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; font-size: 20px; line-height: 1; color: var(--green-2); background: #f3f8f5; border: 0; cursor: pointer; }
.stepper button:hover { background: #e3efe8; }
.stepper b { min-width: 38px; text-align: center; font-family: Arial, sans-serif; }

/* ----- forms, account, about, policy ----- */

.form { display: grid; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.form label { display: grid; gap: 4px; font-size: 15px; font-weight: 600; }
.form input, .form textarea { padding: 10px 14px; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.form input:focus, .form textarea:focus { border-color: var(--green-2); }
.form h3, .summary h3 { font-size: 19px; color: var(--green); }
.acc-form { display: grid; gap: 14px; }
.acc-msg { margin: 0; min-height: 1em; font-size: 15px; color: #b3261e; }
.acc-msg.good { color: var(--green-2); }
.google-btn { width: 100%; direction: ltr; }
.offer { display: grid; gap: 2px; margin-bottom: 16px; padding: 14px 18px; color: var(--green); background: #fff7dc; border: 1px solid var(--gold-2); border-radius: 14px; }
.offer b { font-size: 18px; }
.offer span { font-size: 15px; color: #5b5320; }
.offer.used { background: var(--green-3); border-color: #cfe3d6; font-weight: 700; }
.acc-link { display: flex; justify-content: space-between; margin-bottom: 14px; padding: 12px 18px; font-weight: 700; color: var(--green); background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.acc-link:hover { background: var(--green-3); }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.about-text h2 { margin-bottom: 8px; color: var(--green); }
.about-text p { color: #3d4f45; }
.contact-card { display: grid; gap: 8px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.contact-card h3 { margin-top: 4px; color: var(--green); }
.contact-card p { margin: 0 0 4px; }

.policy h2 { margin: 24px 0 6px; font-size: 20px; color: var(--green); }
.policy p, .policy li { line-height: 1.9; color: #33433a; }
.policy ul { padding-inline-start: 22px; }

/* ----- "Added to your cart" sheet ----- */

.sheet { position: fixed; inset: 0; z-index: 95; display: none; }
.sheet.show { display: block; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); background: #fff; border-radius: 22px 22px 0 0; animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; font-weight: 800; color: var(--green); }
.sheet-tick { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; font-size: 15px; color: #fff; background: var(--green-2); border-radius: 50%; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: #f3f8f5; border-radius: 14px; }
.sheet-img { flex: none; width: 52px; height: 52px; overflow: hidden; background: #fff; border-radius: 10px; }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; }
.sheet-img .ph svg { width: 50%; height: 50%; }
.sheet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-info b { overflow: hidden; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.sheet-info small { color: var(--muted); }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* ----- cart, checkout, orders ----- */

.cart-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.cart-list { display: grid; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.cart-img { width: 84px; height: 84px; overflow: hidden; background: #f1f5f2; border-radius: 12px; }
.cart-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cart-img .ph svg { width: 44%; height: 44%; }
.cart-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-info .small { margin: 0; }
.cart-info .stepper { align-self: flex-start; }
.cart-name { display: -webkit-box; overflow: hidden; font-weight: 700; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart-price { margin: 0; font-weight: 700; color: var(--green-2); }
.cart-out { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: #b3261e; }
.cart-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-del { display: flex; padding: 6px; color: #b3261e; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.cart-del:hover { background: #fdecea; }

.summary { display: grid; gap: 10px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.summary.plain { margin: 14px 0; border-color: #dfe9e3; background: #f8fbf9; }
.sum-row, .sum-item { display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; }
.sum-item { font-size: 15px; color: #33433a; }
.sum-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sum-row.good { color: #1a7a45; font-weight: 600; }
.sum-total { padding-top: 10px; font-size: 18px; border-top: 1px dashed var(--line); }
.sum-total b { color: var(--green-2); }
.sum-note { margin: 0; font-size: 14px; color: var(--muted); }

.empty-box { display: grid; justify-items: center; gap: 12px; padding: 34px 20px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.empty-box h2 { font-size: 22px; color: var(--green); }
.empty-box p { margin: 0; }
.empty-ic { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; color: var(--green-2); background: var(--green-3); border-radius: 50%; }

.pay-box { display: grid; gap: 2px; padding: 12px 14px; background: var(--green-3); border: 1px solid #cfe3d6; border-radius: 12px; }
.pay-box span { font-size: 14px; color: var(--muted); }

.done-box { display: grid; gap: 10px; padding: 26px 20px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.done-tick { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto; font-size: 34px; color: #fff; background: var(--green-2); border-radius: 50%; }
.done-box h2 { font-size: 23px; color: var(--green); }
.done-no { margin: 0; font-size: 17px; }
.done-box .summary { text-align: right; }

.order-card { display: grid; gap: 8px; margin-bottom: 14px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.order-card p { margin: 0; }
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order-top div { display: grid; }
.order-top b { font-size: 17px; color: var(--green); direction: ltr; text-align: right; }
.ost { padding: 2px 12px; font-size: 13px; font-weight: 800; border-radius: 999px; }
.ost-new { color: #7a5a00; background: #fff1c2; }
.ost-confirmed { color: #0b4f8a; background: #dcecfa; }
.ost-shipped { color: #5b2c91; background: #ece0f8; }
.ost-delivered { color: #17663f; background: #d9f1e3; }
.ost-cancelled { color: #8a1f1f; background: #fbe0e0; }

/* ----- footer ----- */

.footer { margin-top: 0; color: #d6e8dd; background: var(--green); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 28px; padding-top: 32px; padding-bottom: 22px; }
.footer-logo { width: 160px; border-radius: 16px; }
.footer-about { margin: 12px 0 0; }
.footer h4 { margin-bottom: 8px; font-size: 18px; color: var(--gold-2); }
.footer p { margin: 0 0 8px; }
.footer a { display: block; padding: 2px 0; }
.footer a:hover { color: #fff; text-decoration: underline; }
.socials { display: flex; flex-wrap: wrap; gap: 14px; }
.social { display: inline-flex !important; align-items: center; gap: 6px; direction: ltr; }
.copy { padding: 12px 16px; text-align: center; font-size: 14px; color: #a8c7b5; border-top: 1px solid rgba(255, 255, 255, 0.12); }

/* ----- floating buttons, toast ----- */

.wa-float { position: fixed; left: 16px; bottom: 18px; z-index: 50; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; color: #fff; background: #1fa855; border-radius: 50%; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }
.wa-float:hover { background: #178a45; }

.to-top { position: fixed; left: 22px; bottom: 86px; z-index: 49; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #fff; background: var(--green); border: 0; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.to-top.show { opacity: 1; pointer-events: auto; }

#toast { position: fixed; top: 14px; left: 50%; z-index: 99; max-width: 90vw; padding: 9px 20px; font-size: 15px; font-weight: 600; color: #fff; background: #1f7a4d; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transform: translate(-50%, -20px); transition: opacity 0.25s, transform 0.25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* bottom navigation + buy bar: phones only */
.bottom-nav, .buy-bar { display: none; }

/* ===== tablet ===== */

@media (max-width: 1100px) {
    .prod-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .prod-row .card:nth-child(n + 6) { display: none; }
    .cat-grid-big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hdr-wish { display: none; }
}

/* ===== phone ===== */

@media (max-width: 860px) {
    body { font-size: 15px; }
    .topbar-links, .tb-item:first-child { display: none; }
    .topbar .wrap { justify-content: center; min-height: 30px; }

    .menu-btn { display: inline-flex; }
    .nav { display: none; }
    .header { background: var(--white); }
    .header-row { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 10px; }
    .brand { flex: 1; justify-content: center; }
    .brand img { height: 42px; }
    .brand-text b { font-size: 16px; }
    .search { order: 5; flex: 1 1 100%; max-width: none; }
    .hdr-btn span, .hdr-account { display: none; }
    .hdr-btn { min-width: 0; padding: 6px; }
    .badge { right: 0; }

    .hero-wrap { padding-top: 10px; }
    .hero { border-radius: 14px; }
    .slide img { aspect-ratio: 1000 / 560; }
    .hero-arrow { width: 30px; height: 30px; margin-top: -15px; font-size: 20px; }
    .hero-next { left: 8px; }
    .hero-prev { right: 8px; }
    .dots { bottom: 8px; }

    .sec { padding-top: 20px; }
    .sec-head h2 { font-size: 20px; }
    .sec-more { font-size: 14px; }

    /* 3 small category cards per row, up to 9 */
    .cat-grid-home { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .cc { padding: 8px 6px 6px; border-radius: 14px; }
    .cc-name { font-size: 14px; }
    .cc-text { min-height: 3.2em; }

    /* All Categories page: 2 big cards per row */
    .cat-grid-big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .cc-big { padding: 10px 10px 8px; }
    .cc-big .cc-name { font-size: 17px; }
    .cc-big .cc-text { padding-inline-end: 34px; }
    .cc-count { font-size: 12.5px; }
    .cc-go { width: 28px; height: 28px; bottom: 10px; inset-inline-end: 8px; }

    /* products: 3 per row, swipe for more */
    .prod-row { display: flex; gap: 10px; margin: 0 -16px; padding: 2px 16px 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
    .prod-row::-webkit-scrollbar { display: none; }
    .prod-row .card, .prod-row .card:nth-child(n + 6) { display: flex; flex: none; width: calc((100% - 20px) / 3.1); scroll-snap-align: start; }
    .prod-row .card-name { font-size: 13px; min-height: 3.3em; }
    .prod-row .card-sub { display: none; }
    .prod-row .card-price { font-size: 12.5px; }
    .prod-row .card-foot { gap: 4px; }
    .prod-row .card-cart { width: 30px; height: 30px; border-radius: 8px; }
    .prod-row .card-cart svg { width: 16px; height: 16px; }
    .prod-row .card-body { padding: 2px 8px 8px; }
    .prod-row .card-img { padding: 6px; }
    .prod-row .heart { width: 26px; height: 26px; top: 5px; inset-inline-end: 5px; }
    .prod-row .heart svg { width: 14px; height: 14px; }
    .prod-row .tag { top: 6px; inset-inline-start: 6px; font-size: 10.5px; padding: 0 6px; }

    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .filters { flex-direction: column; }
    .filters.filters-2 { flex-direction: row; }

    .band-in { flex-direction: column; align-items: flex-start; }
    .band h2 { font-size: 20px; }

    .page-head h1 { font-size: 24px; }
    .detail { grid-template-columns: 1fr; gap: 18px; }
    .detail-buttons .btn { flex: 1 1 calc(50% - 10px); }
    .about, .footer-grid { grid-template-columns: 1fr; }

    .cart-wrap { grid-template-columns: 1fr; }
    .cart-line { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; }
    .cart-img { width: 70px; height: 70px; }

    body.has-bn { padding-bottom: 74px; }

    .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: 1fr 1fr 74px 1fr 1fr; align-items: end; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 77, 52, 0.08); }
    .bn-item { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 0 0; font-size: 12px; font-weight: 600; color: #7d8f85; }
    .bn-item.on { color: var(--green-2); }
    .bn-cart { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; margin: -26px auto 4px; color: #fff; background: var(--green-2); border: 4px solid #fff; border-radius: 50%; box-shadow: 0 8px 18px rgba(15, 77, 52, 0.35); }
    .bn-cart.on { background: var(--green); }
    .bn-cart .badge { top: -4px; right: -4px; color: var(--green); background: var(--gold-2); }

    .wa-float { left: 14px; bottom: 92px; width: 48px; height: 48px; }
    .wa-float svg { width: 26px; height: 26px; }
    .to-top { left: 18px; bottom: 150px; }

    /* product page: the buy bar replaces the bottom menu */
    body.has-buybar { padding-bottom: 84px; }
    body.has-buybar .bottom-nav, body.has-buybar .wa-float { display: none; }
    body.has-buybar .to-top { bottom: 96px; }
    .buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 77, 52, 0.1); }
    .bar-wa { display: flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; color: #1fa855; background: #eaf7ef; border-radius: 12px; }
    .bar-price { display: grid; flex: none; line-height: 1.3; }
    .bar-price small { font-size: 12px; color: var(--muted); }
    .bar-price b { font-family: Arial, sans-serif; font-size: 17px; color: var(--green-2); direction: ltr; }
    .buy-bar .btn { flex: 1; padding: 11px 10px; }
}

@media (max-width: 380px) {
    .cc-name { font-size: 13px; }
    .cc-big .cc-name { font-size: 15px; }
}

.page-cart .wa-float { display: none; }
.block { padding: 22px 0 6px; }

/* ===== Layout is left-to-right (logo left, cart right, cards start from the left).
   Urdu text blocks read right-to-left. ===== */
.topbar .wrap, .nav .wrap, .sec-head, .page-head .wrap, .card-body, .chips, .filters,
.form, .summary, .cart-info, .sheet-panel, .drawer-panel, .footer-grid > div, .copy,
.policy, .about-text, .contact-card, .empty-box, .done-box, .order-card, .crumbs,
.detail-info, .specs, .band-in > div, .acc-link, .offer, .notice, .loading, .empty { direction: rtl; }
.nav .wrap { justify-content: center; }
.footer-grid > div, .about-text, .contact-card, .detail-info, .page-head .wrap { text-align: right; }
.cc-big .cc-text { align-items: flex-start; }
.sheet-item { direction: rtl; }

/* brand: MAKTABA / NOMANIA / UMARZAI */
.brand-text .bt-top { font-size: 12px; letter-spacing: 0.14em; color: var(--green); }
.brand-text b { font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; font-family: Georgia, "Times New Roman", serif; }
.brand-text small { line-height: 1.2; }
.back-btn, .hdr-title, .search-toggle { display: none; }

/* ===== Phone design (same as the mockup) ===== */
@media (max-width: 860px) {
    .topbar { display: none; }

    /* dark green header: menu, logo, account, cart; search inside it */
    .header { background: var(--green); border-bottom: 0; box-shadow: none; }
    .header .icon-btn, .header .hdr-btn { color: #fff; background: none; }
    .header-row { padding-top: 10px; padding-bottom: 14px; }
    .brand { flex: 1; justify-content: center; gap: 8px; }
    .brand img { height: 46px; }
    .brand-text .bt-top { font-size: 11px; color: #fff; }
    .brand-text b { font-size: 21px; color: #fff; }
    .brand-text small { color: #f3dc9a; font-size: 10px; letter-spacing: 0.3em; }
    .header-actions { gap: 2px; }
    .hdr-account { display: flex; }
    .hdr-wish { display: none; }
    .hdr-btn span { display: none; }
    .hdr-btn .badge { top: 0; right: 0; background: #e53935; }
    .search { background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
    .search input { padding: 11px 16px; }
    .search button { color: var(--ink); }

    /* inner page header (All Categories): white, back arrow, title, search, cart */
    .header-sub { background: #fff; border-bottom: 1px solid var(--line); }
    .header-sub .icon-btn, .header-sub .hdr-btn { color: var(--ink); }
    .header-sub .menu-btn, .header-sub .brand, .header-sub .hdr-account { display: none; }
    .header-sub .back-btn, .header-sub .search-toggle { display: inline-flex; }
    .header-sub .hdr-title { display: block; flex: 1; text-align: center; font-family: var(--nastaliq); font-size: 21px; line-height: 1.8; color: var(--ink); }
    .header-sub .header-row { flex-wrap: wrap; padding-bottom: 8px; }
    .header-sub .search { display: none; background: #f4f7f5; border: 1px solid var(--line); box-shadow: none; }
    .header-sub.show-search .search { display: flex; }
    .cats-head, .cats-chips { display: none; }

    /* no floating WhatsApp button on phones (WhatsApp is in the menu and at the bottom of the page) */
    .wa-float { display: none; }

    /* banner */
    .hero-wrap { padding-top: 12px; }
    .hero { border-radius: 14px; }

    /* home: 3 category cards per row, picture large, card wider than tall */
    .cat-grid-home { gap: 8px; }
    .cat-grid-home .cc { justify-content: flex-start; gap: 0; padding: 6px 6px 4px; border-radius: 12px; }
    .cat-grid-home .cc-pic { aspect-ratio: 1 / 0.62; }
    .cat-grid-home .cc-pic svg, .cat-grid-home .cc-pic img { width: 92%; }
    .cat-grid-home .cc-text { min-height: 0; flex: 1; }
    .cat-grid-home .cc-name { font-size: 14px; line-height: 1.75; color: var(--ink); }

    /* All Categories: 2 big cards per row, name + count on the right, round arrow on the left */
    .cat-grid-big { gap: 10px; }
    .cc-big { padding: 8px 10px 10px; text-align: right; }
    .cc-big .cc-pic { aspect-ratio: 1 / 0.64; }
    .cc-big .cc-pic svg, .cc-big .cc-pic img { width: 88%; }
    .cc-big { justify-content: flex-start; }
    .cc-big .cc-text { flex: 1; justify-content: flex-start; align-items: flex-start; padding: 0 0 0 38px; direction: rtl; text-align: right; }
    .cc-big .cc-name { font-size: 17px; line-height: 1.75; color: var(--ink); }
    .cc-big .cc-count { font-size: 13px; }
    .cc-go { inset-inline-end: auto; left: 10px; bottom: 12px; width: 30px; height: 30px; }

    /* product cards: 3 per row, whole cards visible, name in the middle, price left, cart right */
    .prod-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; overflow: visible; }
    .prod-row .card, .prod-row .card:nth-child(n + 6) { display: flex; width: auto; }
    .prod-row .card:nth-child(n + 7) { display: none; }
    .prod-row .heart { display: none; }
    .prod-row .card-img { aspect-ratio: 1 / 1.05; padding: 8px 8px 4px; }
    .prod-row .card-body { padding: 0 6px 6px; border-top: 0; }
    .prod-row .card-name { min-height: 0; font-size: 13px; text-align: center; -webkit-line-clamp: 1; }
    .prod-row .card-foot { padding-top: 2px; }
    .prod-row .card-price { font-size: 13px; text-align: right; }
    .prod-row .old-price { font-size: 10.5px; }
    .prod-row .card-cart { width: 30px; height: 30px; border-radius: 7px; }
}
@media (max-width: 860px) {
    .cc-big .cc-text { justify-content: flex-end; min-height: 4.6em; }
    .cat-grid-home .cc-text { justify-content: center; min-height: 3.5em; }
}

/* Nastaliq letters are tall: give them room so the top and bottom are not cut off */
.cc-name { line-height: 2.3; padding: 0.15em 0.1em; }
.cat-grid-home .cc-name { line-height: 2.3 !important; }
.cc-big .cc-name { line-height: 2.2 !important; }
.cc-text { min-height: 0 !important; overflow: visible; }
.chip .cat-ur, .chips-cat .chip .cat-ur { line-height: 2.2; }
.sec-head h2, .page-head h1, .hdr-title, .band h2 { line-height: 2.2; padding-top: 0.1em; }
.name-en { margin: -4px 0 6px; text-align: right; font-family: "Segoe UI", Arial, sans-serif; }
.detail-desc { margin: 0 0 14px; line-height: 1.9; color: #33433a; }
.cat-intro { max-width: 820px; margin: 0 0 6px; line-height: 2; color: #33433a; }
.trust-note { margin: 0 0 14px; font-size: 14px; }
.trust-note a { color: var(--green-2); text-decoration: underline; }
.seo-list { margin: 0; padding-inline-start: 20px; line-height: 2.1; }

/* ===================== Home page redesign (reference 01-home) ===================== */

/* green category bar under the header */
.nav { background: var(--green); border-top: 0; }
.nav .wrap { justify-content: center; gap: 0; }
.nav .nav-link { padding: 9px 15px 8px; color: #fff; font-size: 15px; border-bottom: 3px solid transparent; }
.nav .nav-link:hover, .nav .nav-link.on { color: var(--gold-2); border-bottom-color: var(--gold-2); background: rgba(255, 255, 255, 0.06); }
.nav-drop-list a { color: var(--ink); }

/* banner: rounded, full width of the page, dots below (not on top of the picture) */
.hero-wrap { padding-top: 18px; }
.hero { border-radius: 16px; background: #f3ecd8; }
.slide img { width: 100%; height: auto; aspect-ratio: 1600 / 560; object-fit: cover; }
.hero-wrap .dots { position: static; display: flex; justify-content: center; gap: 7px; padding: 12px 0 0; }
.hero-wrap .dots button { width: 9px; height: 9px; background: #cfd8d2; }
.hero-wrap .dots button.on { width: 24px; background: var(--green-2); }

/* books: 5 in a row on laptops */
.prod-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.prod-row .card:nth-child(n + 6) { display: none; }
.prod-row .card-img { background: #f6f7f5; }
.prod-row .card-name { text-align: center; }
.prod-row .heart { display: none; }

/* services */
.services { padding-top: 34px; }
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.svc { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.svc:hover { border-color: var(--green-2); }
.svc-ic { display: flex; flex: none; align-items: center; justify-content: center; width: 52px; height: 52px; color: var(--green-2); background: var(--green-3); border-radius: 50%; }
.svc b { display: block; font-size: 15.5px; color: var(--ink); }
.svc small { display: block; font-size: 13.5px; color: var(--muted); }

/* useful links */
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.info { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 16px 44px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--gold); border-radius: 12px; }
.info:hover { border-color: var(--green-2); }
.info b { font-size: 16px; color: var(--green); }
.info small { font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.info-go { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--green-2); font-weight: 700; }

/* footer: four columns */
.footer { margin-top: 36px; }
.footer-grid { grid-template-columns: 1.1fr 1.4fr 1fr 1fr; }

/* the static links in index.html are replaced when the page loads */
.seo-fallback { padding: 30px 0; }
.seo-fallback a { margin-inline-end: 14px; color: var(--green-2); text-decoration: underline; }

@media (max-width: 1100px) {
    .prod-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .prod-row .card:nth-child(n + 5) { display: none; }
    .svc-grid, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav .nav-link { padding: 9px 10px 8px; font-size: 14px; }
}

@media (max-width: 860px) {
    .prod-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .prod-row .card:nth-child(n + 4) { display: flex; }
    .prod-row .card:nth-child(n + 7) { display: none; }
    .hero-wrap .dots { padding-top: 8px; }
    .services { padding-top: 24px; }
    .svc-grid { gap: 8px; }
    .svc { flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; text-align: center; }
    .svc-ic { width: 44px; height: 44px; }
    .svc b { font-size: 14px; }
    .svc small { font-size: 12px; }
    .info-grid { grid-template-columns: 1fr; gap: 8px; }
    .footer-grid { grid-template-columns: 1fr; }
}
/* laptop: one full row of categories (6); phone shows up to 12, see below */
.cat-grid-home .cc:nth-child(n + 7) { display: none; }
@media (max-width: 860px) {
    .cat-grid-home .cc:nth-child(n + 7) { display: flex; }
    .cat-grid-home .cc:nth-child(n + 13) { display: none; }
}
.nav .wrap { flex-wrap: nowrap; }
.nav .nav-link { white-space: nowrap; }
@media (max-width: 1250px) { .nav .nav-cat-more { display: none; } }

/* ===== Laptop header like the reference: logo left, search in the middle, icons + green login button right ===== */
@media (min-width: 861px) {
    .topbar { display: none; }
    .header-row { direction: ltr; gap: 24px; padding-top: 12px; padding-bottom: 12px; }
    .brand { order: 1; }
    .search { order: 2; direction: rtl; }
    .header-actions { order: 3; direction: ltr; gap: 4px; margin-inline-start: auto; }
    .hdr-btn { flex-direction: row; min-width: 0; padding: 8px; border-radius: 50%; }
    .hdr-btn span { display: none; }
    .hdr-btn .badge { top: 0; right: 0; left: auto; }
    .hdr-wish { display: flex; }
    .hdr-account { gap: 6px; margin-left: 6px; padding: 8px 18px; color: #fff; background: var(--green-2); border-radius: 999px; direction: rtl; }
    .hdr-account:hover { background: var(--green); }
    .hdr-account span { display: inline; font-size: 15px; font-weight: 700; }
    .brand img { height: 54px; }
}

/* phones: keep account icon before the cart, as before */
@media (max-width: 860px) {
    .hdr-account { order: 0; }
    .hdr-cart { order: 1; }
}

/* ===== Home: categories in one line, swipe, slow automatic movement ===== */
.cat-strip { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-row { display: flex; gap: 12px; }
/* same card size as before: 6 per screen width on laptops */
.cat-row .cc { flex: none; width: calc((100% - 60px) / 6); }
@media (max-width: 1100px) { .cat-row .cc { width: calc((100% - 48px) / 5); } }
/* phones: 3 per screen width, same as before */
@media (max-width: 860px) {
    .cat-row { gap: 8px; }
    .cat-row .cc { width: calc((100% - 16px) / 3); justify-content: flex-start; gap: 0; padding: 6px 6px 4px; border-radius: 12px; }
    .cat-row .cc-pic { aspect-ratio: 1 / 0.62; }
    .cat-row .cc-pic svg, .cat-row .cc-pic img { width: 92%; }
    .cat-row .cc-text { flex: 1; justify-content: center; min-height: 3.5em; }
    .cat-row .cc-name { font-size: 14px; color: var(--ink); }
}

/* phones: WhatsApp button back on the left, above the bottom menu */
@media (max-width: 860px) {
    .wa-float { display: flex; left: 14px; right: auto; bottom: 92px; width: 50px; height: 50px; }
    body.has-buybar .wa-float, .page-cart .wa-float { display: none; }
}

/* ===================== Category page (reference 02-category) ===================== */
.cat-hero { padding-top: 18px; }
.cat-hero[hidden] { display: none; }
.cat-hero-in { position: relative; display: flex; align-items: center; gap: 24px; min-height: 170px; padding: 22px 28px; overflow: hidden; color: #fff;
    background: linear-gradient(110deg, #0b3d29 0%, #14613f 55%, #1d7a50 100%); border-radius: 16px; }
.cat-hero-in::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 12% 50%, rgba(227, 181, 61, 0.18), transparent 55%); pointer-events: none; }
.cat-hero-img { position: relative; z-index: 1; flex: none; width: 150px; height: 150px; object-fit: cover; border-radius: 14px; border: 3px solid rgba(255, 255, 255, 0.85); order: 2; margin-inline-start: auto; }
.cat-hero-text { position: relative; z-index: 1; }
.cat-hero-text h2 { font-family: var(--nastaliq); font-size: 38px; line-height: 2; color: #f3d77e; }
.cat-hero-text p { margin: 0; max-width: 640px; color: #e6f1ea; line-height: 2; }
.cat-hero-crumbs { font-size: 13.5px; }
.cat-hero-crumbs a { color: #cfe6d8; }
.cat-hero-crumbs a:hover { color: #fff; text-decoration: underline; }

.cat-page { padding-top: 20px; }
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "main side"; gap: 22px; align-items: start; }
.cat-side { grid-area: side; position: sticky; top: 140px; display: grid; gap: 14px; }
.cat-main { grid-area: main; min-width: 0; }

.side-box { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.side-box[hidden] { display: none; }
.side-box h3, .side-more summary { margin: 0 0 6px; padding: 0 6px 6px; font-size: 15px; font-weight: 700; color: var(--green); border-bottom: 1px solid var(--line); }
.side-more summary { cursor: pointer; list-style: none; }
.side-more summary::-webkit-details-marker { display: none; }
.side-more summary::after { content: " ▾"; color: var(--muted); }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 15px; border-radius: 8px; border-inline-start: 3px solid transparent; }
.side-link:hover { background: var(--green-3); color: var(--green-2); }
.side-link.on { font-weight: 700; color: var(--green); background: var(--green-3); border-inline-start-color: var(--green-2); }
.side-link small { min-width: 22px; padding: 0 6px; font-size: 12px; text-align: center; color: var(--muted); background: #f1f4f2; border-radius: 999px; }
.side-cats .side-link span { font-family: var(--nastaliq); font-size: 15.5px; line-height: 2.1; }
.side-subs { margin: 2px 14px 6px 0; padding-inline-start: 8px; border-inline-start: 2px solid var(--line); }
.side-subs .side-link { font-size: 14px; padding: 4px 10px; }
.side-filters { display: grid; gap: 8px; margin-top: 8px; }
.side-filters select { width: 100%; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.side-filters[hidden], .side-filters select[hidden] { display: none; }

.cat-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.cat-bar h1 { font-family: var(--nastaliq); font-size: 26px; line-height: 2.1; color: var(--ink); }
.cat-bar h1 .cat-count { font-family: var(--naskh); font-size: 14px; font-weight: 500; color: var(--muted); }
.cat-bar select { padding: 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.cat-main .filters { margin-bottom: 10px; }
.cat-main .chips-subcat { margin-top: 0; }

.cat-grid-books { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.cat-grid-books .heart { display: none; }
.cat-grid-books .card-img { background: #f6f7f5; }
.cat-grid-books .card-name { text-align: center; }

@media (max-width: 1100px) {
    .cat-layout { grid-template-columns: minmax(0, 1fr) 210px; }
    .cat-hero-text h2 { font-size: 32px; }
}

/* phones: category list becomes a sliding line on top; collections and filters fold away */
@media (max-width: 860px) {
    .cat-hero { padding-top: 10px; }
    .cat-hero-in { min-height: 120px; padding: 14px 16px; gap: 12px; }
    .cat-hero-img { width: 84px; height: 84px; }
    .cat-hero-text h2 { font-size: 27px; }
    .cat-hero-text p { font-size: 13.5px; line-height: 1.9; }
    .cat-page { padding-top: 12px; }
    .cat-layout { display: block; }
    .cat-side { position: static; gap: 8px; margin-bottom: 12px; }
    .side-cats, #side-acc-box { padding: 0; background: none; border: 0; }
    .side-cats h3, #side-acc-box h3 { display: none; }
    #side-cats, #side-acc { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    #side-cats::-webkit-scrollbar, #side-acc::-webkit-scrollbar { display: none; }
    #side-cats .side-link, #side-acc .side-link { flex: none; padding: 4px 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
    #side-cats .side-link.on, #side-acc .side-link.on { color: #fff; background: var(--green-2); border-color: var(--green-2); }
    #side-cats .side-link.on small { color: var(--green); }
    .side-subs { display: none; }
    .side-more { padding: 8px 12px; }
    .side-more summary { margin: 0; padding: 0; border: 0; }
    #side-views { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    #side-views .side-link { padding: 3px 12px; font-size: 13.5px; border: 1px solid var(--line); border-radius: 999px; }
    .cat-bar h1 { font-size: 21px; }
    .cat-bar select { padding: 6px 10px; font-size: 14px; }
    .cat-grid-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.cat-side > * { min-width: 0; }
@media (max-width: 860px) { .cat-side { display: block; } .cat-side > * + * { margin-top: 8px; } }

/* ===== Author pages (author/<name>, authors) ===== */
.cat-hero-text h1 { font-family: var(--nastaliq); font-size: 38px; line-height: 2.2; color: #f3d77e; }
.author-hero { align-items: center; }
.author-avatar { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12); border: 3px solid rgba(243, 215, 126, 0.85); color: #f3d77e;
    font-family: var(--nastaliq); font-size: 44px; line-height: 1; padding-bottom: 0.25em; }
.author-avatar.small { width: 54px; height: 54px; font-size: 24px; border-width: 2px; background: var(--green); }
.author-en { margin: 0 0 4px !important; color: #cfe6d8 !important; font-size: 15px; text-align: right; }
.author-bio { margin-top: 6px !important; }
.author-count { margin-top: 8px !important; color: #f3d77e !important; font-weight: 700; }
.author-sec-head { margin-top: 6px; }
.author-sec-head + .grid { margin-bottom: 26px; }
.author-chips { flex-wrap: wrap; overflow: visible; }
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.author-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.author-card[hidden] { display: none; }
.author-card:hover { border-color: var(--green-2); box-shadow: 0 6px 18px rgba(15, 77, 52, 0.08); }
.author-card-text { display: flex; flex-direction: column; min-width: 0; text-align: right; }
.author-card-text b { font-family: var(--nastaliq); font-size: 18px; font-weight: 700; line-height: 2.1; color: var(--ink); }
.author-card-text small { color: var(--muted); font-size: 13px; text-align: right; }
.author-card-text small[dir="ltr"] { text-align: right; }
.author-more .prod-row { margin-top: 4px; }
.specs td a { color: var(--green-2); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) {
    .author-avatar { width: 70px; height: 70px; font-size: 30px; }
    .cat-hero-text h1 { font-size: 27px; }
    .author-grid { grid-template-columns: 1fr; gap: 10px; }
}
