/* Favourites, colour swatches, instant search, product tools, sticky buy bar, size guide */

/* ------------------------------------------------------------ favourites --- */
.card-wrap { position: relative; }
.fav { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); transition: transform .2s, color .2s, background .2s; }
.fav .ic { width: 18px; height: 18px; }
.fav:hover { transform: scale(1.08); background: #fff; }
.fav.on { color: var(--sale); }
.fav.on .ic { fill: currentColor; }
.fav.pop { animation: fav-pop .35s ease; }
@keyframes fav-pop { 40% { transform: scale(1.3); } }
.fav.big { position: static; width: 44px; height: 44px; box-shadow: none; border: 1px solid var(--line); }
.fav.big .ic { width: 20px; height: 20px; }
.fav-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.page-pad-sm { padding-top: 32px; padding-bottom: 72px; }
.empty-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--accent); margin-bottom: 12px; }
.empty-ic .ic { width: 28px; height: 28px; }

/* --------------------------------------------------------------- colours --- */
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch.any { background: conic-gradient(#a3262b, #d4a017, #4f7a4a, #27406b, #6b3a6e, #a3262b); opacity: .35; }
.with-swatch { display: flex !important; align-items: center; gap: 9px; }
.mega-sub { margin-top: 18px; }
.mega-col a .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* shop filter chips */
/* fieldsets default to min-width:min-content, which pushed the phone filter panel wider than the screen */
.chips { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; grid-column: 1 / -1; }
.filter-form > * { min-width: 0; }
.chips legend { font-size: .82rem; font-weight: 500; margin-bottom: 8px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .8rem; cursor: pointer; transition: border-color .15s, background .15s; }
/* the real radio stays in the chip but takes no space (the generic ".fld input {width:100%}" made it screen-wide) */
.chip { position: relative; }
.chip input, .fld .chip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; margin: 0; }
.chip small { color: var(--muted); }
.chip:hover { border-color: var(--ink); }
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip.on small { color: rgba(255, 255, 255, .7); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* home: shop by colour */
/* one even row on desktop (never a lonely tile on a second line); a swipeable strip on smaller screens */
.colour-row { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 12px; }
.colour-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: center; transition: border-color .2s, transform .2s, box-shadow .2s; }
.colour-tile .swatch { width: 52px; height: 52px; }
.colour-tile span { font-weight: 500; font-size: .9rem; line-height: 1.25; }
.colour-tile small { color: var(--muted); font-size: .78rem; }
.colour-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.colour-tile span { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .colour-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
  .colour-tile { scroll-snap-align: start; }
}
@media (max-width: 560px) { .colour-row { grid-auto-columns: 96px; gap: 10px; } .colour-tile .swatch { width: 40px; height: 40px; } }

/* ---------------------------------------------------------------- search --- */
.search-in { position: relative; }
.search-suggest { position: absolute; left: 16px; right: 16px; top: calc(100% + 8px); z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: min(70vh, 520px); overflow-y: auto; }
@media (min-width: 720px) { .search-suggest { left: 32px; right: auto; width: min(560px, calc(100% - 64px)); } }
.suggest-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; }
.suggest-item:hover, .suggest-item:focus-visible { background: var(--soft); }
.suggest-img { width: 48px; height: 58px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.suggest-item strong { display: block; font-weight: 500; font-size: .92rem; }
.suggest-item small { color: var(--muted); font-size: .8rem; }
.suggest-price { font-weight: 600; font-size: .9rem; }
.suggest-all { display: flex; align-items: center; gap: 4px; padding: 12px 10px 8px; color: var(--accent); font-weight: 500; font-size: .9rem; border-top: 1px solid var(--line); margin-top: 4px; }
.suggest-all .ic { width: 16px; height: 16px; }
.suggest-none { margin: 0; padding: 14px 12px; color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------- product page --- */
.pd-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pd-tools { display: flex; gap: 8px; flex: none; padding-top: 4px; }
.pd-share { border: 1px solid var(--line); width: 44px; height: 44px; }
.pd-colours { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; background: #fff; transition: border-color .15s; }
.tag:hover { border-color: var(--ink); }
.tag .swatch { width: 16px; height: 16px; }
.pd-info .note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.pd-info .note .ic { color: var(--accent); margin-top: 1px; }
.sizes legend { display: flex; gap: 12px; align-items: baseline; }

/* phones: slim "Add to bag" bar once the main button has scrolled away */
.buy-bar { display: none; }
@media (max-width: 860px) {
  .buy-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(250, 247, 242, .97); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .25s ease; }
  .buy-bar.show { transform: none; }
  .buy-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .buy-bar-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .buy-bar-txt strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bar-txt span { font-weight: 600; }
  .buy-bar .btn { padding: 11px 22px; flex: none; }
  body.has-buy-bar .wa-float { bottom: 86px; }
}

/* ------------------------------------------------------------ size guide --- */
.size-guide { display: grid; grid-template-columns: 380px 1fr; gap: 40px; padding-top: 40px; padding-bottom: 80px; align-items: start; }
.calc { position: sticky; top: 96px; }
.calc h3, .guide-card h3 { display: flex; align-items: center; gap: 10px; }
.calc h3 .ic, .guide-card h3 .ic { color: var(--accent); width: 24px; height: 24px; }
.calc-out { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.calc-label { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.calc-size { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; margin: 2px 0 14px; line-height: 1.1; }
.calc-plan { margin-bottom: 14px; }
.calc-room { position: relative; width: 100%; max-height: 220px; border: 2px dashed #c9bba8; border-radius: 6px; background: var(--soft); display: grid; place-items: center; }
.calc-rug { border-radius: 3px; background: repeating-linear-gradient(45deg, var(--accent) 0 6px, #b8693f 6px 12px); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.guide-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.guide-card ul { margin: 0; padding-left: 18px; color: var(--muted); }
.guide-card li { margin-bottom: 8px; }
.guide-card.tips { grid-column: 1 / -1; background: var(--soft); border-color: transparent; }
.guide-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 960px) { .size-guide { grid-template-columns: 1fr; } .calc { position: static; } }
@media (max-width: 640px) { .guide { grid-template-columns: 1fr; } }
