/*
Theme Name: Carpets Bazaar
Theme URI: https://carpetsbazaar.com
Author: Carpets Bazaar
Author URI: https://carpetsbazaar.com
Description: Custom WooCommerce theme for Carpets Bazaar — handmade rugs from Bhadohi, direct to your floor.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carpetsbazaar
WC requires at least: 8.0
WC tested up to: 9.0
*/

/* ============================================================
   DESIGN SYSTEM — Carpets Bazaar
   Tokens locked to the three HTML mockups (v12/v8/v3).
   ============================================================ */

:root {
  /* ── colours ── */
  --paper: #FFFFFF;
  --ink: #282828;
  --yellow: #FFD53D;
  --yellow-wash: #FFEC5C;
  --blue-light: #C0D9FF;
  --terracotta: #CF987E;
  --green: #A2DCE7;
  --pink: #F8CCDC;
  --blue-deep: #7292CA;
  --hair: rgba(40, 40, 40, .14);

  /* ── typography ── */
  --display: 'Literata', Georgia, serif;
  --ui: 'Quicksand', system-ui, sans-serif;
  --script: 'Sacramento', cursive;

  /* ── layout ── */
  --container: 1300px;
  --pad: 64px;
}

@media (max-width: 833px) {
  :root {
    --pad: 48px;
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 833px) {
  .wrap {
    padding: 0 16px;
  }
}

/* ============================================================
   TYPOGRAPHY — ALL HEADINGS LOWERCASE (brand rule #1)
   ============================================================ */

h1, h2,
.pull,
.tally-line,
.numeral,
.rail-note {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0;
}

h1 {
  font-size: 44px;
  line-height: 58px;
}

h2 {
  font-size: 36px;
  line-height: 50px;
}

h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  text-transform: lowercase;
}

h4 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  text-transform: lowercase;
}

@media (max-width: 833px) {
  h1 { font-size: 30px; line-height: 40px; }
  h2 { font-size: 26px; line-height: 36px; }
}

/* ── label (pillar label) ── */
.label {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: lowercase;
}

.pillar { display: block; }
.pillar .rule { width: 32px; height: 2px; margin-top: 10px; }

.p-terracotta { color: var(--terracotta); }
.p-terracotta .rule { background: var(--terracotta); }
.p-green { color: #5aa8ba; }
.p-green .rule { background: var(--green); }
.p-pink { color: #c98099; }
.p-pink .rule { background: var(--pink); }
.p-ink { color: var(--ink); }
.p-ink .rule { background: var(--ink); }

/* ============================================================
   BUTTONS — 0 border-radius, always
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 40px;
  border-radius: 0;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: lowercase;
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
}

.btn-primary {
  background: var(--yellow);
  color: var(--ink);
}
.btn-primary:hover {
  background: var(--ink);
  color: var(--yellow);
}

.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}
.btn-ink:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-etsy {
  background: #F1641E;
  color: #fff;
}
.btn-etsy:hover {
  background: #d4530f;
  color: #fff;
}

/* ============================================================
   1 — ANNOUNCEMENT BAR
   ============================================================ */

.announce {
  height: 42px;
  background: var(--yellow);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: .04em;
}

@media (max-width: 700px) {
  .announce {
    font-size: 11px;
    height: auto;
    padding: 8px 12px;
    text-align: center;
    line-height: 18px;
  }
}

/* ============================================================
   2 — HEADER
   ============================================================ */

.header {
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
}

.header-top {
  height: 80px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--hair);
}

.header-top .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}

.wordmark {
  font-family: var(--script);
  font-size: 38px;
  line-height: 1;
  white-space: nowrap;
  padding-bottom: 6px;
}

.wordmark a {
  color: inherit;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav a {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: lowercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.current {
  border-bottom-color: var(--yellow);
}

.util {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: lowercase;
  font-weight: 500;
}

.util .track {
  border-bottom: 1px solid var(--hair);
}

/* AI search row */
.header-search {
  border-top: 1px solid var(--hair);
  padding: 12px 0;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  height: 48px;
  background: #faf8f6;
  border: 1px solid var(--hair);
  padding: 0 8px 0 18px;
}

.searchbar .mag {
  font-size: 15px;
  color: #8a8a8a;
  flex: 0 0 auto;
}

.searchbar input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink);
  height: 100%;
}

.searchbar input::placeholder {
  color: #9a9a9a;
}

.searchbar input:focus {
  outline: none;
}

.searchbar .upload {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: none;
  border: 1px solid var(--hair);
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: #555;
  cursor: pointer;
}

.searchbar .upload:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.searchbar .go {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 18px;
  background: var(--yellow);
  color: var(--ink);
  border: none;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: lowercase;
  cursor: pointer;
}

.search-hint {
  max-width: 1000px;
  margin: 8px auto 0;
  font-size: 11px;
  color: #9a9a9a;
  letter-spacing: .02em;
}

.search-hint b {
  color: var(--blue-deep);
  font-weight: 500;
  cursor: pointer;
}

@media (max-width: 1150px) {
  .nav { display: none; }
}

@media (max-width: 700px) {
  .header-top {
    height: auto;
    padding: 12px 0;
  }
  .header-top .wrap {
    flex-wrap: wrap;
    gap: 10px;
  }
  .wordmark { font-size: 30px; }
  .util { font-size: 11px; gap: 12px; }
  .searchbar .upload span { display: none; }
  .searchbar { height: 44px; }
}

/* ============================================================
   3 — HERO (homepage split layout)
   ============================================================ */

.hero {
  min-height: 480px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 0;
}

.hero-copy {
  padding: 56px 64px 56px 0;
  max-width: 650px;
  margin-left: auto;
  padding-left: 32px;
}

.hero p {
  margin-top: 22px;
  font-size: 16px;
  line-height: 28px;
  max-width: 44ch;
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-media {
  align-self: stretch;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.hero-media img,
.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .45);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: lowercase;
  max-width: 32ch;
  line-height: 16px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 56px 16px 40px; max-width: none; margin-left: 0; }
  .hero-media { min-height: 300px; margin: 0 -16px; }
}

/* ============================================================
   4 — VALUE PROP
   ============================================================ */

.valueprop {
  padding: var(--pad) 0;
  text-align: center;
}

.valueprop .pillar {
  display: inline-block;
}

.valueprop .pillar .rule {
  margin: 10px auto 0;
}

.valueprop h2 {
  margin-top: 26px;
}

.valueprop p {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: 15px;
  line-height: 26px;
}

/* ============================================================
   5 — BEST SELLERS (horizontal scroll)
   ============================================================ */

.bestsellers {
  padding: var(--pad) 0 40px;
}

.bs-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.bs-head h2 { margin-top: 14px; }

.bs-head a {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: lowercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.bs-track {
  margin-top: 40px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.bs-track::-webkit-scrollbar { height: 6px; }
.bs-track::-webkit-scrollbar-thumb { background: var(--hair); }

.bs-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  cursor: pointer;
}

@media (max-width: 600px) {
  .bs-card { flex-basis: 78vw; }
}

/* rug image always shows the whole rug, never cropped */
.bs-img {
  width: 100%;
  aspect-ratio: 1/1;
  background: #faf8f6;
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
}

.bs-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.bs-name {
  margin-top: 16px;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: lowercase;
}

.bs-price {
  margin-top: 4px;
  font-family: var(--ui);
  font-size: 13px;
  color: #666;
}

.bs-swatches {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bs-swatches span {
  width: 16px;
  height: 16px;
  border: 1px solid var(--hair);
}

.bs-more {
  font-size: 11px;
  color: #8a8a8a;
  margin-left: 4px;
}

/* ============================================================
   6 — TWO WAYS TO BUY
   ============================================================ */

.ways {
  padding: 32px 0 var(--pad);
}

.ways h2 { margin-top: 14px; }

.ways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

@media (max-width: 833px) {
  .ways-grid { grid-template-columns: 1fr; }
}

.way {
  min-height: 300px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.way--stock { background: var(--blue-light); }
.way--made  { background: var(--terracotta); }

.numeral {
  font-size: 64px;
  line-height: 1;
  margin-top: 16px;
}

.way .fromline {
  font-size: 12px;
  letter-spacing: .04em;
  margin-top: 6px;
  opacity: .75;
}

.way h3 { margin-top: 14px; }

.way p {
  margin-top: 10px;
  font-size: 15px;
  max-width: 30ch;
}

.way .btn {
  align-self: flex-start;
  margin-top: 26px;
}

@media (max-width: 600px) {
  .way { min-height: auto; padding: 32px; }
}

/* ============================================================
   7 — SHOP BY (facets)
   ============================================================ */

.shopby {
  padding: var(--pad) 0;
}

.facets {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}

@media (max-width: 833px) {
  .facets { grid-template-columns: 1fr 1fr; }
}

.facet {
  background: var(--paper);
  padding: 26px 22px;
}

.facet ul {
  list-style: none;
  margin-top: 12px;
  font-size: 13px;
  line-height: 26px;
  color: #666;
}

.facet ul li a:hover {
  color: var(--ink);
}

/* ============================================================
   8 — DESIGN TOOL
   ============================================================ */

.tool {
  padding: 32px 0 var(--pad);
}

.tool h2 { margin-top: 16px; }

.tool .lede {
  margin-top: 10px;
  color: #555;
  font-size: 15px;
}

.tabs {
  display: flex;
  margin-top: 28px;
  border-bottom: 1px solid var(--hair);
  flex-wrap: wrap;
}

.tab {
  padding: 14px 20px;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: lowercase;
  color: #8a8a8a;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--green);
}

.panel { display: none; padding-top: 28px; }
.panel.on { display: block; }

.stage {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 52px;
  align-items: start;
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   9 — HOW IT'S MADE + PROGRESS RAIL
   ============================================================ */

.made {
  padding: 32px 0 var(--pad);
}

.made h2 { margin-top: 24px; }

.steps {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1000px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
}

@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
}

.step { display: flex; flex-direction: column; }

.step .num {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--terracotta);
}

.step h3 { margin-top: 12px; }

.step p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 23px;
  color: #555;
}

.step .ph {
  margin-top: auto;
  aspect-ratio: 4/5;
  background: #f2f0ee;
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.step .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* progress rail */
.rail-wrap {
  margin-top: 56px;
  border-top: 1px solid var(--hair);
  padding-top: 48px;
}

.rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.rail-head .label { color: #8a8a8a; }
.rail-head .label:first-child { color: var(--ink); }

.rail {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.node {
  position: relative;
  padding-top: 28px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: lowercase;
  color: #b0b0b0;
}

.node::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: #e3e1df;
}

.node::after {
  content: "";
  position: absolute;
  top: -4px; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e3e1df;
}

.node.done { color: #555; }
.node.done::before { background: var(--ink); }
.node.done::after  { background: var(--ink); }

.node.now { color: var(--ink); font-weight: 600; }
.node.now::before { background: var(--ink); }
.node.now::after {
  width: 16px; height: 16px;
  top: -7px;
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(255, 213, 61, .32);
}

@media (max-width: 900px) {
  .rail { grid-template-columns: 1fr; gap: 0; }
  .node { padding: 0 0 26px 30px; }
  .node::before { top: 0; bottom: 0; left: 5px; right: auto; width: 2px; height: auto; }
  .node::after  { top: 0; left: 0; }
  .node.now::after { left: -3px; top: -3px; }
  .node:last-child::before { display: none; }
}

.rail-note {
  margin-top: 40px;
  font-size: 22px;
  line-height: 34px;
  max-width: 34ch;
}

/* ============================================================
   10 — REVIEWS (homepage)
   ============================================================ */

.loved {
  padding: var(--pad) 0;
}

.loved h2 { margin-top: 24px; }

.ugc {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .ugc { grid-template-columns: repeat(3, 1fr); }
}

.ugc div {
  aspect-ratio: 1;
  background: #f2f0ee;
  border: 1px solid var(--hair);
  overflow: hidden;
}

.ugc div img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quotes {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

@media (max-width: 833px) {
  .quotes { grid-template-columns: 1fr; gap: 34px; }
}

.q .label { color: var(--blue-deep); }

.pull {
  font-size: 22px;
  line-height: 34px;
  margin-top: 12px;
}

.q cite {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: lowercase;
  color: #999;
  font-style: normal;
}

.tally {
  margin-top: 70px;
  border-top: 1px solid var(--hair);
  padding-top: 54px;
  text-align: center;
}

.tally-line {
  font-size: 36px;
  line-height: 50px;
}

@media (max-width: 600px) {
  .tally-line { font-size: 24px; line-height: 36px; }
}

/* ============================================================
   11 — FOOTER
   ============================================================ */

.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 60px 0;
}

.site-footer .wordmark {
  color: #fff;
  font-size: 34px;
}

.fcols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 833px) {
  .fcols { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.site-footer h4 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  text-transform: lowercase;
}

.site-footer ul {
  list-style: none;
  margin-top: 14px;
  font-size: 14px;
  line-height: 30px;
  opacity: .8;
}

.site-footer ul a:hover {
  opacity: 1;
}

.site-footer .blurb {
  margin-top: 12px;
  font-size: 14px;
  line-height: 24px;
  opacity: .8;
  max-width: 32ch;
}

.fbot {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  opacity: .6;
}

.fbot a:hover { opacity: 1; }

/* ============================================================
   PRODUCT PAGE — single-product.php
   ============================================================ */

/* breadcrumb */
.crumb {
  padding: 20px 0 0;
  font-size: 12px;
  letter-spacing: .03em;
  color: #9a9a9a;
}

.crumb a:hover { color: var(--ink); }

/* main two-column */
.product-layout {
  padding: 16px 0 var(--pad);
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; gap: 36px; }
}

/* gallery: sticky, single image */
.gallery {
  display: block;
  position: sticky;
  top: 96px;
  align-self: start;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .gallery { position: static; }
}

.gal-stage { position: relative; }

.gal-board {
  background: #faf8f6;
  border: 1px solid var(--hair);
  min-height: 400px;
  max-height: 700px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.gal-board.gal-single {
  grid-template-columns: 1fr;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gal-board.gal-single img {
  max-width: 100%;
  max-height: 660px;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.gal-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

.gal-pane:first-child {
  border-right: 2px solid #fff;
}

.gal-pane img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--hair);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gal-arrow:hover {
  background: var(--ink);
  color: #fff;
}

.gal-arrow.prev { left: -8px; }
.gal-arrow.next { right: -8px; }

@media (max-width: 600px) {
  .gal-arrow.prev { left: 2px; }
  .gal-arrow.next { right: 2px; }
}

/* small thumbnails */
.gal-thumbs {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gal-thumbs::-webkit-scrollbar { height: 4px; }
.gal-thumbs::-webkit-scrollbar-thumb { background: var(--hair); }

.gal-thumbs button {
  flex: 0 0 auto;
  width: 100px;
  height: 75px;
  border: 1px solid var(--hair);
  background: #faf8f6;
  cursor: pointer;
  padding: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gal-thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gal-thumbs button.on {
  border-color: var(--ink);
  border-width: 2px;
}

@media (max-width: 600px) {
  .gal-thumbs button { width: 80px; height: 60px; }
}

/* buy column */
.buy {
  position: static;
  min-width: 0;
}
.buy .label { color: var(--terracotta); }
.buy h1 { margin-top: 8px; font-size: 32px; line-height: 40px; }

.buy .short-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 23px;
  color: #555;
}

.buy .rating {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
}

.buy .rating .stars {
  color: var(--terracotta);
  letter-spacing: 1px;
}

.buy .price-line {
  margin-top: 20px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}

.buy .price-line small {
  font-weight: 400;
  font-size: 13px;
  color: #8a8a8a;
  letter-spacing: .02em;
  margin-left: 8px;
}

.product-info-block {
  margin-top: 16px !important;
  padding: 0 !important;
  border: none !important;
}

.product-info-block .sku-line {
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: none !important;
  font-size: 12px;
  letter-spacing: .06em;
  color: #8a8a8a;
  text-transform: lowercase;
}

.product-info-block .info-heading {
  font-family: var(--ui) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  text-transform: lowercase !important;
  color: var(--ink) !important;
  margin: 0 !important;
  padding: 8px 0 0 !important;
  border: none !important;
  border-top: 1px solid var(--hair) !important;
}

.product-info-block .colour-line {
  margin: 6px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: 13px;
  color: #555;
  line-height: 22px;
}

.product-info-block .blurb {
  margin: 6px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: 14px;
  line-height: 24px;
  color: #444;
}

.blurb {
  margin-top: 6px;
  font-size: 14px;
  line-height: 24px;
  color: #444;
}

/* option groups */
.opt { margin-top: 26px; }
.opt.opt-tight { margin-top: 18px; }

.opt .opt-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.opt .opt-h .label { color: var(--ink); }
.opt .opt-h .pick { font-size: 12px; color: #8a8a8a; }

/* colour swatches (product page) */
.swrow {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sw {
  width: 28px;
  height: 28px;
  border: 1px solid var(--hair);
  position: relative;
  cursor: pointer;
  transition: transform .12s;
}

.sw:hover { transform: translateY(-2px); }

.sw[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--ink);
}

/* size buttons */
.sizes {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size {
  padding: 10px 16px;
  border: 1px solid var(--hair);
  font-size: 13px;
  cursor: pointer;
  letter-spacing: .02em;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 96px;
}

.size .sp {
  font-size: 11px;
  color: #8a8a8a;
}

.size[aria-pressed="true"] {
  border-color: var(--ink);
  border-width: 2px;
  padding: 9px 15px;
}

.size.custom {
  border-style: dashed;
}

/* edge finish dropdown */
.edge-select {
  margin-top: 12px;
  width: 100%;
  height: 48px;
  border: 1px solid var(--hair);
  background: #faf8f6;
  padding: 0 14px;
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  border-radius: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23282828' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.edge-select:focus { outline: none; border-color: var(--ink); }

.edge-note { margin-top: 12px; display: none; }
.edge-note.on { display: block; }

.edge-note textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--hair);
  background: #faf8f6;
  padding: 12px;
  font-family: var(--ui);
  font-size: 14px;
  resize: vertical;
  border-radius: 0;
}

.edge-note textarea:focus { outline: none; border-color: var(--ink); }
.edge-note .note { margin-top: 6px; font-size: 11px; color: #9a9a9a; }

/* edge + addon side by side */
.edge-addon-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* addon checkbox */
.addon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 48px;
  border: 1px solid var(--hair);
  cursor: pointer;
  margin-top: 12px;
}

.addon:hover { border-color: var(--ink); }

.addon input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--ink);
  cursor: pointer;
}

.addon-text {
  flex: 1;
  font-size: 12px;
  color: #444;
}

.addon-text b {
  color: var(--ink);
  font-weight: 600;
}

.addon-price {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

/* custom size entry */
.custom-entry {
  margin-top: 14px;
  display: none;
  padding: 16px;
  background: #faf8f6;
  border: 1px solid var(--hair);
}

.custom-entry.on { display: block; }

.custom-entry .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-entry input {
  width: 80px;
  height: 40px;
  border: 1px solid var(--hair);
  background: #fff;
  padding: 0 10px;
  font-family: var(--ui);
  font-size: 15px;
  text-align: center;
  border-radius: 0;
}

.custom-entry .x { color: #8a8a8a; }
.custom-entry .unit { font-size: 12px; color: #8a8a8a; }

.custom-entry .calc {
  margin-top: 12px;
  font-size: 13px;
  color: #444;
}

.custom-entry .calc b {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
}

.custom-entry .note {
  margin-top: 6px;
  font-size: 11px;
  color: #9a9a9a;
}

/* actions */
.actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.action-row .btn {
  width: 100%;
  height: 52px;
  padding: 0 12px;
}

.actions .lead {
  font-size: 12px;
  color: #8a8a8a;
  text-align: center;
  margin-top: 2px;
}

/* assurance block */
.assure {
  margin-top: 24px;
  border-top: 1px solid var(--hair);
  padding-top: 18px;
  display: grid;
  gap: 10px;
}

.assure div {
  font-size: 13px;
  color: #555;
  display: flex;
  gap: 10px;
}

.assure b {
  color: var(--ink);
  font-weight: 600;
}

/* section band (product below-fold sections) */
.band {
  padding: var(--pad) 0;
  border-top: 1px solid var(--hair);
}

.band h2 { margin-top: 10px; }

/* ============================================================
   ROOM-FIT BLOCK — the differentiator
   ============================================================ */

.fit-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
}

@media (max-width: 833px) {
  .fit-grid { grid-template-columns: 1fr; }
}

.fit {
  background: var(--paper);
  padding: 24px;
}

.fit .q {
  font-size: 13px;
  color: #8a8a8a;
}

.fit .a {
  margin-top: 6px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
}

.fit .a.yes { color: #4b7a52; }
.fit .a.ok  { color: var(--terracotta); }
.fit .a.no  { color: #999; }

.fit .why {
  margin-top: 8px;
  font-size: 13px;
  line-height: 21px;
  color: #555;
}

/* ============================================================
   SPECS BLOCK
   ============================================================ */

.specs {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}

@media (max-width: 833px) {
  .specs { grid-template-columns: 1fr; }
}

.spec {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
}

.spec .k {
  font-size: 13px;
  color: #8a8a8a;
}

.spec .v {
  font-size: 14px;
  color: var(--ink);
  text-align: right;
}

.spec .v em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #8a8a8a;
  margin-top: 2px;
}

/* ============================================================
   VISUALISER (product page)
   ============================================================ */

.viz {
  margin-top: 32px;
  background: var(--green);
  padding: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 833px) {
  .viz { grid-template-columns: 1fr; }
}

.viz .room {
  aspect-ratio: 4/3;
  background: #e9e6e2;
  border: 1px solid rgba(40, 40, 40, .1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   REVIEWS (product page)
   ============================================================ */

.rev-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.rev-head .big {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
}

.rev-head .stars {
  color: var(--terracotta);
  font-size: 18px;
  letter-spacing: 2px;
}

.rev-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 833px) {
  .rev-grid { grid-template-columns: 1fr; gap: 24px; }
}

.rev .stars {
  color: var(--terracotta);
  font-size: 13px;
  letter-spacing: 1px;
}

.rev .txt {
  margin-top: 10px;
  font-size: 14px;
  line-height: 23px;
  color: #333;
}

.rev .who {
  margin-top: 12px;
  font-size: 12px;
  color: #9a9a9a;
  letter-spacing: .03em;
}

.rev .tag {
  margin-top: 10px;
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  background: var(--pink);
  color: var(--ink);
}

/* ============================================================
   COLLECTIONS / ARCHIVE PAGE
   ============================================================ */

/* collection head */
.chead {
  padding: 28px 0 8px;
}

.chead h1 { margin-bottom: 8px; }

.chead p {
  color: #666;
  font-size: 15px;
  max-width: 60ch;
}

/* AI search bar (collections) */
.aibar {
  padding: 20px 0 6px;
}

.aibar .searchbar {
  height: 52px;
  max-width: none;
}

.aihint {
  margin-top: 8px;
  font-size: 11px;
  color: #9a9a9a;
}

.aihint b {
  color: var(--blue-deep);
  font-weight: 500;
  cursor: pointer;
}

/* layout: sidebar + grid */
.shop-layout {
  padding: 20px 0 var(--pad);
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 833px) {
  .shop-layout { grid-template-columns: 1fr; gap: 20px; }
}

/* filter sidebar */
.filters {
  position: sticky;
  top: 96px;
}

@media (max-width: 833px) {
  .filters { position: static; display: none; }
  .filters.open { display: block; }
}

.fgroup {
  border-bottom: 1px solid var(--hair);
  padding: 16px 0;
}

.fgroup:first-child { padding-top: 0; }

.fgroup .fh {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13px;
  text-transform: lowercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.fgroup.outcome .fh { color: var(--terracotta); }

.fopt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}

.fopt input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  cursor: pointer;
}

.fopt .cnt {
  margin-left: auto;
  font-size: 11px;
  color: #bbb;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 3px 6px 3px 0;
  padding: 5px 10px;
  border: 1px solid var(--hair);
  font-size: 12px;
  cursor: pointer;
}

.fchip.on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.swatchopt {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.swatchopt button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--hair);
  cursor: pointer;
  position: relative;
}

.swatchopt button.on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--ink);
}

/* mobile filter/search toggles */
.mobile-tools { display: none; }

@media (max-width: 833px) {
  .mobile-tools {
    display: flex;
    gap: 10px;
    padding: 12px 0;
  }
  .mobile-tools button {
    flex: 1;
    height: 44px;
    border: 1px solid var(--ink);
    font-size: 13px;
    text-transform: lowercase;
    letter-spacing: .04em;
    border-radius: 0;
  }
}

/* product grid */
.gridhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.gridhead .count { font-size: 13px; color: #8a8a8a; }

.gridhead .sort { font-size: 13px; color: #555; }

.gridhead .sort select {
  font-family: var(--ui);
  font-size: 13px;
  border: 1px solid var(--hair);
  padding: 6px 10px;
  background: #faf8f6;
  cursor: pointer;
  border-radius: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */

.card { cursor: pointer; }

.card-img {
  background: #faf8f6;
  border: 1px solid var(--hair);
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

/* rug images: never cropped */
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* hover arrows */
.card-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .15s;
  border-radius: 0;
}

.card-img:hover .card-nav,
.card-img:focus-within .card-nav {
  opacity: 1;
}

.card-nav:hover {
  background: var(--ink);
  color: #fff;
}

.card-nav.prev { left: 8px; }
.card-nav.next { right: 8px; }

@media (hover: none) {
  .card-nav { opacity: 1; }
}

/* favourite heart */
.card-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  transition: transform .12s, color .12s;
}

.card-fav:hover { transform: scale(1.1); }
.card-fav.on { color: var(--terracotta); }

/* badge */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: lowercase;
  padding: 3px 8px;
  background: var(--blue-light);
  color: var(--ink);
}

.card-badge.made {
  background: var(--terracotta);
}

/* fit tags */
.card-fit {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.card-fit span {
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: lowercase;
  padding: 2px 7px;
  background: rgba(255, 255, 255, .9);
  color: #555;
  border: 1px solid var(--hair);
}

/* card text */
.card-name {
  margin-top: 12px;
  font-family: var(--ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .02em;
  text-transform: lowercase;
}

.card-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #8a8a8a;
}

/* smart price */
.card-price {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card-price .now {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.card-price .now .sz {
  font-weight: 400;
  font-size: 11px;
  color: #8a8a8a;
  margin-left: 3px;
}

.card-range {
  margin-top: 3px;
  font-size: 11px;
  color: #9a9a9a;
}

.card-swatches {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-swatches span {
  width: 14px;
  height: 14px;
  border: 1px solid var(--hair);
}

.card-swatches .more {
  font-size: 10px;
  color: #8a8a8a;
  margin-left: 2px;
}

/* ============================================================
   WOOCOMMERCE OVERRIDES — neutralise WooCommerce defaults
   ============================================================ */

.woocommerce .price,
.woocommerce-page .price {
  color: var(--ink) !important;
  font-family: var(--ui) !important;
}

.woocommerce .button,
.woocommerce-page .button {
  border-radius: 0 !important;
}

/* hide default WooCommerce elements we replace */
.woocommerce-result-count,
.woocommerce-ordering {
  display: none;
}

/* ============================================================
   UTILITIES
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto;
  }
}

/* ============================================================
   PRODUCT INFO BLOCK — locked spacing (overrides all externals)
   ============================================================ */

.product-info-block,
.product-info-block * {
  border: none !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.product-info-block {
  margin-top: 16px !important;
}

.product-info-block .sku-line {
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

.product-info-block .info-heading {
  border-top: 1px solid rgba(40,40,40,.14) !important;
  padding-top: 8px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.product-info-block .colour-line {
  margin-top: 6px !important;
}

.product-info-block .blurb {
  margin-top: 6px !important;
}

/* ============================================================
   LIGHTBOX / FULLSCREEN IMAGE VIEWER
   ============================================================ */

.cb-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.cb-lightbox .lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  cursor: pointer;
}

.cb-lightbox .lb-img {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
}

.cb-lightbox .lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 3;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
  transition: opacity .15s;
}

.cb-lightbox .lb-close:hover { opacity: 1; }

.cb-lightbox .lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.cb-lightbox .lb-arrow:hover {
  background: rgba(255, 255, 255, .25);
}

.cb-lightbox .lb-prev { left: 20px; }
.cb-lightbox .lb-next { right: 20px; }

.cb-lightbox .lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, .6);
  font-family: var(--ui);
  font-size: 13px;
  letter-spacing: .06em;
}

@media (max-width: 600px) {
  .cb-lightbox .lb-arrow { width: 40px; height: 40px; font-size: 22px; }
  .cb-lightbox .lb-prev { left: 8px; }
  .cb-lightbox .lb-next { right: 8px; }
}
