/* wearfits.me — Discover (index.html [data-view="discover"]): KATALOG | ZAPISANE with the search box, one filter row,
   the cards (look-card.js), the Save popover (save-menu.js) and "Your look" (style-panel.js). From 900 px the view is
   full width: the feed, then a 380 px column that stays in view. On phones the column is a black bar above the tabs
   that opens as a sheet. Loaded after styles.css, layout.css, outfit.css and header.css. */

/* ---------- head: the two tabs and the search box ---------- */
.dv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); border-bottom: var(--hair); }
.dv-tabs { display: flex; gap: var(--s5); }
.dv-tabs a { display: inline-flex; align-items: baseline; gap: 6px; padding-bottom: var(--s2); border-bottom: 3px solid transparent; margin-bottom: -1px; color: #8A867F; text-decoration: none; font-stretch: 62%; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; }
.dv-tabs a[aria-current="page"] { border-color: var(--ink); color: var(--ink); }
.dv-tabs small { font-size: 16px; font-weight: 700; color: inherit; }
.dv-search { display: none; position: relative; align-items: center; margin-bottom: var(--s3); }
.dv-search > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.dv-search .input { width: 240px; min-height: 40px; padding-left: 38px; border: var(--hair); border-radius: 999px; }

/* ---------- filter rows ---------- */
.dv-filters { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.dv-pill { display: inline-flex; flex: none; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.dv-pill button { min-height: 38px; padding: 0 var(--s4); border: 0; background: var(--ground); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.dv-pill button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.dv-select { position: relative; display: inline-flex; flex: none; align-items: center; gap: var(--s2); }
.dv-select select, .dv-chip { min-height: 40px; padding: 0 var(--s4); border: var(--hair); border-radius: 999px; background: var(--ground); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.dv-select select { padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.dv-select.is-set select, .dv-chip.is-set, .dv-chip[aria-expanded="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dv-select > span:not(.sr-only) { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.dv-chip { display: inline-flex; flex: none; align-items: center; gap: var(--s2); }
.dv-count { flex: none; margin: 0 0 0 auto; padding-left: var(--s3); font-size: 13px; color: var(--muted); white-space: nowrap; }
.dv-panel { display: flex; flex-wrap: wrap; gap: var(--s3); margin: calc(-1 * var(--s2)) 0 var(--s4); padding: var(--s3); border-radius: var(--r-tile); background: #F7F6F4; }
.dv-panel[hidden] { display: none; }

/* Saved: the collection chips scroll in one row; Filters stays at its end */
.dv-colls-row { align-items: flex-start; }
.dv-colls { display: flex; flex: 1 1 auto; min-width: 0; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.dv-colls::-webkit-scrollbar { display: none; }
.dv-coll { display: inline-flex; flex: none; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4) 0 var(--s2); border: var(--hair); border-radius: 999px; background: var(--ground); color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; cursor: pointer; }
.dv-coll:not(:has(.dv-coll-thumb)) { padding-left: var(--s4); }
.dv-coll[aria-current="true"] { border-color: var(--ink); background: var(--ink); color: var(--ground); }
.dv-coll-thumb { position: relative; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--tone); }
.dv-coll-thumb > .frame { position: absolute; inset: 0; width: auto; aspect-ratio: auto !important; }
.dv-coll-n { font-size: 12px; font-weight: 700; opacity: 0.7; }
.dv-coll-new { border-style: dashed; border-color: var(--ink); background: transparent; }
#dv-coll-menu { flex: none; }

/* ---------- cards ---------- */
.dc-media { position: relative; }
.dc-badge { position: absolute; top: 10px; left: 10px; z-index: 1; display: none; padding: 4px 8px; border-radius: 4px; background: var(--brand); color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.dc-card.in-look .dc-badge { display: block; }
.dc-save { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 9px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.94); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.dc-save[aria-pressed="true"] svg { fill: currentColor; }
.dc-save[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.dc-save-text { display: none; }
.dc-add { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--ground); font-size: 0; cursor: pointer; }
.dc-add::before { content: "+"; font-size: 24px; font-weight: 400; line-height: 1; }
.dc-add[aria-pressed="true"] { background: var(--brand); color: var(--ink); }
.dc-add[aria-pressed="true"]::before { content: "✓"; font-size: 18px; font-weight: 700; }
.dc-add[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.dc-choose { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); padding: var(--s2); border-radius: var(--r-tile); background: var(--ground); box-shadow: 0 4px 16px rgba(17, 17, 17, 0.18); }
.dc-choose[hidden] { display: none; }
.dc-choose-q { grid-column: 1 / -1; margin: 0 0 var(--s1); font-size: 12px; font-weight: 700; }
.dc-choose .btn { min-height: 36px; padding: 0 var(--s1); font-size: 11px; }
/* A card dragged onto its slot (card-drag.js): the photo is not the browser's own drag; only the matching row lights up. */
.dc-media img { -webkit-user-drag: none; -webkit-touch-callout: none; }
.card-drag-ghost { position: fixed; top: 0; left: 0; z-index: 60; width: 80px; height: 120px; overflow: hidden; border-radius: var(--r-tile); background: var(--white); box-shadow: 0 12px 28px rgba(17, 17, 17, 0.28); pointer-events: none; }
.card-drag-ghost img { width: 100%; height: 100%; object-fit: cover; }
html[data-card-dragging], html[data-card-dragging] * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.sp-slot.is-target { position: relative; outline: 2px dashed var(--ink); outline-offset: -2px; }
.sp-slot.is-drop { outline: 2px solid var(--ink); }
.sp-slot-drop { display: none; }
.sp-slot.is-drop .sp-slot-drop { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--r-tile); background: var(--brand); color: var(--ink); font-size: 14px; font-weight: 700; }
.dc-title { margin-bottom: 0; }
.dc-meta { margin: 0; }

/* From 900 px: "Save ▾" and "+ Add to look" on hover or focus; a saved card keeps its filled bookmark */
@media (min-width: 900px) and (hover: hover) {
  .dc-save { opacity: 0; }
  .dc-save[aria-pressed="true"], .dc-save[aria-expanded="true"], .dc-card:hover .dc-save, .dc-card:focus-within .dc-save { opacity: 1; }
  .dc-card:hover .dc-save, .dc-card:focus-within .dc-save, .dc-save[aria-expanded="true"] { padding: 0 12px; background: var(--ink); color: var(--ground); }
  .dc-card:hover .dc-save svg, .dc-card:focus-within .dc-save svg, .dc-save[aria-expanded="true"] svg { display: none; }
  .dc-card:hover .dc-save-text, .dc-card:focus-within .dc-save-text, .dc-save[aria-expanded="true"] .dc-save-text { display: inline; }
  .dc-save-text::after { content: " ▾"; }
  .dc-add { left: 10px; width: auto; height: 44px; border-radius: 999px; background: var(--brand); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0; }
  .dc-add::before, .dc-add[aria-pressed="true"]::before { content: none; }
  .dc-add[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
  .dc-card:hover .dc-add, .dc-card:focus-within .dc-add { opacity: 1; }
}

/* ---------- the Save popover (fixed, placed by save-menu.js) ---------- */
.save-menu { position: fixed; z-index: 40; overflow-y: auto; overscroll-behavior: contain; padding: var(--s3); border-radius: var(--r-tile); background: var(--ground); box-shadow: 0 8px 28px rgba(17, 17, 17, 0.2); }
.save-menu:focus { outline: 0; }
.save-menu-done { margin: 0 0 var(--s2); padding-bottom: var(--s2); border-bottom: var(--hair); font-weight: 700; }
.save-menu-kicker { margin: 0 0 var(--s2); font-size: 11px; }
.save-menu-list { list-style: none; margin: 0 0 var(--s2); padding: 0; max-height: 240px; overflow-y: auto; }
.save-menu-row { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: var(--s1) var(--s2); border-radius: var(--r-thumb); cursor: pointer; }
.save-menu-row:has(input:checked) { background: #F2F1EF; }
.save-menu-thumb { position: relative; flex: none; width: 32px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--tone); }
.save-menu-thumb > .frame { position: absolute; inset: 0; width: auto; aspect-ratio: auto !important; }
.save-menu-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-menu-row input { width: 20px; height: 20px; accent-color: var(--ink); }
.save-menu-new { display: flex; align-items: center; gap: var(--s2); padding-left: var(--s3); border: var(--hair); border-radius: var(--r-thumb); }
.save-menu-new .input { flex: 1 1 auto; min-height: 42px; padding-left: 0; border: 0; }
.save-menu-remove { display: block; margin-top: var(--s3); font-size: 13px; }

/* ---------- Your look ---------- */
.style-panel { background: #FAFAF9; }
.sp-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); }
.sp-title { flex: 1 1 auto; margin: 0; font-stretch: 62%; font-size: 30px; font-weight: 800; line-height: 1; text-transform: uppercase; }
.sp-title:focus { outline: 0; }
.sp-clear { font-size: 13px; }
.sp-close { display: none; }
.sp-selfie { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); padding: var(--s3); border-radius: var(--r-tile); background: var(--ground); }
.sp-selfie-pic { flex: none; width: 56px; height: 72px; border-radius: var(--r-thumb); overflow: hidden; background: var(--tone); }
.sp-selfie-pic img { width: 100%; height: 100%; object-fit: cover; }
.sp-selfie-text { display: grid; flex: 1 1 auto; gap: 2px; font-size: 14px; }
.sp-selfie-text .fine { margin: 0; }
.sp-selfie > .link { font-size: 13px; white-space: nowrap; }
.sp-selfie-add { display: flex; align-items: center; gap: var(--s3); width: 100%; color: var(--ink); text-decoration: none; font-weight: 600; }
.sp-slots { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.sp-slot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-tile); background: var(--ground); }
.sp-slot.parked { opacity: 0.55; }
.sp-slot-thumb { position: relative; flex: none; width: 56px; height: 72px; border-radius: var(--r-thumb); overflow: hidden; background: var(--tone); }
.sp-slot-thumb > .frame { position: absolute; inset: 0; width: auto; aspect-ratio: auto !important; }
.sp-slot-text { display: grid; flex: 1 1 0; min-width: 0; gap: 1px; }
.sp-slot-label { font-size: 11px; }
.sp-slot-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-slot-shop { font-size: 13px; color: var(--muted); }
.sp-slot-note { margin: 2px 0 0; }
.sp-slot-fix { justify-self: start; font-size: 13px; }
.sp-slot-x { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #F2F1EF; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.sp-slot.is-empty { padding: 0; background: transparent; }
.sp-slot-add { display: flex; flex: 1 1 auto; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s3); border: 1.5px dashed #B9B6B0; border-radius: var(--r-tile); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.sp-slot-plus { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--ink); font-size: 18px; line-height: 1; }
.sp-slot-browse { font-size: 13px; }
.sp-slot .slot-panel { flex: 1 1 100%; margin: 0; }
.sp-cta { display: grid; gap: var(--s2); }
.sp-cta .bg-select { width: 100%; border: var(--hair); border-radius: var(--r-thumb); }
.sp-cta .bg-select-text { position: static; flex: 1 1 auto; width: auto; height: auto; min-width: 0; overflow: visible; clip-path: none; }
.sp-go { min-height: 56px; background: var(--brand); border-color: var(--brand); color: var(--ink); font-size: 15px; }
.sp-note { margin: 0; text-align: center; }
.sp-all { display: inline-block; margin-top: var(--s2); font-size: 14px; font-weight: 600; }

/* the phone's bar: hidden from 900 px */
.sp-mini { display: none; }

@media (min-width: 900px) {
  [data-view="discover"].view { padding: 0; }
  .dv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .dv-main { padding: var(--s5) 28px var(--gap-section); }
  .dv-tabs a { font-size: 34px; }
  .dv-search { display: flex; }
  .style-panel { position: sticky; top: var(--bar-h); min-height: calc(100vh - var(--bar-h)); max-height: calc(100vh - var(--bar-h)); overflow-y: auto; padding: var(--s5) 28px; border-left: var(--hair); }
  .discover-grid { gap: var(--s5) var(--s3); }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .dv-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .dv-main, .style-panel { padding-inline: var(--s4); }
  .dv-search .input { width: 180px; }
}
@media (min-width: 1100px) { .discover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .discover-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1800px) { .discover-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

@media (max-width: 899px) {
  .dv-tabs a { font-size: 24px; }
  /* one row that scrolls sideways: Women / Men, Filters, then Category and Occasion */
  .dv-filters:not(.dv-colls-row) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
  .dv-filters::-webkit-scrollbar { display: none; }
  #dv-filters-btn { order: 1; }
  .dv-select { order: 2; }
  .dv-count { order: 3; }
  .dv-colls { margin-left: calc(-1 * var(--gutter)); padding-left: var(--gutter); }

  /* the bar: selfie, "+", the chosen pieces, the button */
  .sp-mini { position: fixed; left: 0; right: 0; z-index: 5; bottom: calc(var(--consent-h, 0px) + var(--strip-above) + var(--strip-now, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--gutter); border-radius: 16px 16px 0 0; background: var(--ink); color: var(--ground); }
  .sp-open { display: flex; flex: 1 1 0; min-width: 0; align-items: center; gap: var(--s2); min-height: 52px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
  .sp-mini-selfie { flex: none; width: 36px; height: 48px; border-radius: 6px; overflow: hidden; background: #2A2926; }
  .sp-mini-selfie img { width: 100%; height: 100%; object-fit: cover; }
  .sp-mini-plus { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--ink); font-size: 16px; line-height: 1; }
  .sp-mini .outfit-summary { display: flex; min-width: 0; overflow: hidden; gap: 6px; }
  .sp-mini .outfit-sum-thumb { width: 36px; aspect-ratio: 3 / 4; background: var(--white); }
  .sp-mini-go { flex: none; min-height: 46px; padding: 0 var(--s4); border-color: var(--brand); background: var(--brand); color: var(--ink); }
  .sp-mini .msg, .sp-mini .btn-small { flex: 1 1 100%; margin: 0; }
  .sp-mini .msg.error { color: #FFB4AC; }

  /* the sheet: the panel over the page, above the tabs */
  .sp-body { display: none; }
  .style-panel.is-open .sp-body { position: fixed; left: 0; right: 0; top: var(--bar-h); bottom: calc(var(--consent-h, 0px) + var(--strip-above)); z-index: 6; display: block; overflow-y: auto; padding: var(--s4) var(--gutter) var(--s5); border-radius: 16px 16px 0 0; background: #FAFAF9; box-shadow: 0 -8px 24px rgba(17, 17, 17, 0.2); }
  .style-panel.is-open .sp-close { display: inline-flex; }
  html.sp-sheet-open { overflow: hidden; }
}
