/* The look's outfit pieces (style-slots.js): 3:4 product tiles and the summary in the CTA bar, plus the background control. Kampania: square corners, ink on ground, photos lead. */

.outfit-rows { display: grid; gap: var(--s5); }
.outfit-row { min-width: 0; }
.outfit-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s1); margin: 0 0 var(--s2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.outfit-label-hint { margin-left: var(--s2); color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.outfit-strip { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); margin: 0 calc(-1 * var(--gutter)); padding: 3px var(--gutter) var(--s2); scrollbar-width: thin; }
.outfit-tile { position: relative; flex: none; width: 112px; aspect-ratio: 3 / 4; padding: 0; border: 0; background: var(--white); color: var(--ink); scroll-snap-align: start; cursor: pointer; overflow: hidden; font: inherit; }
.outfit-tile .img-missing { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 10px; background: var(--tone); }
.outfit-tile:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.outfit-tile.parked > .frame { opacity: 0.5; }
.outfit-tile.suggestion[aria-busy="true"] { cursor: progress; opacity: 0.6; }
/* "+": last in the strip, a shade deeper than the photo tiles. On phones it sticks to the screen edge showing 40px until the strip is scrolled to its end (the sticky edge is the strip's padding edge, hence the gutter); a strip that fits never reaches that limit. style-slots.js keeps the glyph centred in the part on screen (--shift) and marks the tile .peeking. */
.outfit-add { display: flex; align-items: center; justify-content: center; background: var(--tone-deep); font-stretch: 62%; font-weight: 800; font-size: 32px; line-height: 1; position: sticky; right: calc(40px - 112px - var(--gutter)); z-index: 2; }
.outfit-add > span { pointer-events: none; transform: translateX(var(--shift, 0)); }
.outfit-add.peeking { box-shadow: 0 0 0 4px var(--ground), -10px 0 14px -4px rgba(17, 17, 17, 0.22); } /* a ground-coloured gap, then a shadow: the tile reads as a card lying over the photo */
button.outfit-add:hover, .outfit-add[aria-expanded="true"] { background: var(--ink); color: var(--ground); }
/* With a catalog the tile holds two choices over the "+": Discover and New piece. Shown on hover, keyboard focus or a tap (data-open, style-slots.js); until then they take no pointer, so a first tap can never choose blind. */
.outfit-add-menu { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--ground); opacity: 0; pointer-events: none; }
.outfit-add-menu > button { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0 var(--s1); border: 0; background: var(--ink); color: var(--ground); cursor: pointer; font: inherit; font-stretch: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.2; text-transform: uppercase; text-align: center; }
.outfit-add-menu > button:hover, .outfit-add-menu > button[aria-expanded="true"] { background: var(--brand); color: var(--ink); opacity: 1; }
.outfit-add-menu > button:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.outfit-add[data-open] > .outfit-add-menu, .outfit-add:focus-within > .outfit-add-menu { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .outfit-add:hover > .outfit-add-menu { opacity: 1; pointer-events: auto; } }
.outfit-item { position: relative; flex: none; display: block; scroll-snap-align: start; }
.outfit-item > .outfit-tile { display: block; }
.outfit-unpark { position: absolute; top: 0; right: 0; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.outfit-unpark > span { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(17, 17, 17, 0.3); font-size: 18px; line-height: 24px; text-align: center; }
.outfit-unpark:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.outfit-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s2); }
.outfit-note .fine { flex: 1 1 100%; }
.outfit-row .slot-panel { margin: var(--s2) 0 0; }
.outfit-empty { margin: 0; }

/* Summary: on phones a strip of thumbs next to the button in the fixed bar; from 900 px the heading, thumbs with titles and the button sit right under the rows. */
.outfit-sum-head { display: none; }
.outfit-summary { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); }
.outfit-summary:empty { display: none; }
.outfit-sum { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.outfit-sum-thumb { flex: none; width: 30px; aspect-ratio: 3 / 4; background: var(--white); overflow: hidden; }
.outfit-sum-thumb .frame > .img-missing { display: block; height: 100%; background: var(--tone); font-size: 0; }
.outfit-sum-text { display: none; }
.outfit-sum-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.style-bar > .msg, .style-bar > #style-products-retry { flex: 1 1 100%; margin: 0; }
.style-bar > #style-btn { flex: 1 1 0; min-width: 0; }

@media (max-width: 359px) {
  .outfit-summary { display: none; }
}

@media (min-width: 900px) {
  .outfit-strip { flex-wrap: wrap; overflow: visible; margin: 0; padding: 3px 0 0; scroll-snap-type: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .outfit-tile { width: auto; }
  .outfit-item > .outfit-tile { width: 100%; }
  .outfit-add { position: relative; right: auto; }
  .style-cta { padding-top: var(--s4); border-top: var(--hair); }
  .style-bar { gap: var(--s3); }
  .outfit-sum-head { display: block; flex: 1 1 100%; margin: 0; }
  .outfit-summary { flex: 1 1 100%; flex-wrap: wrap; gap: var(--s3) var(--s5); }
  .outfit-sum-thumb { width: 54px; }
  .outfit-sum-text { display: grid; min-width: 0; max-width: 220px; }
  .style-bar > #style-btn { flex: 1 1 0; min-height: 56px; font-size: 16px; }
}

/* ---------- Background: a select-like control beside the CTA in Style and in Discover's tray, and its picker (background.js) ---------- */
.bg-select { position: relative; flex: none; align-self: stretch; display: flex; align-items: center; gap: var(--s2); min-height: 48px; max-width: 100%; padding: 3px var(--s2) 3px 3px; border: var(--rule); background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.bg-select:hover { background: var(--tone); }
.bg-select:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.bg-select-thumb { flex: none; width: 32px; height: 40px; object-fit: cover; }
.bg-select-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bg-select-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.2; text-transform: uppercase; color: var(--muted); }
.bg-select-name { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-select-caret { flex: none; width: 8px; height: 8px; margin: 0 var(--s1) 4px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
@media (min-width: 600px) { .bg-select { padding-right: var(--s3); } .bg-select-text { position: static; width: auto; height: auto; min-width: 0; overflow: visible; clip-path: none; white-space: normal; } }
@media (min-width: 900px) { .style-bar > .bg-select { flex: 0 1 240px; min-width: 0; } .bg-select-text { flex: 1; } }
.bg-studio { display: block; background: linear-gradient(180deg, #f4f3f0, #dcdad4); }
dialog.background-picker { max-width: 980px; }
.bg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
@media (min-width: 560px) { .bg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .bg-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bg-tile { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-tile); }
.bg-tile > img, .bg-tile > .bg-studio { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-tile); background-color: var(--tone); }
.bg-tile.pick-tile[aria-pressed="true"]::after { bottom: auto; aspect-ratio: 2 / 3; }
.bg-tile-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.bg-tile-note { font-size: 12px; color: var(--muted, inherit); }
.bg-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.result-bg { margin-top: 2px; }
