/* =====================================================================
   ARK Woodworks — Catalogs (/catalog/…). Shared by every catalog.
   Uses the site's own tokens from styles.css (cream, ink, oak, Jost/Manrope).
   Phones first: 2-column grid, bottom-sheet inquiry list.
   ===================================================================== */
.cat-page main { padding-top: 96px; }
.cat-wrap { padding-top: 28px; padding-bottom: 64px; }
.cat-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--text-muted); margin: 0 0 18px; }
.cat-crumbs a { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.cat-crumbs span[aria-hidden] { color: var(--accent-soft); }

/* Hero */
.cat-hero { padding: 8px 0 26px; border-bottom: 1px solid var(--text); margin-bottom: 22px; }
.cat-hero h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; color: var(--text); margin: 10px 0 14px; }
.cat-hero p { max-width: 640px; font-size: 1.02rem; }
.cat-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cat-hero-actions .btn { flex: 0 1 auto; }
.cat-steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9rem; color: var(--text-soft); }
.cat-steps li::before { content: counter(step) ". "; counter-increment: step; color: var(--accent); font-weight: 600; }
.cat-steps { counter-reset: step; }
.cat-honest { font-size: 0.9rem; color: var(--text-soft); margin-top: 12px; }
.cat-honest strong { color: var(--text); }

/* Filter chips: one swipeable line on phones */
.cat-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 18px; padding: 4px 18px 6px;
    position: sticky; top: 76px; z-index: 5; background: var(--bg); }
.cat-filters::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font-size: 0.9rem; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.cat-chip em { font-style: normal; color: var(--text-muted); font-size: 0.8rem; }
.cat-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.cat-chip[aria-pressed="true"] em { color: rgba(255,255,255,0.7); }
.cat-count { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 12px; }

/* Product grid: 2 columns on phones, 3 on tablets, 4 on desktop */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
@media (min-width: 760px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 18px; } }
@media (min-width: 1100px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-card { display: flex; flex-direction: column; min-width: 0; }
.cat-card[hidden] { display: none; }
.cat-card-img { display: block; aspect-ratio: 7 / 5; overflow: hidden; background: var(--bg-alt); }
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.cat-card:hover .cat-card-img img { transform: scale(1.03); }
.cat-card-body { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; flex: 1; }
.cat-code { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--accent); }
.cat-card h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; line-height: 1.3; margin: 0; color: var(--text); }
.cat-card h3 a { color: inherit; }
.cat-sub { font-size: 0.84rem; line-height: 1.45; color: var(--text-soft); margin: 0; }
.cat-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
.cat-add { flex: 1; min-height: 44px; border: 1px solid var(--text); background: transparent; color: var(--text); font-size: 0.86rem; font-weight: 600; cursor: pointer; padding: 0 8px; }
.cat-add.is-added { background: var(--text); color: #fff; }
.cat-quick { flex: none; width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: #15803d; color: #fff; }
.cat-quick svg { width: 20px; height: 20px; }

/* Images: deter casual copying (long-press save on phones, dragging on desktop) */
.cat-protect img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* Hub (/catalog/) */
.hub-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 760px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-card { background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; }
.hub-card img { width: 100%; aspect-ratio: 7 / 5; object-fit: cover; display: block; }
.hub-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.hub-card h2 { font-family: var(--font-display); font-weight: 300; font-size: 1.8rem; margin: 0; color: var(--text); }
.hub-card .btn { align-self: flex-start; }
.hub-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hub-soon { border-style: dashed; justify-content: center; padding: 26px; text-align: center; }
.hub-soon h2 { font-size: 1.4rem; }

/* Product page */
.pd { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 980px) { .pd { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; align-items: start; } .pd-info { position: sticky; top: 100px; } }
.pd-gallery { position: relative; min-width: 0; }
/* Whole photos (never cropped): fixed height, natural width, swipe sideways */
.pd-strip { display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 4px; }
.pd-strip::-webkit-scrollbar { display: none; }
.pd-slide { flex: none; margin: 0; scroll-snap-align: center; width: min-content; }
/* Each photo keeps its own shape: as wide as the screen allows, never taller than ~60% of it */
.pd-slide img { display: block; width: auto; height: auto; max-width: calc(100vw - 36px); max-height: min(60vh, 480px); background: var(--bg-alt); }
@media (min-width: 980px) { .pd-strip { margin: 0; padding: 0 0 4px; } .pd-slide img { max-width: min(56vw, 760px); max-height: min(68vh, 620px); } }
.pd-cap { padding: 10px 2px 0; min-width: 200px; }
.pd-cap strong { display: block; font-size: 0.95rem; color: var(--text); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.pd-chips span { font-size: 0.82rem; padding: 4px 9px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pd-cap small { display: block; font-size: 0.85rem; color: var(--text-soft); }
.pd-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); }
.pd-nav button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.pd-thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; justify-content: center; }
.pd-thumbs button { width: 52px; height: 44px; padding: 0; border: 1px solid var(--border); background: var(--bg-alt); overflow: hidden; flex: none; }
.pd-thumbs button[aria-current="true"] { border: 2px solid var(--text); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-info h1 { font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.08; color: var(--text); margin: 6px 0 8px; }
.pd-subtitle { font-size: 1rem; color: var(--text-soft); margin: 0 0 14px; }
.pd-facts { margin: 0 0 12px; border-top: 1px solid var(--border); }
.pd-facts > div { display: grid; grid-template-columns: 116px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pd-facts dt { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.pd-facts dd { margin: 0; color: var(--text); font-size: 0.95rem; }
.pd-note { font-size: 0.9rem; background: var(--bg-alt); padding: 10px 12px; margin: 0 0 16px; }
.pd-note a { color: var(--accent-dark, var(--accent)); text-decoration: underline; }
.pd-form fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.pd-form legend { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 8px; padding: 0; }
.pd-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-opt { position: relative; }
.pd-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pd-opt span { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 6px 12px; border: 1px solid var(--border); background: var(--surface); font-size: 0.88rem; color: var(--text); cursor: pointer; line-height: 1.25; }
.pd-opt input:checked + span { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); background: var(--bg); }
.pd-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pd-colours { margin-top: 8px; }
.pd-colours[hidden] { display: none; }
.sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.18); flex: none; display: inline-block; }
.sw-any { background: conic-gradient(#c0392b, #e67e22, #f1c40f, #27ae60, #2980b9, #8e44ad, #c0392b); }
.pd-qty { display: flex; align-items: center; gap: 0; }
.pd-qty button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.pd-qty input { width: 56px; height: 44px; text-align: center; border: 1px solid var(--border); border-left: 0; border-right: 0; font-size: 1rem; background: var(--surface); -moz-appearance: textfield; }
.pd-qty input::-webkit-outer-spin-button, .pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pd-form textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 16px; }
.pd-actions { display: grid; gap: 8px; }
.pd-actions .btn { width: 100%; }
.pd-added { font-size: 0.9rem; color: #15803d; min-height: 1.2em; margin: 4px 0 0; }
.pd-pdf { font-size: 0.88rem; margin-top: 10px; }
.pd-pdf a { text-decoration: underline; color: var(--text-soft); }
.pd-section { margin-top: 44px; }
.pd-section h2 { font-family: var(--font-display); font-weight: 300; font-size: 1.7rem; color: var(--text); margin: 0 0 14px; }

/* Size table: a real table on wide screens, one card per row on phones */
.sz-wrap { border: 1px solid var(--border); background: var(--surface); }
.sz { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.sz th, .sz td { padding: 11px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.sz thead th { background: var(--bg-alt); color: var(--text); font-weight: 600; font-size: 0.85rem; }
.sz tbody th { color: var(--text); font-weight: 600; }
.sz tr:last-child th, .sz tr:last-child td { border-bottom: 0; }
.sz .sz-span th { background: var(--bg); }
.sz .sz-span td { font-style: italic; }
.sz-units { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
@media (max-width: 700px) {
    .sz-wrap { border: 0; background: none; }
    .sz thead { display: none; }
    .sz, .sz tbody, .sz tr, .sz th, .sz td { display: block; width: auto; }
    .sz tr { border: 1px solid var(--border); background: var(--surface); margin-bottom: 10px; }
    .sz tbody th { background: var(--bg-alt); }
    .sz td { padding: 8px 13px; }
    .sz td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
}

/* Materials & finishes */
.mat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .mat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mat-card { background: var(--surface); border: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.mat-card strong { font-size: 1rem; color: var(--text); }
.ur { font-family: "Noto Nastaliq Urdu", serif; direction: rtl; font-size: 1.05rem; line-height: 2.1; color: var(--text-soft); text-align: right; }
.fin-block { background: var(--surface); border: 1px solid var(--border); padding: 16px; margin-bottom: 12px; }
.fin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fin-head strong { font-size: 1.1rem; color: var(--text); }
.fin-swatches { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; margin: 0; }
.fin-swatches li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text); width: 62px; text-align: center; }
.fin-swatches .sw { width: 46px; height: 46px; }

/* Floating inquiry button + drawer (bottom sheet on phones, side panel on desktop) */
.inq-fab { position: fixed; right: 16px; bottom: 24px; z-index: 96; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 18px;
    background: var(--text); color: #fff; border: 0; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.04em; cursor: pointer;
    box-shadow: 0 8px 24px rgba(31, 26, 20, 0.28); }
.inq-fab b { background: #fff; color: var(--text); min-width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; padding: 0 6px; }
.inq-fab.bump { animation: inqBump .5s ease; }
@keyframes inqBump { 40% { transform: scale(1.08); } }
.cat-page .whatsapp-float { display: none; }
@media (max-width: 767px) { .inq-fab { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; } }
.inq-shade { position: fixed; inset: 0; background: rgba(20, 16, 12, 0.45); z-index: 110; }
.inq-shade[hidden], .inq[hidden] { display: none; }
.inq { position: fixed; z-index: 111; background: var(--bg); display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; animation: inqUp .25s ease; }
@keyframes inqUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) { .inq { left: auto; top: 0; width: 440px; max-height: none; animation: none; } }
.inq-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.inq-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; margin: 0; color: var(--text); }
.inq-close { width: 44px; height: 44px; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--text); }
.inq-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px 18px 18px; flex: 1; }
.inq-empty { padding: 24px 0; text-align: center; color: var(--text-soft); }
.inq-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.inq-item img { width: 64px; height: 50px; object-fit: cover; background: var(--bg-alt); }
.inq-item h3 { font-size: 0.95rem; font-weight: 600; margin: 0; color: var(--text); line-height: 1.3; }
.inq-item h3 a { color: inherit; }
.inq-item p { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.45; color: var(--text-soft); }
.inq-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.inq-row .pd-qty button, .inq-row .pd-qty input { height: 38px; }
.inq-row .pd-qty button { width: 38px; }
.inq-row .pd-qty input { width: 44px; }
.inq-remove { border: 0; background: none; color: #a0362a; font-size: 0.85rem; text-decoration: underline; min-height: 38px; cursor: pointer; }
.inq-fields { display: grid; gap: 10px; margin-top: 16px; }
.inq-fields label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--text); }
.inq-fields input, .inq-fields textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 16px; }
.inq-fields textarea { min-height: 64px; }
.inq-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg); }
.inq-send { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #15803d; color: #fff; border: 0; font-size: 1rem; font-weight: 600; cursor: pointer; }
.inq-send[disabled] { opacity: 0.5; cursor: not-allowed; }
.inq-foot small { display: block; text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.inq-clear { border: 0; background: none; font-size: 0.82rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; padding: 8px 0 0; }
html.inq-open, html.inq-open body { overflow: hidden; }
.inq-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 97; background: var(--text); color: #fff;
    padding: 12px 16px; font-size: 0.92rem; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,0.25); max-width: calc(100vw - 32px); }
.inq-toast button { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; padding: 0; white-space: nowrap; }
.inq-toast[hidden] { display: none; }
@media (min-width: 768px) { .inq-toast { bottom: 96px; } }

/* Veneer swatches (wood-grain look; colours on screen are a guide) */
.sw.sw-v-ash { background: repeating-linear-gradient(78deg, #e4d3b3 0 4px, #d0bb93 4px 5px, #e4d3b3 5px 9px, #d0bb93 9px 11px); }
.sw.sw-v-oak { background: repeating-linear-gradient(78deg, #cfa66c 0 4px, #b88d52 4px 5px, #cfa66c 5px 9px, #b88d52 9px 11px); }
.sw.sw-v-teak { background: repeating-linear-gradient(78deg, #a9733d 0 4px, #8c5c2c 4px 5px, #a9733d 5px 9px, #8c5c2c 9px 11px); }
.sw.sw-v-walnut { background: repeating-linear-gradient(78deg, #6e4b33 0 4px, #553725 4px 5px, #6e4b33 5px 9px, #553725 9px 11px); }
.sw.sw-v-wenge { background: repeating-linear-gradient(78deg, #43302a 0 4px, #2a1c15 4px 5px, #43302a 5px 9px, #2a1c15 9px 11px); }
.sw.sw-v-other { background: linear-gradient(135deg, #e4d3b3 0 33%, #a9733d 33% 66%, #43302a 66%); }
.fin-text { margin: 12px 0 0; font-size: 0.92rem; color: var(--text); }
.fin-text.ur { margin-top: 4px; text-align: right; }
/* Dimension views: always shown whole */
.pd-slide-dims img { object-fit: contain; }
/* The label and caption are drawn on dimension images; keep the text for search and screen readers only */
.pd-slide-dims { position: relative; min-width: 200px; }
.pd-slide-dims .pd-cap { position: absolute; width: 1px; height: 1px; min-width: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
