/* ===== Maktaba-e-Nomania online shop ===== */

:root {
    --green: #0f4d34;
    --green-2: #176b45;
    --gold: #c9971c;
    --gold-2: #e3b53d;
    --ink: #1b2a22;
    --muted: #66786e;
    --line: #e4ece7;
    --bg: #f6f8f6;
    --white: #ffffff;
    --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, "Noto Naskh Arabic", "Noto Nastaliq Urdu", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

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.25; }
button, input, select, textarea { font: inherit; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading, .empty { padding: 40px 0; text-align: center; color: var(--muted); }
.empty a { color: var(--green-2); font-weight: 600; text-decoration: underline; }
.urdu { font-size: 17px; line-height: 2; }

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

.topbar { background: var(--green); color: #e8f3ec; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; }
.topbar a { font-weight: 600; color: var(--gold-2); }

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

.header { position: sticky; top: 0; z-index: 30; background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 18px; color: var(--green); letter-spacing: 0.01em; }
.brand-text small { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

.search { flex: 1; display: flex; max-width: 560px; margin-left: auto; margin-right: auto; }
.search input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: #fbfcfb; outline: none; }
.search input:focus { border-color: var(--green-2); background: #fff; }
.search button { padding: 0 16px; color: #fff; background: var(--green-2); border: 0; border-radius: 0 10px 10px 0; cursor: pointer; }

.icon-btn { position: relative; 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: #eef5f0; }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: #c0392b; border-radius: 9px; }
.badge[hidden] { display: none; }
.menu-btn { display: none; }

.nav { background: var(--white); border-top: 1px solid var(--line); }
.nav .wrap { display: flex; gap: 4px; }
.nav-link { padding: 11px 14px; font-size: 15px; font-weight: 600; color: var(--ink); background: none; border: 0; cursor: pointer; border-bottom: 3px solid transparent; }
.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%; left: 0; z-index: 40; display: none; min-width: 190px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 77, 52, 0.15); }
.nav-drop:hover .nav-drop-list, .nav-drop:focus-within .nav-drop-list { display: block; }
.nav-drop-list a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav-drop-list a:hover { background: #eef5f0; color: var(--green-2); }

/* ----- drawer (phone menu) ----- */

.drawer[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 85vw); padding: 12px 0 24px; overflow-y: auto; background: #fff; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 4px 12px 14px; border-bottom: 1px solid var(--line); }
.drawer-head img { height: 40px; }
.drawer-head b { flex: 1; color: var(--green); }
.drawer-panel a { display: block; padding: 13px 20px; font-weight: 600; }
.drawer-panel a.on { color: var(--green-2); background: #eef5f0; }
.drawer-title { margin: 10px 20px 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

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

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; font-weight: 700; font-size: 15px; border: 2px solid transparent; border-radius: 12px; cursor: pointer; text-align: center; }
.btn-gold { color: var(--green); background: var(--gold-2); }
.btn-gold:hover { background: #f0c453; }
.btn-green { color: #fff; background: var(--green-2); }
.btn-green:hover { background: var(--green); }
.btn-white { color: var(--green); background: #fff; }
.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: #eef5f0; }

/* ----- hero ----- */

.hero { position: relative; overflow: hidden; background: var(--green); }
.hero-track { display: flex; transition: transform 0.6s ease; }
.slide { flex: none; width: 100%; min-height: 330px; display: flex; align-items: center; color: #fff; }
.slide.s1 { background: linear-gradient(110deg, #0b3d29 0%, #14613f 60%, #1b7a4f 100%); }
.slide.s2 { background: linear-gradient(110deg, #5e3a12 0%, #8a5a1c 60%, #b0822c 100%); }
.slide.s3 { background: linear-gradient(110deg, #0f3f5c 0%, #17648f 60%, #2185b8 100%); }
.slide-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 30px; padding-bottom: 38px; }
.slide-text { max-width: 560px; }
.slide-text h1 { font-size: 38px; margin-bottom: 12px; }
.slide-text p { margin: 0 0 22px; font-size: 17px; color: #e6f1ea; }
.slide-img { width: 250px; height: 250px; object-fit: cover; border-radius: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3); }
.slide-art { flex: none; width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.12); border-radius: 50%; }
.slide-art svg { width: 100px; height: 100px; }

.dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 10px; height: 10px; padding: 0; background: rgba(255, 255, 255, 0.5); border: 0; border-radius: 50%; cursor: pointer; }
.dots button.on { width: 26px; border-radius: 6px; background: var(--gold-2); }

/* ----- trust strip ----- */

.trust { background: #fff; border-bottom: 1px solid var(--line); }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; padding-top: 12px; padding-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--green-2); }

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

.block { padding: 30px 0 6px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.block-head h2 { font-size: 23px; color: var(--green); position: relative; padding-bottom: 8px; }
.block-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 46px; height: 3px; background: var(--gold); border-radius: 2px; }
.more { font-size: 14px; font-weight: 700; color: var(--green-2); }
.more:hover { text-decoration: underline; }

.page-head { padding: 26px 0 4px; background: #fff; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 28px; color: var(--green); }
.page-head p { margin: 4px 0 16px; }
.page-head .wrap { padding-bottom: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.15s, box-shadow 0.15s; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 77, 52, 0.12); }
.tile-icon { display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; margin-bottom: 6px; color: #fff; border-radius: 18px; }
.tile-icon svg { width: 34px; height: 34px; }
.tile b { font-size: 15px; }
.tile small { color: var(--muted); }

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

.row-scroll { display: flex; gap: 14px; padding: 2px 2px 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row-scroll .card { flex: none; width: 200px; scroll-snap-align: start; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.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: 4 / 4.4; background: #f1f5f2; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.95); }
.ph svg { width: 34%; height: 34%; }
.ph.big svg { width: 38%; height: 38%; }

.tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; font-size: 11px; font-weight: 700; border-radius: 8px; }
.tag-out { color: #fff; background: rgba(60, 60, 60, 0.85); }
.tag-new { top: auto; bottom: 10px; color: var(--green); background: var(--gold-2); }

.heart { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #b9c6bf; 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-direction: column; gap: 3px; padding: 12px 14px 14px; }
.card-name { display: -webkit-box; overflow: hidden; min-height: 2.6em; font-size: 15px; font-weight: 700; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.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; }
.card-price { margin: 4px 0 0; font-size: 17px; font-weight: 800; color: var(--green-2); }

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

.band { margin-top: 30px; color: #fff; background: linear-gradient(110deg, #0b3d29, #14613f); }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.band h2 { font-size: 24px; margin-bottom: 4px; }
.band p { margin: 0; color: #d6e8dd; }

/* ----- shop page ----- */

.filters { display: flex; gap: 10px; margin-bottom: 12px; }
.filters input, .filters select { padding: 11px 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); }

.chips { display: flex; gap: 8px; padding-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip.on { color: #fff; background: var(--green-2); border-color: var(--green-2); }

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

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

.crumbs { margin: 0 0 16px; 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; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-info h1 { margin: 8px 0 6px; font-size: 28px; }
.detail-price { margin: 0 0 6px; font-size: 28px; font-weight: 800; color: var(--green-2); }
.pill { display: inline-block; padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--green); background: #f6e9c4; border-radius: 999px; }
.status { display: inline-block; margin: 0 0 16px; padding: 4px 12px; font-size: 13px; 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: 14px; color: #7a4b08; background: #fff4de; border: 1px solid #f1d9a2; border-radius: 12px; }
.detail-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.detail-actions { display: flex; gap: 20px; margin-bottom: 20px; }
.link-btn { padding: 0; font-weight: 600; color: var(--green-2); background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

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

/* ----- forms and about ----- */

.form { display: grid; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form input, .form textarea { padding: 12px 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); }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.about-text h2 { margin-bottom: 10px; 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: 6px; color: var(--green); }
.contact-card p { margin: 0 0 6px; }
.contact-card .btn { margin-top: 6px; }

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

.footer { margin-top: 36px; color: #d6e8dd; background: var(--green); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 28px; padding-top: 34px; padding-bottom: 24px; }
.footer-logo { width: 170px; border-radius: 16px; }
.footer h4 { margin-bottom: 10px; color: var(--gold-2); font-size: 16px; }
.footer p { margin: 0 0 8px; }
.footer a { display: block; padding: 3px 0; }
.footer a:hover { color: #fff; text-decoration: underline; }
.socials a { display: inline-block; margin-right: 14px; }
.copy { padding: 14px 16px; text-align: center; font-size: 13px; color: #a8c7b5; border-top: 1px solid rgba(255, 255, 255, 0.12); }

.wa-float { position: fixed; right: 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; }

/* ----- phone ----- */

@media (max-width: 860px) {
    .menu-btn { display: inline-flex; }
    .nav { display: none; }
    .header-row { flex-wrap: wrap; row-gap: 8px; }
    .brand { flex: 1; }
    .brand img { height: 40px; }
    .brand-text b { font-size: 16px; }
    .search { order: 5; flex: 1 1 100%; max-width: none; }
    .slide { min-height: 270px; }
    .slide-text h1 { font-size: 26px; }
    .slide-text p { font-size: 15px; }
    .slide-img, .slide-art { display: none; }
    .detail { grid-template-columns: 1fr; gap: 20px; }
    .about, .footer-grid { grid-template-columns: 1fr; }
    .band-in { flex-direction: column; align-items: flex-start; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .row-scroll .card { width: 165px; }
    .filters { flex-direction: column; }
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .tile { padding: 14px 6px; }
    .tile-icon { width: 50px; height: 50px; }
    .tile-icon svg { width: 28px; height: 28px; }
    .tile b { font-size: 13px; }
    .block-head h2 { font-size: 20px; }
    .topbar .wrap span { display: none; }
    .topbar .wrap { justify-content: center; }
}

/* ===== Green section bars, tabs, toast, back-to-top, second filter row ===== */

.block-head.bar {
    align-items: center;
    padding: 11px 16px;
    margin-bottom: 14px;
    background: linear-gradient(110deg, #0f4d34, #1b7a4f);
    border-radius: 12px;
}

.block-head.bar h2 {
    padding-bottom: 0;
    font-size: 19px;
    color: #ffffff;
}

.block-head.bar h2::after { display: none; }

.block-head.bar .more { color: var(--gold-2); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.tab {
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #dff0e5;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.tab.on { color: var(--green); background: var(--gold-2); }

#toast {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 90;
    max-width: 90vw;
    padding: 11px 20px;
    font-size: 14px;
    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); }

.to-top {
    position: fixed;
    right: 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; }

.filters.filters-2 { margin-top: -2px; }
.filters.filters-2 select { flex: 1; min-width: 0; }
.filters select[hidden] { display: none; }

@media (max-width: 860px) {
    .filters.filters-2 { flex-direction: row; }
}

/* ===== Two main categories: Books and Islamic Accessories ===== */

.tiles-phone { display: none; }

.nav-drop-list { max-height: 70vh; overflow: visible; }
.nav-drop-list .all-link { font-weight: 700; color: var(--green-2); }

.nav-sub { position: relative; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.nav-sub-head { display: flex !important; justify-content: space-between; font-weight: 700; color: var(--green); }
.nav-sub-list {
    position: absolute;
    top: 0;
    left: 100%;
    display: none;
    min-width: 190px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 77, 52, 0.15);
}
.nav-sub:hover .nav-sub-list, .nav-sub:focus-within .nav-sub-list { display: block; }
.nav-sub-list a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav-sub-list a:hover { background: #eef5f0; color: var(--green-2); }

.drawer-group { border-bottom: 1px solid var(--line); }
.drawer-group summary { padding: 13px 20px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.drawer-group summary::-webkit-details-marker { display: none; }
.drawer-group summary::after { content: "+"; font-size: 20px; color: var(--green-2); }
.drawer-group[open] summary::after { content: "−"; }
.drawer-group a { padding: 10px 20px 10px 34px; font-weight: 500; background: #f8faf8; }

.chips-sub { margin-top: -6px; }
.chips-sub .chip { font-size: 13px; padding: 6px 14px; background: #f1f6f3; }
.chips-sub .chip.on { background: var(--green); border-color: var(--green); }
.chips[hidden] { display: none; }
.filters[hidden] { display: none; }

@media (max-width: 860px) {
    .tiles-phone { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tiles-laptop { display: none; }
    .tiles-phone .tile { padding: 22px 10px; }
    .tiles-phone .tile-icon { width: 64px; height: 64px; }
    .tiles-phone .tile-icon svg { width: 34px; height: 34px; }
    .tiles-phone .tile b { font-size: 15px; }
}

/* ===== Photo banner slider ===== */

.hero { background: #faf6ea; }
.hero .slide { display: block; min-height: 0; padding: 0; background: none; }
.hero .slide img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 560; object-fit: cover; }
@media (max-width: 860px) {
    .hero .slide img { aspect-ratio: 1000 / 560; }
    .dots { bottom: 8px; }
}

/* ----- customer account ----- */
.header-user { font-size: 12px; font-weight: 700; }
.google-btn { width: 100%; }
.acc-form { display: grid; gap: 14px; }
.acc-msg { margin: 0; font-size: 14px; color: #b3261e; min-height: 1em; }
.acc-msg.good { color: var(--green-2); }
.center { text-align: center; }
.offer { display: grid; gap: 4px; margin-bottom: 16px; padding: 16px 18px; color: var(--green); background: #fff7dc; border: 1px solid var(--gold-2); border-radius: 14px; }
.offer b { font-size: 18px; }
.offer span { font-size: 14px; color: #5b5320; }
.offer.used { background: #eef5f0; border-color: #cfe3d6; font-weight: 700; }

/* ----- policy pages ----- */
.policy h2 { margin: 26px 0 8px; font-size: 19px; color: var(--green); }
.policy p, .policy li { line-height: 1.7; color: #33433a; }
.policy ul { padding-left: 20px; }

/* ===== Cart, checkout, orders, bottom navigation (Hissa 3) ===== */

/* small cart button on product cards */
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.card-foot .card-price { margin: 0; }
.card-cart { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; color: var(--green-2); background: #eef5f0; border: 0; border-radius: 10px; cursor: pointer; }
.card-cart:hover { color: #fff; background: var(--green-2); }
.card-cart svg { width: 20px; height: 20px; }

/* quantity stepper */
.stepper { display: inline-flex; align-items: center; 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; }
.qty-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 2px; font-weight: 600; }
.link-btn { display: inline-block; padding: 6px 0; font-size: 14px; font-weight: 600; color: var(--green-2); background: none; border: 0; cursor: pointer; text-decoration: underline; }

/* "Added to Your Cart" sheet */
.sheet { position: fixed; inset: 0; z-index: 80; 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: 20px 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 14px; 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: 14px; 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: 16px; }

/* cart + checkout layout */
.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: cover; }
.cart-img .ph svg { width: 44%; height: 44%; }
.cart-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-info .small { margin: 0; }
.cart-name { display: -webkit-box; overflow: hidden; font-weight: 700; line-height: 1.3; -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: 13px; 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; }
.summary h3, .form h3 { font-size: 18px; color: var(--green); }
.sum-row, .sum-item { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.sum-item { font-size: 14px; 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: 13px; color: var(--muted); }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.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: 21px; 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: #eef5f0; border-radius: 50%; }

.pay-box { display: grid; gap: 2px; padding: 12px 14px; background: #eef5f0; border: 1px solid #cfe3d6; border-radius: 12px; }
.pay-box span { font-size: 13px; 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: 22px; color: var(--green); }
.done-no { margin: 0; font-size: 16px; }
.done-box .summary { text-align: left; }

/* my orders */
.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); }
.ost { padding: 4px 12px; font-size: 12px; 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; }

.acc-link { display: flex; justify-content: space-between; margin-bottom: 14px; padding: 14px 18px; font-weight: 700; color: var(--green); background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.acc-link:hover { background: #eef5f0; }

.tiles-cat { margin-bottom: 8px; }
.cat-gap { margin-top: 22px; }

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

@media (max-width: 860px) {
    .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: 6px 4px calc(6px + 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: 2px; padding: 4px 0; font-size: 11px; 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; background: var(--gold); color: var(--green); }

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

    /* product page: the buy bar replaces the bottom menu */
    body.has-buybar { padding-bottom: 84px; }
    body.has-buybar .bottom-nav { display: none; }
    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.15; }
    .bar-price small { font-size: 11px; color: var(--muted); }
    .bar-price b { font-size: 18px; color: var(--green-2); }
    .buy-bar .btn { flex: 1; padding: 13px 10px; }

    .detail-buttons .btn { flex: 1 1 calc(50% - 10px); }
    .tiles-cat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cart-info .stepper { align-self: flex-start; }
.page-cart .wa-float { display: none; }
