/* McDermott's range cards. Loaded by the McDermott's Range Cards plugin on pages using [sofa_ranges]. */

.range-card{
  --range-amber:#d9933d; --range-amber-deep:#a96d1c; --range-green:#4f8a4b; --range-ink:#222; --range-muted:#6b6560; --range-cream:#eee5d8; --range-chip:#f5f0e8;
  position:relative; display:flex; flex-direction:column; height:100%; background:#fff; border-radius:10px;
  font-family:"Lato",sans-serif; color:var(--range-ink);
  box-shadow:0 1px 2px rgba(0,0,0,.06),0 4px 14px rgba(0,0,0,.05);
  transition:box-shadow .25s ease,transform .25s ease;
}
.range-card *{box-sizing:border-box}
.range-card:hover{box-shadow:0 2px 4px rgba(0,0,0,.08),0 12px 28px rgba(0,0,0,.10); transform:translateY(-2px)}
.range-card:has(.range-card__link:focus-visible){outline:3px solid var(--range-amber); outline-offset:3px}

/* The range link sits on the name, and stretches over the whole card so any tap goes to the range page.
   The "more" pill sits above it, so tapping the pill doesn't follow the link. */
.range-card__link{color:inherit!important; text-decoration:none!important; outline:none}
.range-card__link::after{content:""; position:absolute; inset:0; z-index:1; border-radius:10px}

.range-card__media{position:relative; aspect-ratio:4/3; overflow:hidden; border-radius:10px 10px 0 0; background:var(--range-cream)}
.range-card__media img{width:100%; height:100%; object-fit:cover; display:block; margin:0; transition:transform .6s ease}
.range-card:hover .range-card__media img{transform:scale(1.04)}

.range-card__badges{position:absolute; top:14px; left:14px; display:flex; flex-direction:column; align-items:flex-start; gap:6px}
.range-badge{display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; line-height:1; color:#fff; box-shadow:0 2px 6px rgba(0,0,0,.15)}
.range-badge svg{width:14px; height:14px; flex:none}
.range-badge--new{background:var(--range-amber)}
.range-badge--online{background:var(--range-green)}
.range-badge--bestseller{background:var(--range-ink)}

/* One even gap between every line: name, description, chips, divider */
.range-card__body{display:flex; flex-direction:column; gap:12px; padding:16px 20px; flex:1}
/* Name row: range name, then New / Buy online straight after it, centred on the name */
/* Badges sit straight after the name; only if the card is too narrow for both do they drop underneath, so the name is never cut off */
.range-card__head{display:flex; flex-wrap:wrap; align-items:center; column-gap:12px; row-gap:6px; min-width:0}
.range-card__head .range-badge{flex:none; box-shadow:none}
.range-card__tags{display:flex; flex-wrap:nowrap; align-items:center; gap:6px; flex:none}
/* Two badges side by side: tighten them so long names aren't cut off */
.range-card__tags:has(.range-badge + .range-badge) .range-badge{padding:5px 8px; font-size:11px; letter-spacing:.04em; gap:4px}
.range-card__tags:has(.range-badge + .range-badge) .range-badge svg{display:none}
.range-card__name{margin:0!important; padding:0; font-family:"Lato",sans-serif; font-size:22px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--range-ink); line-height:1.2; width:auto!important; flex:0 0 auto; white-space:nowrap}
/* Flatsome sets headings to width:100%, which pushed the badges to the far right. width:auto above stops that. */
.range-card__meta{margin:0!important; font-size:14px; color:var(--range-muted); line-height:1.4; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden}

/* Pieces the range comes in */
.range-card__items{display:flex; flex-wrap:wrap; align-content:flex-start; gap:6px; margin:0!important; padding:0!important; list-style:none!important}
.range-card__items li{position:relative; margin:0!important; padding:5px 10px; border-radius:999px; background:var(--range-chip); color:#4a443e; font-size:12px; font-weight:700; line-height:1; list-style:none!important}

/* "More" pill. <details> handles the tap-to-open, no JavaScript needed. */
.range-card__items li.range-more{z-index:2; padding:0; background:none}
.range-more details{margin:0; padding:0}
.range-more summary{
  display:flex; width:max-content; align-items:center; gap:4px; padding:5px 8px 5px 10px; border-radius:999px;
  box-shadow:inset 0 0 0 1px #d9d1c4; color:var(--range-muted); font-size:12px; font-weight:700; line-height:1;
  list-style:none; cursor:pointer; user-select:none; -webkit-tap-highlight-color:transparent;
}
.range-more summary::-webkit-details-marker{display:none}
.range-more summary svg{width:12px; height:12px; transition:transform .2s ease}
.range-more summary:focus-visible{outline:2px solid var(--range-amber); outline-offset:2px}

.range-more__list{display:none; font-size:12px; font-weight:400; line-height:1.5; text-transform:capitalize}
/* Each piece is its own <span>, so "Accent Chair" never splits across two lines. Commas are added here. */
.range-more__list span{white-space:nowrap}
.range-more__list span:not(:last-child)::after{content:","}

/* Mouse: same amber pill and chevron as mobile. Click opens the list as a panel
   over the bottom of the photo, so the name, description, chips and Explore all stay visible
   and the card doesn't change height. */
@media (hover:hover){
  .range-card__body:has(details[open]){position:relative}
  .range-card__items li.range-more{position:static}
  .range-more summary{position:relative; z-index:2; box-shadow:inset 0 0 0 1px var(--range-amber); color:var(--range-amber-deep); background:#fff; transition:background .15s ease}
  .range-more summary:hover{background:var(--range-chip)}
  .range-more:has(details[open]) summary svg{transform:rotate(180deg)}
  .range-more:has(details[open]) .range-more__list{
    display:block; position:absolute; bottom:calc(100% + 14px); left:20px; right:20px; z-index:3;
    padding:12px 14px; border-radius:8px; background:rgba(255,255,255,.96); color:#4a443e;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
  }
}

/* Touch: the pill looks like a button, and tapping it opens the list inside the card */
@media (hover:none){
  .range-more summary{box-shadow:inset 0 0 0 1px var(--range-amber); color:var(--range-amber-deep); background:#fff}
  .range-more:has(details[open]){flex-basis:100%}
  .range-more:has(details[open]) summary svg{transform:rotate(180deg)}
  .range-more:has(details[open]) .range-more__list{display:block; margin-top:8px; padding:10px 12px; border-radius:8px; background:var(--range-chip); color:#4a443e}
}

/* Brand logo: white plate, top right of the photo */
.range-card__brand{position:absolute; top:20px; right:20px; display:flex; align-items:center; padding:7px 11px; border-radius:5px; background:rgba(255,255,255,.94); box-shadow:0 2px 6px rgba(0,0,0,.12)}
.range-card__brand img{display:block; width:auto!important; height:12px!important; max-width:72px; object-fit:contain; margin:0}
/* Square or stacked logos: add range-card__brand--square so they show bigger */
.range-card__brand--square{padding:6px}
.range-card__brand--square img{height:60px!important; max-width:60px}
/* Wide logos (e.g. Parker Knoll): add range-card__brand--wide */
.range-card__brand--wide{padding:9px 13px}
.range-card__brand--wide img{height:30px!important; max-width:150px}
/* Alexander & James and FAMA: use the wide plate, picked out by the logo file so pasted cards don't need editing */
.range-card__brand:has(img[src*="AJ-Trans"]),
.range-card__brand:has(img[src*="Fama-Sofas-at-McDermotts"]){padding:9px 13px}
.range-card__brand img[src*="AJ-Trans"],
.range-card__brand img[src*="Fama-Sofas-at-McDermotts"]{height:30px!important; max-width:150px!important}

.range-card__foot{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; column-gap:12px; row-gap:8px; margin-top:auto; padding-top:12px; border-top:1px solid #eee}

/* Colour swatches */
.range-swatches{display:inline-flex; align-items:center; gap:8px; font-size:13px; color:var(--range-muted); white-space:nowrap}
.range-swatches__dots{display:inline-flex}
.range-swatches__dots i{width:16px; height:16px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.12); margin-left:-5px}
.range-swatches__dots i:first-child{margin-left:0}

.range-card__cta{display:inline-flex; align-items:center; gap:6px; margin-left:auto; white-space:nowrap; font-size:13px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--range-ink)}
.range-card__cta svg{width:16px; height:16px; transition:transform .25s ease; color:var(--range-amber)}
.range-card:hover .range-card__cta svg{transform:translateX(4px)}

/* ---------- Brand card: same size as a range card, links to the brand's page ----------
   Set the brand colour on the card: <div class="range-card range-card--brand" style="--brand:#3c98a7"> */
.range-card--brand{background:var(--brand,#222); color:#fff}
.range-card--brand .range-card__media{display:flex; align-items:center; justify-content:center; background:transparent; border-bottom:1px solid rgba(255,255,255,.18)}
.range-card--brand .range-card__media img{width:auto!important; height:auto; max-width:62%; max-height:46%; object-fit:contain}
.range-card:hover.range-card--brand .range-card__media img{transform:scale(1.04)}
.range-card--brand .range-card__name,
.range-card--brand .range-card__link{color:#fff!important}
.range-card--brand .range-card__name{white-space:normal; text-transform:none; letter-spacing:0; font-size:21px; line-height:1.25}
.range-card--brand .range-card__meta{color:rgba(255,255,255,.85); -webkit-line-clamp:3}
.range-card--brand .range-card__foot{border-top-color:rgba(255,255,255,.22)}
.range-card--brand .range-card__cta{color:#fff; margin-left:0}
.range-card--brand .range-card__cta svg{color:#fff}
.range-card--brand .range-card__cta{white-space:normal}
/* Turns a dark logo on a transparent background white, for brands without a white logo file */
.range-card--brand .range-card__media img.is-white{filter:brightness(0) invert(1)}
.range-card__eyebrow{position:absolute; top:20px; left:20px; padding:6px 11px; border-radius:999px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.6); color:#fff; font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; line-height:1}
/* Category card (Corner sofas, Reclining sofas...): a brand card with a big title instead of a logo.
   <div class="range-card range-card--brand range-card--category"> */
.range-card--category{--brand:#2b2724}
.range-card__bigtitle{font-size:34px; font-weight:800; line-height:1.1; letter-spacing:.02em; text-transform:uppercase; text-align:center; color:#fff; padding:0 24px}
.range-card__bigtitle::after{content:""; display:block; width:48px; height:3px; margin:14px auto 0; background:var(--range-amber)}

/* Phones: brand and category cards shrink to roughly half height, so they read as signposts
   between the sofas rather than the end of the page */
@media (max-width:549px){
  .range-card--brand .range-card__media{aspect-ratio:auto; flex-direction:row-reverse; justify-content:space-between; align-items:center; gap:12px; padding:16px 16px 0; border-bottom:0; border-radius:0}
  .range-card--brand .range-card__eyebrow{position:static; flex:none}
  .range-card--brand .range-card__media img{max-width:45%!important; max-height:40px!important; height:40px!important; width:auto!important; object-fit:contain; object-position:left center}
  .range-card--brand .range-card__bigtitle{font-size:20px; padding:0; text-align:left}
  .range-card--brand .range-card__bigtitle::after{display:none}
  .range-card--brand .range-card__meta{-webkit-line-clamp:2; font-size:13.5px}
  .range-card--brand .range-card__name{font-size:18px}
}

/* Narrower cards: show 3 swatches instead of 5 so longer fabric labels still fit beside Explore */
@media (max-width:1199px){ .range-swatches__dots i:nth-child(n+5){display:none} }
/* Small laptops and tablets (narrow 3-up cards): drop the swatch dots and tighten the footer */
@media (min-width:550px) and (max-width:1099px){ .range-swatches__dots i{width:14px; height:14px; margin-left:-6px} .range-swatches__dots i:first-child{margin-left:0} .range-swatches{font-size:12px; gap:6px} .range-card__cta{font-size:12px; letter-spacing:.06em} .range-card__body{padding:16px} }

/* ---------- Photo gallery on a card (swipe on phones, arrows on desktop) ---------- */
.range-gal__track{position:relative; z-index:2; display:flex; height:100%; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scroll-snap-stop:always; overscroll-behavior-x:none!important; overscroll-behavior-y:auto!important; touch-action:pan-x pan-y; scrollbar-width:none; -webkit-overflow-scrolling:touch; background:var(--range-cream)}
.range-gal__track::-webkit-scrollbar{display:none}
.range-gal__track > a{flex:0 0 100%; height:100%; scroll-snap-align:start; scroll-snap-stop:always; display:block; overflow:hidden}
.range-gal__track img{width:100%; height:100%; object-fit:cover; display:block; -webkit-user-drag:none; user-select:none; pointer-events:none}
.range-gal .range-card__brand{z-index:3}
.range-gal__dots{position:absolute; left:0; right:0; bottom:10px; z-index:3; display:flex; justify-content:center; gap:6px; pointer-events:none}
.range-gal__dots i{width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,.55); box-shadow:0 1px 3px rgba(0,0,0,.25); transition:background .2s ease, transform .2s ease}
.range-gal__dots i.is-on{background:#fff; transform:scale(1.25)}
.range-gal__btn{position:absolute; top:50%; z-index:3; width:36px; height:36px; margin:-18px 0 0!important; padding:0!important; border:0; border-radius:50%; background:rgba(255,255,255,.92)!important; color:var(--range-ink)!important; box-shadow:0 2px 8px rgba(0,0,0,.18); display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0; transition:opacity .2s ease; min-height:0!important; line-height:1!important}
.range-gal__btn svg{width:18px; height:18px}
.range-gal__btn--prev{left:10px}
.range-gal__btn--next{right:10px}
.range-card:hover .range-gal__btn,.range-gal__btn:focus-visible{opacity:1}
.range-gal.is-first .range-gal__btn--prev,.range-gal.is-last .range-gal__btn--next{opacity:0!important; pointer-events:none}
@media (hover:none){ .range-gal__btn{display:none} .range-card:hover .range-card__media img{transform:none} }

/* wpautop safety net: WordPress can inject <br> and <p> into HTML element content */
.range-card br{display:none!important}
.range-card p:empty{display:none!important}
.range-card p:not([class]){display:contents}

/* UX Builder row: give the row the classes "range-row sofa-range" (or "range-row mattress-range") in Row > Advanced > Class */
.range-row > .col > .col-inner{height:100%}
.range-row > .col{padding-bottom:30px}

/* Phones: the row becomes a swipe strip with the next card peeking */
@media (max-width:549px){
  .row.range-row{flex-wrap:nowrap!important; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding-bottom:8px}
  .row.range-row::-webkit-scrollbar{display:none}
  .row.range-row > .col{flex:0 0 82%!important; max-width:82%!important; scroll-snap-align:start; padding-bottom:12px}
  .range-card:hover{transform:none}
  .range-card__name{font-size:19px}
  .range-card__body{padding:14px 16px}
  .range-card__head .range-badge{padding:4px 9px; font-size:11px; gap:5px}
  .range-card__head .range-badge svg{width:12px; height:12px}
  .range-card__brand{top:16px; right:16px}
  .range-swatches{font-size:12px; gap:6px}
  .range-swatches__dots i{width:13px; height:13px; margin-left:-6px; border-width:1.5px}
  .range-swatches{gap:5px}
  .range-swatches__dots i:nth-child(n+5){display:none}
  .range-card__foot{gap:8px}
  .range-card__cta{font-size:12px}
}
@media (prefers-reduced-motion:reduce){ .range-card,.range-card *{transition:none!important} }

/* ---------- Grid built by the [sofa_ranges] shortcode ---------- */
.range-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:30px; margin:0 0 40px}
.range-grid > .range-card{min-width:0}
@media (max-width:849px){ .range-grid{grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px} }
@media (max-width:549px){ .range-grid{grid-template-columns:minmax(0,1fr); gap:20px} }

/* "Accent chair available" tag on the photo (feature pages): bottom left, dots move right */
.range-card__avail{position:absolute; left:14px; bottom:12px; z-index:3; pointer-events:none; display:inline-flex; align-items:center; gap:5px; max-width:calc(100% - 90px); padding:6px 10px 6px 8px; border-radius:5px; background:rgba(255,255,255,.94); box-shadow:0 2px 6px rgba(0,0,0,.12); color:var(--range-ink); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.range-card__avail svg{width:12px; height:12px; flex:0 0 auto; color:var(--range-amber-deep)}
.range-card__media:has(.range-card__avail) .range-gal__dots{justify-content:flex-end; left:auto; right:14px; bottom:20px}

/* show="6": the rest stay hidden until "Show all" is pressed */
.range-grid--more:not(.is-open) > .is-more{display:none!important}
.range-showall{display:flex; justify-content:center; margin:-8px 0 48px}
.range-showall__btn{display:inline-flex; align-items:center; justify-content:center; min-height:48px; margin:0!important; padding:0 30px!important; border:0!important; border-radius:999px!important; background:#222!important; color:#fff!important; font-size:15px!important; font-weight:700!important; letter-spacing:.02em!important; text-transform:none!important; line-height:1.1!important; cursor:pointer; transition:background .15s ease}
.range-showall__btn:hover{background:#000!important}

/* heading="": a titled section around the grid (brand pages restyle it) */
.range-sec{scroll-margin-top:110px}
.range-sec__head{margin:0 0 22px}
.range-sec__row{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 14px}
.range-sec__title{margin:0!important; font-size:clamp(24px,3vw,34px); line-height:1.15}
.range-sec__count{font-size:13px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#8a8580}
.range-sec__sub{margin:6px 0 0!important; max-width:640px; color:#5d5654}

/* 2.6.0: the "Corner sofa available" style tag steps aside while the "+N more" panel is open over the photo */
@media (hover:hover){
  .range-card__avail{transition:opacity .15s ease}
  .range-card:has(.range-more details[open]) .range-card__avail{opacity:0}
}
/* 2.6.0: longer fabric labels ("Wide choice of fabrics & genuine leathers") wrap onto a second line beside Explore */
.range-swatches{white-space:normal; flex:1 1 0; min-width:0; line-height:1.3}
.range-swatches__dots{flex:0 0 auto}
.range-swatches__text{display:block}
/* Dots show whenever the card has room; only very narrow cards drop them, so the label never runs to 3 lines */
.range-card__foot{container-type:inline-size}
@container (max-width:215px){ .range-swatches__dots{display:none} }
.range-swatches__short{display:none}
@container (max-width:245px){ .range-swatches__full{display:none} .range-swatches__short{display:inline} }

/* Brand and category cards: long titles wrap inside the card instead of running off the edge */
.range-card--brand .range-card__head{min-width:0}
.range-card--brand .range-card__name{flex:1 1 100%; min-width:0; max-width:100%; white-space:normal!important; overflow-wrap:break-word}
.range-card__bigtitle{max-width:100%; overflow-wrap:break-word; hyphens:auto}
/* Long names and two badges: let them wrap inside the card instead of running off the edge */
.range-card__name{white-space:normal; flex:0 1 auto; min-width:0; overflow-wrap:break-word}
.range-card__tags{flex-wrap:wrap; flex:0 1 auto; min-width:0}

/* Shop category teaser: same look as the range cards and the "Where to see it" box */
.mcd-teaser{display:flex;align-items:center;justify-content:space-between;gap:16px 28px;margin:0 0 24px;padding:18px 22px;border-radius:8px;background:#fff;border:1px solid #eee5d8;box-shadow:0 1px 2px rgba(0,0,0,.06),0 4px 14px rgba(0,0,0,.05);color:#222!important;text-decoration:none!important;font-family:"Lato",sans-serif;transition:box-shadow .25s ease,transform .25s ease}
.mcd-teaser:hover{box-shadow:0 2px 4px rgba(0,0,0,.08),0 12px 28px rgba(0,0,0,.10);transform:translateY(-2px)}
.mcd-teaser:focus-visible{outline:3px solid #d9933d;outline-offset:3px}
.mcd-teaser__txt{display:grid;gap:3px;min-width:0}
.mcd-teaser__eyebrow{font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#d9933d}
.mcd-teaser__title{font-size:22px;font-weight:800;line-height:1.2;color:#222;letter-spacing:.01em}
.mcd-teaser__sub{font-size:14px;line-height:1.45;color:#6b6560}
.mcd-teaser__cta{display:inline-flex;align-items:center;gap:6px;flex:none;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#b4762a;white-space:nowrap}
.mcd-teaser__cta svg{width:16px;height:16px;fill:none;stroke:#d9933d;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.mcd-teaser:hover .mcd-teaser__cta svg{transform:translateY(4px)}
@media (max-width:599px){.mcd-teaser{flex-direction:column;align-items:stretch;gap:0;padding:16px 18px}.mcd-teaser__title{font-size:19px}.mcd-teaser__cta{margin-top:12px;padding-top:12px;border-top:1px solid #eee5d8}}
@media (prefers-reduced-motion:reduce){.mcd-teaser,.mcd-teaser__cta svg{transition:none}}

/* Shop category page header (from [sofa_ranges_teaser]) */
.mcd-cathead{margin:6px 0 16px}
.mcd-cathead .mcd-cathead__h{margin:0!important; padding:0; color:var(--range-ink,#222)!important; font-family:"Lato",sans-serif; font-size:32px; font-weight:900; line-height:1.15; text-transform:none; letter-spacing:-.005em}
.mcd-cathead .mcd-cathead__p{margin:6px 0 0!important; color:#6b6560; font-size:15.5px; line-height:1.45}
@media (max-width:700px){ .mcd-cathead .mcd-cathead__h{font-size:25px} .mcd-cathead .mcd-cathead__p{font-size:14.5px} }

/* Celebrity: small print under the name, so the plate is taller to match the other brands */
.range-card__brand:has(img[src*="brands/celebrity"]){padding:8px 12px}
.range-card__brand img[src*="brands/celebrity"]{height:34px!important; max-width:150px!important}
