/* Virtual styling (Makeup + Hair) page styles. All rules namespaced .st-* so the stylesheet can be
   loaded globally in the document head. Flat design: solid fills + borders, no depth shadows. Uses
   Bootstrap --bs-* tokens so it follows the active theme.

   The studios' LAYOUT is not here: /makeup and /hair render the same three-card track as /outfits
   (.st-studio / .st-progress / .st-wrap / .st-track / .st-card / .st-photo / .st-nav, plus
   .to-rbox / .to-zone / .to-idle for the photo boxes), all of which live in tryon.css and are shared
   verbatim - including the 3/4 photo frame, the aspect ratio phone cameras shoot. Likewise the kept
   looks: makeup and hair looks sit in the one dated feed on /looks, so this file carries no history,
   equation or modelling-video rules any more.

   What IS here: card 2's chosen-style tile, the style + colour picker modal, the styling-specific
   generating and keep effects, and the admin catalog rows. */

/* ── card 2: the chosen style ──────────────────────────────────────────────────────── */
/* The whole tile is the button that reopens the picker (same shape as card 3's idle Generate zone). It
   inherits .to-rbox-open's absolute fill from tryon.css; these are the styling-only extras. */
/* A chosen tile bleeds to the card edge like the upload tile beside it, so it needs no border of its own -
   the card supplies the outline. The empty state is a .to-zone, whose dashed border must survive. */
.st-photo--pick .to-rbox:not(.to-zone) { border-color: transparent; }
/* An EzButton now as well. It is a transparent overlay laid across a photograph, so the one thing
   that must never happen is Bootstrap's .btn:hover painting a body-bg panel over the picture - and
   .to-rbox-open's own `background: none` loses that fight on specificity. Every fill and border is
   pinned to transparent through the variables instead. gap:0 and the zeroed padding replace what
   .btn's inline-flex box would otherwise add around the image.
   Scoped to .st-pick, never .to-rbox-open: the other four click-zone overlays are still raw buttons,
   where these variables are inert. */
.st-pick {
    cursor: pointer; gap: 0;
    --bs-btn-padding-x: 0; --bs-btn-padding-y: 0;
    --bs-btn-border-radius: 0;
    --bs-btn-bg: transparent; --bs-btn-hover-bg: transparent;
    --bs-btn-active-bg: transparent; --bs-btn-disabled-bg: transparent;
    --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent; --bs-btn-disabled-border-color: transparent;
}
.st-pick:disabled { cursor: default; }
.st-pick-ph { position: relative; z-index: 1; font-size: 2.4rem; color: var(--bs-secondary-color); }

/* The style's name (and hair colour) riding the bottom of its own tile - a tile alone does not say which
   cut or which colour it was. Click-through so the tile underneath stays one big picker button. */
/* A chip centred on the bottom edge of the IMAGE (not a bar across the card), in the same bottom slot and
   the same inset as every other card's bottom row - see the placement standard in tryon.css. */
.st-chosen {
    position: absolute; left: 50%; bottom: var(--st-edge, 1.15rem); z-index: 2; pointer-events: none;
    transform: translateX(-50%); max-width: calc(100% - 2 * var(--st-edge, 1.15rem));
    display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
    padding: 0.35rem 0.85rem; text-align: center; line-height: 1.2;
    border-radius: var(--bs-border-radius-lg);
    /* 0.70, not 0.55: the scrim has to carry white text over an ARBITRARY photograph, and against a
       pale one 55% left the caption at roughly 4.9:1 before .st-chosen-sub's own 0.85 opacity took it
       under AA. At 70% the worst case (a white photo behind it) is about 8.8:1. */
    color: #fff; background: rgba(0, 0, 0, 0.7);
}
.st-chosen-name { font-size: 0.85rem; font-weight: 600; }
.st-chosen-sub { font-size: 0.75rem; opacity: 0.85; }

/* ── style + colour picker (modal) ─────────────────────────────────────────────────── */
/* ONE question at a time, so the list always owns the full width of the modal and there is a single
   scroll region under the thumb. (Hair used to put the colours in a second column, which stacked below
   the whole haircut gallery on a phone - the colours were unreachable without scrolling past everything,
   and each column fought for its own scroll.) The card is chosen in the markup; this is just the frame. */
.st-picker { display: flex; flex-direction: column; min-width: 0; }
.st-picker-colhead { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.st-picker-scroll { overflow-y: auto; max-height: 60vh; padding-right: .25rem; }
/* The haircut carried into the colour card, so the shade is judged against something. */
/* The chosen haircut, riding along the top of the colour card. It is also the way BACK to the haircuts
   now that the picker has no footer, so it is a button: quiet at rest so it still reads as a caption,
   with the pen and a border on hover to say it can be changed. */
.st-picker-chosen { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem;
    color: var(--bs-secondary-color); min-width: 0; padding: .25rem .5rem .25rem .25rem;
    background: none; border: 1px solid transparent; border-radius: var(--bs-border-radius-xxl); cursor: pointer;
    transition: border-color .15s, color .15s; }
.st-picker-chosen:hover, .st-picker-chosen:focus-visible {
    border-color: var(--bs-border-color); color: var(--bs-body-color); }
.st-picker-chosen img { width: 1.9rem; height: 1.9rem; border-radius: 50%; object-fit: cover; flex: none; }
.st-picker-chosen span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-picker-chosen i { font-size: .75rem; flex: none; }
.st-group-head { margin: 1.25rem 0 0.75rem; font-size: .95rem; font-weight: 600; }
.st-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem;
}
/* An EzButton (the platform has one button component; a tile is a button whose content is a picture,
   a name and a price). Three groups of declarations keep it looking exactly as it did as a raw
   <button>: the tile's own layout; the flex properties .btn would otherwise impose (it is
   inline-flex, align-items:center, gap .5rem, justify-content:center - all wrong for a full-bleed
   image over a caption); and the --bs-btn-* variables, which is how Bootstrap's own hover/active/
   disabled rules are steered without a specificity fight they would always win. */
.st-tile {
    display: flex; flex-direction: column; padding: 0; border-radius: var(--st-radius, 0.75rem);
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); overflow: hidden;
    cursor: pointer; text-align: left; transition: border-color .15s;
    align-items: stretch; justify-content: flex-start; gap: 0; color: var(--bs-body-color);
    --bs-btn-padding-x: 0; --bs-btn-padding-y: 0;
    --bs-btn-color: var(--bs-body-color); --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-active-color: var(--bs-body-color); --bs-btn-disabled-color: var(--bs-body-color);
    --bs-btn-border-radius: var(--st-radius, 0.75rem);
    --bs-btn-bg: var(--bs-body-bg); --bs-btn-hover-bg: var(--bs-body-bg);
    --bs-btn-active-bg: var(--bs-body-bg); --bs-btn-disabled-bg: var(--bs-body-bg);
    --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-border-color);
}
.st-tile:hover:not(:disabled) { border-color: var(--bs-primary); }
.st-tile--on { border-color: var(--bs-primary); outline: 2px solid var(--bs-primary); outline-offset: -4px; }
.st-tile:disabled { opacity: .6; cursor: not-allowed; }
/* Portrait, like the tiles themselves and like the card the chosen style lands on - a hairstyle needs the
   head's full height to read, which a square crop cuts off. */
.st-tile-img { aspect-ratio: 3 / 4; background: var(--bs-secondary-bg); display: flex; align-items: center; justify-content: center; }
.st-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.st-tile-ph { font-size: 1.8rem; color: var(--bs-secondary-color); }
/* The name is the last thing on a tile now (the per-tile price moved up to .st-picker-cost), so it
   carries the tile's bottom padding itself. */
.st-tile-name { font-weight: 600; padding: .4rem .5rem .5rem; font-size: .9rem; }
/* The one price line at the top of the gallery, left of Surprise me. */
.st-picker-cost { font-size: .875rem; color: var(--bs-secondary-color); }

/* ── hair colour chart (card 2 of the picker) ──────────────────────────────────────── */
/* A grid rather than a wrapping flex row: forty-odd shades in ragged rows read as a pile, and a grid
   keeps the family sections aligned with each other. auto-fill so a phone gets three or four per row and
   a desktop gets a proper chart. */
.st-swatches {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .6rem;
    margin-bottom: .5rem;
}
/* Same treatment as .st-tile above, and for the same reason - this is an EzButton now too. */
.st-swatch {
    display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 0;
    padding: .4rem; border-radius: var(--bs-border-radius-lg); border: 2px solid transparent; background: none; cursor: pointer;
    justify-content: flex-start; color: var(--bs-body-color);
    --bs-btn-padding-x: .4rem; --bs-btn-padding-y: .4rem;
    --bs-btn-color: var(--bs-body-color); --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-active-color: var(--bs-body-color); --bs-btn-disabled-color: var(--bs-body-color);
    --bs-btn-border-radius: var(--bs-border-radius-lg);
    --bs-btn-bg: transparent; --bs-btn-hover-bg: transparent;
    --bs-btn-active-bg: transparent; --bs-btn-disabled-bg: transparent;
    --bs-btn-border-color: transparent; --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-border-color: var(--bs-border-color); --bs-btn-disabled-border-color: transparent;
}
.st-swatch:hover:not(:disabled) { border-color: var(--bs-border-color); }
/* The chosen swatch keeps its brand ring through hover and active, which the shared hover variable
   above would otherwise reset to the neutral border. */
.st-swatch--on { border-color: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary); }
.st-swatch:disabled { opacity: .6; cursor: not-allowed; }
/* Bigger than the old 34px chip: these are photographs of hair now, and the whole point is being able to
   see the tone and shine, which a coin-sized dot cannot carry. */
.st-swatch-chip {
    width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 1px solid var(--bs-border-color);
    display: inline-flex; align-items: center; justify-content: center; color: var(--bs-secondary-color);
    overflow: hidden; flex: none;
}
.st-swatch-chip--photo { border-color: transparent; }
.st-swatch-chip--photo img { width: 100%; height: 100%; object-fit: cover; }
.st-swatch-chip--keep { background: var(--bs-secondary-bg); }
/* Flat-colour fallback for a shade with no swatch photo. The colour itself is per-row data, so it
   arrives as the --st-chip custom property rather than an inline background declaration. */
.st-swatch-chip--hex { background: var(--st-chip, var(--bs-secondary-bg)); }
.st-swatch-name { font-size: .72rem; text-align: center; line-height: 1.15; }

/* ── admin rows ──────────────────────────────────────────────────────────────────── */
.st-adminrow { display: flex; align-items: center; gap: .6rem; }
.st-adminthumb {
    width: 40px; height: 40px; border-radius: var(--bs-border-radius-lg); overflow: hidden; flex: none;
    background: var(--bs-secondary-bg); display: inline-flex; align-items: center; justify-content: center;
    color: var(--bs-secondary-color);
}
.st-adminthumb img { width: 100%; height: 100%; object-fit: contain; }

/* ── responsive ────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* The modal body is already the scroll region on a phone; a nested max-height would trap the list
       in a short window inside it. */
    .st-picker-scroll { max-height: none; }
    /* Tighter chart so a phone still gets four shades per row rather than two enormous ones. */
    .st-swatches { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: .45rem; }
    .st-swatch-chip { width: 2.9rem; height: 2.9rem; }
}

