/* Shop, rug page and rug care screens */

@property --k { syntax: '<length>'; inherits: false; initial-value: 8px; }
@property --rows { syntax: '<percentage>'; inherits: false; initial-value: 100%; }

.crumbs { font-size: 13px; color: var(--ink-3); }
.crumbs a { color: inherit; text-decoration: none; }
@media (hover: hover) { .crumbs a:hover { color: var(--ink); } }

/* ================= SHOP ================= */
.shop { padding: calc(var(--hdr) + 5vh) var(--gutter) 12vh; }
.shop-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 28px; margin-bottom: 3vh; }
.shop-head .crumbs { grid-column: 1 / -1; }
.shop-title { font: 400 clamp(44px, 6.4vw, 104px)/.95 var(--serif); letter-spacing: -.03em; }
.shop-title em { color: var(--lapis); }
.count-num { font-variant-numeric: tabular-nums lining-nums; }
.sr-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 18px; width: min(340px, 100%);
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); transition: border-color .25s, box-shadow .25s;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px var(--lapis-soft); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 16px var(--sans); outline: none; }   /* 16px: iPhones zoom in on smaller text fields */

.filters {
  position: sticky; top: var(--hdr); z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 12px 0; margin-bottom: 30px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
  transition: top .5s var(--silk);
}
.hdr-off .filters { top: 0; }   /* the header slid away: the bar moves up with it, nothing shows above it */
.filters-more { display: none; }
.filters-extra { display: contents; }
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-2); }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; padding: 0 14px; min-height: 36px; border-radius: 999px;
  font: 700 13px/1 var(--sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: color .35s;
}
.seg button[aria-checked='true'] { color: var(--bg); }
.seg .pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 999px; background: var(--ink); transition: left .55s var(--silk), width .55s var(--silk); }
.swatches { display: flex; gap: 7px; }
.sw {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--surface); padding: 0; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-2); transition: transform .35s var(--spring), box-shadow .25s;
}
@media (hover: hover) { .sw:hover { transform: scale(1.12); } }
.sw[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.12); }
.filters-end { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sort { min-height: 44px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 0 14px; font: 700 13px var(--sans); cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 40px 22px; }
.card { position: relative; transition: opacity .5s; }
.card-media {
  --rx: 0deg; --ry: 0deg; --sx: -120%;
  position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--bg-2);
  transform: perspective(900px) rotateX(var(--ry)) rotateY(var(--rx)); box-shadow: var(--shadow);
  transition: transform .7s var(--silk), box-shadow .7s var(--silk);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--silk); }
@media (hover: hover) { .card:hover .card-media { box-shadow: var(--shadow-lg); } }
@media (hover: hover) { .card:hover .card-media img { transform: scale(1.05); } }
.card .sheen { background-position: var(--sx) 0; transition: background-position .25s linear; }
.card-media.knot img {        /* the photo weaves itself in, row by row, from the bottom */
  -webkit-mask: radial-gradient(circle, #000 var(--k), transparent calc(var(--k) + .8px)) 0 0 / 9px 9px, linear-gradient(#000 0 0) 50% 100% / 100% var(--rows) no-repeat;
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle, #000 var(--k), transparent calc(var(--k) + .8px)) 0 0 / 9px 9px, linear-gradient(#000 0 0) 50% 100% / 100% var(--rows) no-repeat;
  mask-composite: intersect;
  animation: knot-in 1.5s steps(28, end) both; animation-delay: var(--kd, 0ms);
}
@keyframes knot-in { 0% { --rows: 0%; --k: 1.7px; } 64% { --rows: 100%; --k: 2.4px; } 100% { --rows: 100%; --k: 8px; } }
.card-info { display: grid; gap: 2px; padding-top: 14px; }
.card h3 { font: 500 21px/1.15 var(--serif); }
.card h3 a { text-decoration: none; }
.card p { color: var(--ink-3); font-size: 13.5px; }
.card .price { color: var(--ink); font: 700 14.5px/1.5 var(--sans); }
.badge {
  position: absolute; left: 10px; top: 10px; z-index: 2; padding: 6px 10px; border-radius: 999px;
  font: 800 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fav {
  position: absolute; right: 10px; top: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: transform .4s var(--spring);
}
.fav svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; transition: fill .3s, stroke .3s; }
@media (hover: hover) { .fav:hover { transform: scale(1.1); } }
.card-room {
  position: absolute; right: 10px; top: 58px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink); background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(-6px); transition: opacity .35s, transform .45s var(--spring), background-color .25s;
}
.card-room:focus-visible { opacity: 1; transform: none; }
@media (hover: hover) { .card:hover .card-room { opacity: 1; transform: none; } }
@media (hover: hover) { .card-room:hover { background: var(--saffron); color: #1b1407; } }
.grid-wrap.is-floor .card-room { display: none; }
.fav[aria-pressed='true'] svg { fill: var(--madder); stroke: var(--madder); }
.fav[aria-pressed='true'] { animation: pop .5s var(--spring); }

/* filtering: rugs roll up and away, the rest slide into place */
.card.is-leaving { pointer-events: none; }
.card.is-leaving .card-media { transform-origin: 50% 0; animation: roll-up .5s var(--silk) forwards; }
.card.is-leaving .card-info { opacity: 0; transition: opacity .2s; }
@keyframes roll-up { to { transform: scaleY(.02); filter: brightness(.5); border-radius: 40px; } }
.card.is-entering .card-media { transform-origin: 50% 0; animation: roll-down .7s var(--silk) both; }
@keyframes roll-down { from { transform: scaleY(.02); filter: brightness(.5); border-radius: 40px; } }
.empty { padding: 60px 0; text-align: center; color: var(--ink-3); font-size: 18px; }

/* the showroom floor: walk over the rugs */
.grid-wrap.is-floor { position: relative; height: var(--fh, 300vh); }
.floor-cam { position: relative; }
.grid-wrap.is-floor .floor-cam {
  position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); height: calc(100svh - var(--hdr)); overflow: hidden; transition: top .5s var(--silk);
  perspective: 1000px; perspective-origin: 50% -10%;
  background: radial-gradient(120% 70% at 50% 110%, var(--bg-2), var(--bg) 70%);
  border-radius: 28px;
}
.grid-wrap.is-floor .grid {
  position: absolute; left: 6%; right: 6%; bottom: 4%; gap: 56px 44px;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  transform-origin: 50% 100%; transform: rotateX(62deg) translateY(calc(var(--walk, 0) * 1px)); transform-style: preserve-3d;
}
.grid-wrap.is-floor .card { transform-style: preserve-3d; }
.grid-wrap.is-floor .card-info, .grid-wrap.is-floor .fav, .grid-wrap.is-floor .badge { display: none; }
.grid-wrap.is-floor .card-media { transform: none; border-radius: 4px; box-shadow: 0 30px 40px -20px rgba(22, 25, 43, .55); transition: transform .6s var(--silk); }
@media (hover: hover) { .grid-wrap.is-floor .card:hover .card-media { transform: translateZ(46px); box-shadow: 0 60px 60px -30px rgba(22, 25, 43, .6); } }
.floor-label {
  position: absolute; left: 50%; bottom: 100%; translate: -50% 0; padding: 10px 14px; border-radius: 12px; white-space: nowrap;
  background: var(--ink); color: var(--bg); font: 600 13px/1.3 var(--sans); pointer-events: none;
  transform-origin: 50% 100%; transform: rotateX(-62deg) translateY(-30px); opacity: 0; transition: opacity .3s;
}
.floor-label b { display: block; font: 500 18px/1.1 var(--serif); }
@media (hover: hover) { .grid-wrap.is-floor .card:hover .floor-label { opacity: 1; } }
.grid-wrap:not(.is-floor) .floor-label { display: none; }
.floor-hint { position: absolute; z-index: 3; left: 50%; top: 18px; translate: -50% 0; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font: 700 12px var(--sans); color: var(--ink-2); }

/* ================= RUG PAGE ================= */
.rug {
  display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .72fr); gap: clamp(26px, 4vw, 64px);
  padding: calc(var(--hdr) + 3vh) var(--gutter) 8vh; align-items: start;
}
.stage {
  position: sticky; top: calc(var(--hdr) + 14px); height: calc(100vh - var(--hdr) - 40px); height: calc(100svh - var(--hdr) - 40px); min-height: 520px;
  border-radius: 26px; overflow: hidden; isolation: isolate;
  background: radial-gradient(80% 60% at 50% 40%, var(--surface), var(--bg-2));
}
.stage-view { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s var(--silk), visibility 0s .6s; }
.stage[data-mode='photo'] .stage-photo, .stage[data-mode='fly'] .stage-fly,
.stage[data-mode='floor'] .stage-floor, .stage[data-mode='weave'] .stage-weave { opacity: 1; visibility: visible; transition-delay: 0s; }
.stage-photo { display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.stage-photo img {
  height: 88%; width: auto; max-width: 90%; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow-lg);
  transform-origin: var(--zx, 50%) var(--zy, 50%); transition: transform .6s var(--silk); view-transition-name: rug-hero;
}
.stage-photo.is-zoom { cursor: zoom-out; touch-action: none; }   /* zoomed: a finger drags the view, not the page */
.stage-photo.is-zoom img { transform: scale(2.6); }
.stage-cloth { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage-floor { overflow: hidden; background: #0c0e17; }
.stage-room { position: absolute; inset: 0; }
.stage-room > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.floor-cta { position: absolute; left: 16px; right: 16px; top: 16px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.floor-cta > * { pointer-events: auto; }
.floor-note { padding: 8px 12px; border-radius: 999px; background: rgba(12, 14, 24, .62); color: #fff; font: 700 12px/1 var(--sans); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.floor-open { min-height: 44px; background: #fbf8f3; color: #16192b; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.floor-open svg, .card-room svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stage-weave { display: grid; place-items: center; }
.weave-replay { position: relative; height: 86%; aspect-ratio: 3 / 4; max-width: 90%; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); background: #1d1712; }
.weave-replay img { width: 100%; height: 100%; object-fit: cover; }
.weave-replay.run img {
  -webkit-mask: radial-gradient(circle, #000 var(--k), transparent calc(var(--k) + .8px)) 0 0 / 11px 11px, linear-gradient(#000 0 0) 50% 100% / 100% var(--rows) no-repeat;
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle, #000 var(--k), transparent calc(var(--k) + .8px)) 0 0 / 11px 11px, linear-gradient(#000 0 0) 50% 100% / 100% var(--rows) no-repeat;
  mask-composite: intersect;
  animation: knot-in-big 4.6s steps(64, end) both;
}
@keyframes knot-in-big { 0% { --rows: 0%; --k: 4.2px; } 70% { --rows: 100%; --k: 4.8px; } 100% { --rows: 100%; --k: 9px; } }
.weave-replay.done img { -webkit-mask: none; mask: none; }
.weave-replay.done .weave-warps { opacity: 0; transition: none; }
.weave-warps { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(240, 228, 205, .5) 0 1px, transparent 1px 11px); pointer-events: none; opacity: 1; transition: opacity .8s 3.2s; }
.weave-replay.run .weave-warps { opacity: 0; }
.weave-row { position: absolute; left: 50%; top: 18px; translate: -50% 0; padding: 7px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font: 700 12px var(--sans); font-variant-numeric: tabular-nums; }
.stage-modes {
  position: absolute; z-index: 5; left: 50%; bottom: 16px; translate: -50% 0; display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.stage-modes button { border: 0; background: none; min-height: 38px; padding: 0 14px; border-radius: 999px; font: 700 13px var(--sans); cursor: pointer; color: var(--ink-2); white-space: nowrap; transition: background-color .3s, color .3s; }
.stage-modes button[aria-selected='true'] { background: var(--ink); color: var(--bg); }
.stage-modes button[hidden] { display: none; }
.stage-hint { position: absolute; z-index: 5; right: 18px; top: 16px; font: 600 12px var(--sans); color: var(--ink-3); }
.stage[data-mode='floor'] .stage-hint, .stage[data-mode='weave'] .stage-hint { display: none; }

.rug-info { display: grid; gap: 16px; padding-top: 1vh; }
.rug-name { font: 400 clamp(44px, 4.8vw, 80px)/.96 var(--serif); letter-spacing: -.03em; }
.rug-style { color: var(--ink-3); font-size: 16px; margin-top: -6px; }
.rug-price { font: 500 32px/1 var(--serif); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.facts span { font: 700 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.facts b { font: 600 15px/1.3 var(--sans); }
/* held up next to a 1.75 m person: both drawn to one scale (--s px per cm), standing on one floor line */
.size-bar { --fr: max(3px, calc(var(--s) * 7px)); position: relative; height: 176px; border-radius: 14px; background: var(--bg-2); overflow: hidden; }
.size-bar::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 20px; height: 1px; background: var(--line-2); }
.size-lbl { position: absolute; left: 16px; top: 13px; font: 600 12px/1.3 var(--sans); color: var(--ink-3); }
.size-fig { position: absolute; left: 0; right: 0; bottom: 21px; display: flex; align-items: flex-end; justify-content: center; }
.size-person { flex: none; width: calc(var(--s) * 50px); height: calc(var(--s) * 175px); color: var(--ink-2); overflow: visible; }
/* the rug stands on its fringe, one hand of the person against its side */
.size-rug { position: relative; flex: none; margin: 0 0 var(--fr) calc(var(--s) * 1px); width: calc(var(--s) * var(--rw) * 1px); height: calc(var(--s) * var(--rl) * 1px); }
.size-pic { position: absolute; inset: 0; overflow: hidden; border-radius: 1.5px; background: var(--rc, var(--bg)); box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 16px -8px rgba(0, 0, 0, .45); }
.size-pic img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.32); }   /* a photo: its middle only, no floor round the rug */
.size-bar.is-flat .size-pic img { object-fit: fill; transform: none; }                    /* a flat picture: the whole rug */
.size-rug::before, .size-rug::after {   /* fringes on both ends */
  content: ''; position: absolute; left: 5%; right: 5%; height: var(--fr);
  background: repeating-linear-gradient(90deg, #e8dcc4 0 1px, transparent 1px 2.6px);
}
.size-rug::before { bottom: 100%; }
.size-rug::after { top: 100%; }
.size-bar.is-round .size-rug { margin-bottom: 0; }
.size-bar.is-round .size-rug::before, .size-bar.is-round .size-rug::after { display: none; }
.size-bar.is-round .size-pic { border-radius: 50%; background: transparent; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .45); }
.size-bar.is-round.is-flat .size-pic img { object-fit: contain; }
/* metre marks: a line with end ticks beside each, the height in metres next to it */
.size-dim { position: relative; flex: none; display: grid; align-items: center; width: 56px; font: 700 12px/1.2 var(--sans); color: var(--ink-2); white-space: nowrap; }
.size-dim::before { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: .55; }
.size-dim::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; border-block: 1px solid color-mix(in srgb, var(--ink-3) 55%, transparent); }
.size-dim-person { height: calc(var(--s) * 175px); justify-items: end; padding-right: 13px; margin-right: 4px; }
.size-dim-person::before { right: 3px; }
.size-dim-person::after { right: 0; }
.size-dim-rug { height: calc(var(--s) * var(--rl) * 1px); justify-items: start; padding-left: 13px; margin: 0 0 var(--fr) 8px; }
.size-dim-rug::before { left: 3px; }
.size-dim-rug::after { left: 0; }
.size-bar.is-round .size-dim-rug { margin-bottom: 0; }
.one-only { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.one-only i { width: 8px; height: 8px; border-radius: 50%; background: var(--madder); animation: blink 1.8s ease-in-out infinite; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.promises li { display: grid; gap: 2px; }
.promises b { font-size: 15px; }
.promises span { color: var(--ink-3); font-size: 14px; }
.rug-story { font: italic 400 21px/1.45 var(--serif); color: var(--ink-2); border-left: 2px solid var(--saffron); padding-left: 16px; }
.add-bag.is-added { background: var(--turq); }

.more { padding: 4vh var(--gutter) 14vh; }
.more-title { font: 400 clamp(32px, 3.4vw, 48px)/1 var(--serif); margin-bottom: 26px; }
.more-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; }
.more-row .card { scroll-snap-align: start; }

/* ================= RUG CARE ================= */
.care-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 5vw; padding: calc(var(--hdr) + 6vh) var(--gutter) 6vh; }
.care-hero-copy { display: grid; gap: 22px; justify-items: start; }
.care-title { font: 400 clamp(46px, 6vw, 98px)/.95 var(--serif); letter-spacing: -.03em; }
.care-title em { color: var(--lapis); }
.wash { position: relative; height: min(66vh, 640px); perspective: 1200px; overflow: clip; }
.wash-rug { position: absolute; left: 50%; top: 50%; width: min(70%, 380px); aspect-ratio: 690 / 1050; translate: -50% -50%; transform: rotateX(50deg) rotateZ(-14deg); transform-style: preserve-3d; filter: drop-shadow(0 40px 30px rgba(22, 25, 43, .35)); }
.wash-rug img { width: 100%; height: 100%; border-radius: 3px; filter: url(#ripple); }
.wash-water { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(115deg, transparent 25%, rgba(140, 200, 255, .55) 45%, rgba(255, 255, 255, .7) 50%, rgba(140, 200, 255, .5) 55%, transparent 75%) -100% 0 / 200% 100% no-repeat; mix-blend-mode: screen; animation: water 3.4s var(--silk) infinite; }
.wash-bubbles { position: absolute; inset: -10%; background:
  radial-gradient(circle, rgba(255, 255, 255, .9) 0 3px, transparent 4px) 10% 20% / 90px 110px,
  radial-gradient(circle, rgba(255, 255, 255, .75) 0 2px, transparent 3px) 60% 70% / 70px 80px;
  animation: bubbles 6s linear infinite; opacity: .7; mix-blend-mode: screen; }
@keyframes bubbles { to { background-position: 10% -200%, 60% -150%; } }
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 2vh var(--gutter) 8vh; }
.svc { display: grid; gap: 10px; align-content: start; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); transition: transform .6s var(--silk), box-shadow .6s; }
@media (hover: hover) { .svc:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); } }
.svc h3 { font: 500 27px/1.1 var(--serif); }
.svc p { color: var(--ink-2); font-size: 15px; }
.svc .from { color: var(--lapis); font: 700 14px var(--sans); }
.svc-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--lapis-soft); color: var(--lapis); }
.svc-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.book {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4vw; margin: 0 var(--gutter) 14vh;
  padding: clamp(22px, 4vw, 56px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line);
}
.book-head { display: grid; gap: 28px; align-content: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-weight: 700; }
.steps li::before {
  counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); font-size: 13px; transition: background-color .4s, color .4s, border-color .4s;
}
.steps li.is-on { color: var(--ink); }
.steps li.is-on::before { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.steps li.is-done::before { content: '✓'; background: var(--saffron); border-color: var(--saffron); color: #1b1407; }
.book-form { display: grid; }
.bstep { border: 0; padding: 0; margin: 0; min-width: 0; display: none; gap: 16px; }
.bstep.is-on { display: grid; animation: rise-in .6s var(--silk); }
.bstep legend { font: 400 32px/1.1 var(--serif); padding: 0; margin-bottom: 6px; }
.book-form label { display: grid; gap: 6px; font: 700 13px var(--sans); color: var(--ink-2); }
.book-form input[type='number'], .book-form input[type='text'] {
  min-height: 50px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); padding: 0 14px; font: 500 16px var(--sans);
}
.book-form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--lapis-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kind-pick, .svc-pick, .days { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-pick label, .svc-pick label, .days label { display: block; cursor: pointer; }
.kind-pick input, .svc-pick input, .days input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick span, .svc-pick span, .days span {
  display: grid; gap: 2px; min-height: 44px; align-content: center; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line-2);
  font: 700 14px var(--sans); color: var(--ink); transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--spring);
}
.svc-pick span small, .days span small { font: 600 12px var(--sans); color: var(--ink-3); }
.kind-pick input:checked + span, .svc-pick input:checked + span, .days input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: scale(1.03); }
.svc-pick input:checked + span small, .days input:checked + span small { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.kind-pick input:focus-visible + span, .svc-pick input:focus-visible + span, .days input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: 2px; }
.days span { text-align: center; min-width: 74px; }
.mini-rug { position: relative; height: 150px; display: grid; place-items: center; border-radius: 16px; background: var(--bg-2); }
.mini-rug span { width: var(--mw, 80px); height: var(--ml, 120px); background: var(--hero-img, none) center / cover; border-radius: 2px; box-shadow: var(--shadow); transition: width .7s var(--spring), height .7s var(--spring); }
.mini-rug b { position: absolute; right: 12px; bottom: 10px; font: 700 12px var(--sans); color: var(--ink-3); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; margin: 0; }
.summary dt { color: var(--ink-3); font-weight: 700; font-size: 13px; }
.summary dd { margin: 0; font-weight: 600; }
.hint { color: var(--ink-3); font-size: 14px; }
.book-bar { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.quote { margin-right: auto; display: grid; gap: 4px; }
.quote span { font: 700 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.quote-num { font: 500 32px/1 var(--serif); font-variant-numeric: tabular-nums; }
.booked { display: grid; gap: 12px; justify-items: start; animation: rise-in .7s var(--silk); }
.booked h3 { font: 400 36px/1.05 var(--serif); }

/* ================= PHONES ================= */
@media (max-width: 960px) {
  .shop-head { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .filters { gap: 10px; }
  .filters .cats { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .rug { grid-template-columns: 1fr; padding-top: calc(var(--hdr) + 12px); }
  .stage { position: relative; top: 0; height: 72svh; min-height: 440px; border-radius: 20px; }
  .care-hero { grid-template-columns: 1fr; }
  .wash { height: 46vh; }
  .services { grid-template-columns: 1fr; }
  .book { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
  .card h3 { font-size: 17px; }
  .card p { font-size: 12.5px; }
  .fav { width: 44px; height: 44px; right: 6px; top: 6px; }
  .card-room { width: 44px; height: 44px; right: 6px; top: 56px; }
  .badge { display: none; }
  .seg button { padding: 0 11px; font-size: 12.5px; }
  .swatches { overflow-x: auto; max-width: 100%; padding: 3px; }
  .stage-modes { left: 10px; right: 10px; translate: none; justify-content: space-between; }
  .stage-modes button { padding: 0 8px; font-size: 12px; flex: 1; }
  .stage-hint { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .book { margin: 0 12px 10vh; padding: 20px 16px; }
  .book-bar { flex-wrap: wrap; }
  .quote { width: 100%; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .grid-wrap.is-floor .grid { left: 2%; right: 2%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
}
@media (hover: none) {
  .fav { opacity: 1; }
  .card-room { opacity: 1; transform: none; }
}
.hdr-off .grid-wrap.is-floor .floor-cam { top: 0; }
@media (min-width: 961px) {
  .stage { transition: top .5s var(--silk); }
  .hdr-off .stage { top: 14px; }   /* the pinned picture follows the header up */
}

/* ---------- phones (and phones on their side): the shop's bar that stays on screen is one row ---------- */
@media (max-width: 640px), (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .filters { flex-wrap: nowrap; gap: 8px; padding: 8px 0; margin-bottom: 22px; }
  .filters.is-open { flex-wrap: wrap; }
  .filters .cats { flex: 1 1 0; min-width: 0; }   /* the kinds scroll sideways beside the button, open or not */
  .filters-more {
    position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--surface); color: var(--ink); font: 700 13px/1 var(--sans); cursor: pointer;
  }
  .filters-more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .filters-more span { display: none; }
  .filters-more[aria-expanded='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .filters-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--madder); box-shadow: 0 0 0 2px var(--surface); }
  .filters-extra { display: none; }
  .filters.is-open .filters-extra { display: grid; gap: 10px; flex: 1 1 100%; min-width: 0; padding-top: 2px; animation: rise-in .4s var(--silk); }
  .filters-extra .swatches { max-width: 100%; }
  .filters-extra .filters-end { width: 100%; justify-content: space-between; margin: 0; }
}
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .filters-more span { display: inline; }
  .filters.is-open .filters-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
  .filters-extra .filters-end { width: auto; margin-left: auto; }
  /* the rug page: the picture stays on the left while the words scroll on the right */
  .rug { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px; padding-top: calc(var(--hdr) + 8px); }
  .stage { position: sticky; top: calc(var(--hdr) + 8px); height: calc(100svh - var(--hdr) - 16px); min-height: 0; border-radius: 18px; }
  .hdr-off .stage { top: 8px; }
  .rug-name { font-size: 40px; }
  /* care: the washing rug and the words side by side */
  .care-hero { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); padding-top: calc(var(--hdr) + 3vh); }
  .wash { height: 70vh; }
}

/* phones held upright: the rug's name and price show under the picture without scrolling */
@media (max-width: 960px) and (min-height: 501px), (max-width: 960px) and (orientation: portrait) {
  .stage { height: 60svh; min-height: 360px; }
}
@media (max-width: 640px) {
  /* the four booking steps as a 2 × 2 grid instead of a tall list */
  .book-head { gap: 18px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .steps li { gap: 8px; font-size: 14px; }
  .steps li::before { width: 28px; height: 28px; font-size: 12px; }
}

/* touch screens: 44 px targets */
@media (pointer: coarse) {
  .seg button { min-height: 44px; }
  .stage-modes button { min-height: 44px; }
  .sort { font-size: 16px; }                          /* iPhones zoom in on a smaller select */
  .fav, .card-room { width: 44px; height: 44px; }
  .card-room { top: 58px; }
  .swatches { gap: 10px; padding: 7px 5px; }
  .sw { position: relative; width: 34px; height: 34px; flex: none; }
  .sw::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; }   /* 48 px under the finger */
  /* the rug's name, style and price under a card all open the rug */
  .card-info { position: relative; }
  .card h3 a::after { content: ''; position: absolute; inset: -6px 0; }
}
/* the showroom floor takes the whole screen under the header: the filter bar scrolls away instead of covering it */
.shop:has(.grid-wrap.is-floor) .filters { position: relative; top: 0; }
@media (pointer: coarse) { .seg button { min-width: 44px; flex: none; } }   /* never squeezed: the row scrolls sideways instead */
