/* picker.css — chips/pills bottom-sheet picker */

/* ===== OVERLAY ===== */
.pk-ov {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}
.pk-ov.on { display: block; }

/* backdrop */
.pk-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
}
.pk-ov.on .pk-bg { opacity: 1; }

/* ===== SHEET ===== */
.pk {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 72dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  border-radius: 20px 20px 0 0;
  background: var(--card, #1b1f26);
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);

  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,.72,.32,1);
}
.pk-ov.on .pk {
  transform: translateY(0);
}

/* grab handle */
.pk-handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
}

/* ===== HEADER ===== */
.pk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 8px;
}
.pk-title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: var(--text, #f2f5f7);
  letter-spacing: .2px;
}
.pk-close {
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: var(--text, #f2f5f7);
  font-size: 18px; font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pk-close:active { transform: scale(.94); }

/* ===== SEARCH ===== */
.pk-search-wrap {
  padding: 4px 16px 8px;
}
.pk-search-wrap.h { display: none; }

.pk-search {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  color: var(--text, #f2f5f7);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  -webkit-appearance: none;
}
.pk-search::placeholder {
  color: rgba(255,255,255,.36);
}
.pk-search:focus {
  border-color: var(--accent, #9fb3c8);
  box-shadow: 0 0 0 2px rgba(159,179,200,.15);
}

/* ===== CHIPS GRID ===== */
.pk-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 12px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* group label */
.pk-group {
  padding: 10px 4px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.35);
}
.pk-group:first-child { padding-top: 4px; }

/* chips container */
.pk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== SINGLE CHIP ===== */
.pk-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);

  color: var(--text, #f2f5f7);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, border-color .15s, background .15s;
}
.pk-chip:active {
  transform: scale(.96);
}

/* selected */
.pk-chip.sel {
  border-color: var(--accent, #9fb3c8);
  background: var(--accent, #9fb3c8);
  color: var(--bg, #14171c);
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(159,179,200,.25);
}

/* hidden by search filter */
.pk-chip.flt { display: none; }

/* ===== WEIGHT MODE — compact grid ===== */
.pk-chips.pk-weight {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pk-chips.pk-weight .pk-chip {
  padding: 8px 6px;
  font-size: 13.5px;
}

/* ===== PRODUCT MODE — full width ===== */
.pk-chips.pk-product .pk-chip {
  flex: 1 1 100%;
  min-height: 46px;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
}

/* ===== NO RESULTS ===== */
.pk-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,.35);
  display: none;
}
.pk-empty.vis { display: block; }

/* ===== THEME 2 — Cloud (light) ===== */
[data-theme="2"] .pk-bg {
  background: rgba(0,0,0,.42);
}
[data-theme="2"] .pk {
  background: var(--card, #E4DED8);
  box-shadow: 0 -8px 30px rgba(0,0,0,.15);
}
[data-theme="2"] .pk-handle {
  background: rgba(0,0,0,.14);
}
[data-theme="2"] .pk-title,
[data-theme="2"] .pk-close {
  color: var(--text, #2C2824);
}
[data-theme="2"] .pk-close {
  border-color: rgba(0,0,0,.08);
  background: rgba(0,0,0,.05);
}
[data-theme="2"] .pk-search {
  border-color: rgba(0,0,0,.08);
  background: rgba(0,0,0,.04);
  color: var(--text, #2C2824);
}
[data-theme="2"] .pk-search::placeholder {
  color: rgba(0,0,0,.32);
}
[data-theme="2"] .pk-search:focus {
  border-color: var(--accent, #FF6D29);
  box-shadow: 0 0 0 2px rgba(255,109,41,.12);
}
[data-theme="2"] .pk-group {
  color: rgba(0,0,0,.35);
}
[data-theme="2"] .pk-chip {
  border-color: rgba(0,0,0,.10);
  background: rgba(0,0,0,.04);
  color: var(--text, #2C2824);
}
[data-theme="2"] .pk-chip.sel {
  border-color: var(--accent, #FF6D29);
  background: var(--accent, #FF6D29);
  color: #fff;
}
[data-theme="2"] .pk-empty {
  color: rgba(0,0,0,.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
  .pk-chips.pk-weight {
    grid-template-columns: repeat(3, 1fr);
  }
}
