/* ============================================================
   AVANTE — VARIANT SELECTOR

   Every size here is a floor, not a preference: 17px text, 48px
   targets, and a selected state carried by a border, a fill and a
   tick so it survives being read in greyscale or by someone who
   cannot separate lilac from white.
   ============================================================ */

/* WooCommerce's own dropdown table is the fallback. It stays visible until the
   document says scripting is on, so a customer without JavaScript still gets a
   control that works rather than a dead row of buttons. */
.avs-var{ display:none; }
.avs-var-js .avs-var{ display:block; }
.avs-var-js .avs-pdp table.variations,
.avs-var-js .avs-pdp .reset_variations{ display:none !important; }

/* If the script cannot find the form, or the selector never printed, it hands
   the page back to WooCommerce whole. Whole means the Clear link too: giving
   the dropdowns back without it leaves a choice that cannot be undone. */
.avs-var-failed .avs-var{ display:none !important; }
.avs-var-failed .avs-pdp table.variations{ display:table !important; }
.avs-var-failed .avs-pdp .reset_variations{ display:inline-flex !important; }

.avs-var{
  margin:12px 0 12px;
  padding:0 0 12px;
  border-bottom:1px solid var(--line);
}

/* ---------- one axis ---------- */
.avs-var-g{
  border:0; margin:0 0 14px; padding:0; min-width:0;
}
.avs-var-g:last-of-type{ margin-bottom:0; }

.avs-var-lg{
  display:block; float:none; width:100%;
  margin:0 0 6px; padding:0;
  font-size:1.0625rem; line-height:1.35;
}
.avs-var-lb{
  font-weight:700; color:var(--indigo-900);
}
.avs-var-ch{
  font-weight:700; color:var(--indigo-900);
}
.avs-var-ch:not(.is-empty)::before{ content:": "; font-weight:600; }
.avs-var-ch.is-empty{
  display:inline-block; margin-left:14px;
  font-weight:500; color:var(--ink-muted);
}

/* A wrapped row whose boxes size to their own words. A fixed column made
   "Swing Away Elevating Legrest" stack four lines deep next to a wide empty
   gutter, so the boxes take the width their name needs and share what is left.
   Options on the same line stretch to one height, which is what makes a row
   scannable; equal widths never were.

   The client called the grid heavy, and twelve colours were reaching six rows
   of two: the boxes were 190px wide and 56px tall in a 546px column, so each
   pair carried 160px of empty gutter and the whole list ran 444px. The floor
   the boxes must clear is the 48px target, not 56px, and a name needs about
   148px, which is three to a row. Same words, same chips, same targets, in
   about half the height. */
.avs-var-opts{
  /* A grid, not wrapped flex. Flex let every box grow to fill its row, so twelve
     colours came out as rows of three, two, three, three and one, each a
     different width. Nothing was wrong with any single box and the whole thing
     still read as untidy. Equal columns fix that on their own. */
  display:grid; align-items:stretch;
  grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));
  gap:8px; margin:0; padding:0;
}

/* ---------- one option ---------- */
/* A box grows to help fill its row but never past the width of a long name,
   which is what stops the last option on a wrapped list from stretching to the
   full width of the column and reading as a different kind of control from the
   twelve above it. */
.avs-opt{
  position:relative; display:flex; margin:0; cursor:pointer;
  min-width:0;                 /* the grid track sets the width now */
}
/* Sizes and sides are short words, so they sit in narrower columns than colours. */
.avs-var-g--pill .avs-var-opts{ grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); }
.avs-var-g--select .avs-var-opts{ display:block; }
/* The radio is invisible but it is not shrunk to a dot. A 1px control pinned to
   the label's top left corner is a box the browser can decide is off screen,
   and clicking a label focuses it: Chrome then centres that dot in the window
   and the reader's place in the page is gone. Covering the whole label keeps
   the real radio, the real focus and the real hit area in one rectangle the
   reader can already see, so focusing it never scrolls anything. */
.avs-opt-in{
  position:absolute; inset:0; width:100%; height:100%;
  margin:0; padding:0; border:0; opacity:0; cursor:pointer;
  -webkit-appearance:none; appearance:none;
}
.avs-opt-in:disabled{ cursor:not-allowed; }
.avs-opt-box{
  display:flex; flex:1 1 auto; align-items:center; gap:9px;
  min-height:48px; padding:6px 12px 6px 9px;
  border:2px solid #DCD4EC; border-radius:12px;
  background:#fff; color:var(--ink);
  font-size:1.0625rem; font-weight:600; line-height:1.25;
  transition:border-color .12s ease, background-color .12s ease;
}
/* A value with no honest colour keeps the chip's space so the names still line
   up in one column. The gap says "no colour for this one", which is the truth. */
.avs-opt--plain .avs-opt-box{ padding-left:42px; }
.avs-var-g--pill .avs-opt--plain .avs-opt-box{ padding-left:12px; justify-content:center; }
.avs-var-g--pill .avs-opt--plain .avs-opt-txt{ align-items:center; text-align:center; }

.avs-opt-chip{
  flex:0 0 auto; width:25px; height:25px; border-radius:50%;
  box-shadow:inset 0 0 0 1px rgba(46,26,94,.30);
  background-clip:padding-box;
}
/* A white or champagne chip needs a firmer edge or it disappears into the box. */
.avs-opt-chip.is-light{ box-shadow:inset 0 0 0 1.5px rgba(46,26,94,.5); }
.avs-opt-txt{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.avs-opt-t{ min-width:0; }

/* An option we sell but have not priced online. It is not unavailable, so it
   never wears the unavailable treatment: it keeps its solid border and its
   click, and says what it needs instead of leaving it to a colour. */
.avs-opt-tag{
  font-size:1.0625rem; font-weight:700; line-height:1.25;
  color:var(--amber-ink);
}
.avs-opt-tag[hidden]{ display:none; }

/* The tick sits on the corner so choosing an option never resizes it. */
.avs-opt-tick{
  position:absolute; top:-8px; right:-6px;
  width:23px; height:23px; border-radius:50%;
  display:none; place-items:center;
  background:var(--indigo-900); color:#fff;
  box-shadow:0 0 0 3px #fff;
}
.avs-opt-tick svg{ display:block; }

.avs-opt:hover .avs-opt-box{ border-color:var(--lilac-300); }

.avs-opt-in:checked + .avs-opt-box{
  border-color:var(--indigo-900);
  background:var(--lavender);
  color:var(--indigo-900);
}
.avs-opt-in:checked + .avs-opt-box .avs-opt-tick{ display:grid; }

.avs-opt-in:focus-visible + .avs-opt-box{
  outline:3px solid var(--violet-500); outline-offset:3px;
}

/* ---------- an option this product is not made in ---------- */
.avs-opt:has(.avs-opt-in:disabled){ cursor:not-allowed; }
.avs-opt-in:disabled + .avs-opt-box{
  border-color:#E7E3EF; border-style:dashed;
  background:#F7F5FA; color:var(--ink-subtle);
}
.avs-opt-in:disabled + .avs-opt-box .avs-opt-chip{ opacity:.4; }
.avs-opt-in:disabled + .avs-opt-box .avs-opt-t{ text-decoration:line-through; }
/* Spoken with the option it belongs to; the sighted reader gets the same fact
   once, under the group, instead of the same sentence four times over. */
.avs-opt-na{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
}
.avs-var-note{
  margin:10px 0 0; font-size:1.0625rem; line-height:1.45;
  color:var(--ink-muted);
}
.avs-var-note[hidden]{ display:none; }

/* ---------- dropdown control ---------- */
.avs-var-select{
  width:100%; min-height:56px; padding:12px 46px 12px 16px;
  font-size:1.0625rem; font-family:inherit; font-weight:600; color:var(--ink);
  border:2px solid #DCD4EC; border-radius:14px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%237B5EA7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center;
  -webkit-appearance:none; appearance:none; cursor:pointer;
}
.avs-var-select:hover{ border-color:var(--lilac-300); }
.avs-var-select.is-chosen{ border-color:var(--indigo-900); background-color:var(--lavender); }

/* ---------- facts: an axis with one value is not a question ---------- */
.avs-var-facts{
  list-style:none; margin:16px 0 0; padding:14px 16px;
  background:var(--lavender); border-radius:14px;
  display:grid; gap:6px 26px;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
}
.avs-var-facts li{ display:flex; gap:8px; flex-wrap:wrap; font-size:1.0625rem; }
.avs-fact-k{ color:var(--ink-muted); }
.avs-fact-k::after{ content:":"; }
.avs-fact-v{ font-weight:700; color:var(--indigo-900); }

/* ---------- clear ---------- */
.avs-var-clearwrap{ margin:14px 0 0; }
.avs-var-clear{
  display:inline-flex; align-items:center; min-height:48px; padding:10px 20px;
  border:2px solid #DCD4EC; border-radius:var(--pill); background:#fff;
  font-size:1.0625rem; font-weight:600; color:var(--indigo-900); cursor:pointer;
}
.avs-var-clear:hover{ border-color:var(--violet-500); }
.avs-var-clear[hidden]{ display:none; }

/* ---------- an option that is sold, but not priced online ----------

   The catalogue already has an answer for a product with no price: the price
   line says so, the dead Add to cart goes, and the phone number takes the
   amber. A variation in the same state gets exactly that, rather than a stale
   parent price over a greyed button. */
.avs-var-poaprice{ margin:0; }
.avs-var-poaprice[hidden],
.avs-var-poa[hidden]{ display:none !important; }

.avs-poa-choice .avs-buy-price > p.price:not(.avs-var-poaprice),
.avs-poa-choice .avs-buy .avs-stock,
.avs-poa-choice .avs-pdp .woocommerce-variation-price,
.avs-poa-choice .avs-pdp .woocommerce-variation-availability{ display:none; }
/* Quantity and Add to cart together. A button that cannot add to cart is not
   a button, and greying it out still leaves the promise on screen. */
.avs-poa-choice .avs-pdp .woocommerce-variation-add-to-cart{ display:none !important; }
/* Woo's panel would repeat the price line we just replaced, and slideDown puts
   display:block on it inline, so this has to shout. It stays only when the
   variation has a description of its own to carry. */
.avs-poa-choice .avs-pdp .woocommerce-variation:not(:has(.woocommerce-variation-description:not(:empty))){
  display:none !important;
}

/* ---------- what the photograph is a photograph of ----------

   The rail and the selector both write to the main frame, so the frame has to
   say which option it is showing or the two can quietly disagree. Under the
   picture rather than over it, at reading size, and never a colour on its own:
   the warning state changes the words, not just the ink. */
.avs-gal-note{
  margin:0; width:100%;
  font-size:1.0625rem; line-height:1.45; font-weight:600;
  color:var(--ink-muted);
}
.avs-gal-note[hidden]{ display:none; }
/* The mismatch state used to be an amber bordered panel. That is a warning
   styled block, and the client wants none of those on this page, so the line
   now carries the same sentence in the same place at reading weight. The panel
   is still here, behind the warnings switch, and comes back with the rest. */
.avs-gal-note.is-warn{ color:var(--ink); }
body.avs-warnings-on .avs-gal-note.is-warn{
  padding:12px 16px; border-radius:var(--radius-sm);
  border:2px solid var(--amber-500); background:#FFF8EC;
  color:var(--amber-ink); font-weight:700;
}
@media (max-width:1023px){
  /* The stage and the rail are centred in a 560px band here, so the line that
     labels them belongs in the same band. */
  .avs-gal-note{ max-width:560px; margin-inline:auto; }
}

/* ---------- the running commentary, for people who cannot see it ----------

   Choosing an option rewrites the price and can replace the buy button with a
   telephone number. Woo's own live region on this page is empty, so this one
   carries the sentence. Off screen: the sighted customer already watched it
   happen and does not need it written out twice. */
.avs-var-say{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
}

/* ---------- keeping clear of the chat bubble ----------

   The site's chat bubble is fixed over the bottom right corner and paints
   above the page at z-index 950, so an option box that reaches under it loses
   the tap to the chat. The bubble belongs to another plugin, so the corner is
   reserved on our side instead. Whether it is in the way at all depends on how
   close the card runs to the edge of the screen, which is a measurement rather
   than a breakpoint, so the script sets the width and this only spends it.

   The call to order button is reserved for on the same terms. It shares the
   column and the right edge, and on the 251 products with no price it is the
   only way to buy at all, so the chat must not sit on its corner. */
.avs-var-keepout .avs-var-opts,
.avs-var-keepout .avs-var-select,
.avs-var-keepout .avs-var-note,
.avs-var-keepout .avs-var-clearwrap,
.avs-var-keepout .avs-pdp .avs-buy .avs-buy-call{ margin-right:var(--avs-keepout, 0px); }

/* ---------- narrow screens ---------- */
@media (max-width:600px){
  .avs-var-opts{ gap:10px 8px; }
  /* A finger is not a mouse, so the boxes keep the taller target here. */
  .avs-opt-box{ min-height:56px; }
  .avs-opt-na{ max-width:none; }
}
@media (max-width:430px){
  /* One column beats two half-width boxes when the names run long. The cap
     that keeps a lone option from stretching across a wide column has to come
     off with it, or every box on a phone stops 40px short of the card edge. */
  .avs-opt{ min-width:100%; max-width:100%; }
  .avs-var-g--pill .avs-opt{ min-width:104px; max-width:100%; }
}

@media (prefers-reduced-motion:reduce){
  .avs-opt-box{ transition:none; }
}

/* Windows high contrast: borders survive, background fills do not. */
@media (forced-colors:active){
  .avs-opt-in:checked + .avs-opt-box{ border-width:3px; }
  .avs-opt-tick{ forced-color-adjust:none; }
}


/* ---------- a short screen ----------
   A 1366x768 laptop leaves 561px under the header for a photograph, a name, a
   price, twelve colours and a button. The option boxes keep their 48px target
   and their 17px name; only the air between them gives way, and only here. */
/* ---------- the two column page ----------
   Both of these cost the buy button its place on the first screen, at
   1440x900 as well as at 1366x768, so neither waits for the short screen
   block below. Every word survives at 17px; what goes is the air round it. */
@media (min-width:1024px){
  /* Choosing three options prints this sentence three times, once per group.
     At 10px of margin and 1.45 line-height that was 105px. */
  .avs-var-note{ margin-top:6px; line-height:1.35; }

  /* An axis with one value is a fact, not a question, and a fact is not one
     of the five things the first screen owes the reader. It was a lavender
     card with 14px of padding standing between the last question and the
     button, which is where the Tray lost its button at both sizes. Flatten
     it to the same quiet run the identifier codes were given this round:
     same words, same 17px, no fill and no box. */
  .avs-var-facts{
    margin-top:10px; padding:0; background:none; border-radius:0;
    display:flex; flex-wrap:wrap; gap:2px 26px;
  }
}

@media (min-width:1024px) and (max-height:820px){
  .avs-var{ margin-top:4px; }
  .avs-var-lg{ margin-bottom:4px; }
  .avs-var-g{ margin-bottom:12px; }
  .avs-var-note{ margin-top:5px; line-height:1.3; }
  .avs-var-facts{ margin-top:8px; }
}

/* The width the gallery hands back (product.css, THE LETTERBOX) is only worth
   having if it widens the boxes. auto-fill spends it the other way: at 539 it
   lays 4 pill tracks of 128px and at 614 it lays 5 of 118px, so the extra
   width made the names wrap harder and the Silver Sport footrests grew 21px.
   Pinning the count turns the same width into wider tracks instead: 3 across
   for colours, which is the arrangement this grid was rebuilt for, and 4 for
   the short sizes and sides. */
@media (min-width:1100px) and (max-height:820px){
  .avs-var-opts{ grid-template-columns:repeat(3, minmax(0,1fr)); }
  .avs-var-g--pill .avs-var-opts{ grid-template-columns:repeat(4, minmax(0,1fr)); }
  .avs-var-g--select .avs-var-opts{ display:block; }
}
