/* ── Photo bar ──────────────────────────────────────────────────────────── */
.pl-photo-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pl-action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.pl-action-btn {
  padding: 10px 20px;
  font-size: 0.88rem;
}

.pl-action-dl {
  padding: 10px 16px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.pl-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* ── Intro ──────────────────────────────────────────────────────────────── */
.pl-intro {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

/* ── Groups ─────────────────────────────────────────────────────────────── */
.pl-groups {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.pl-group {
  /* section container */
}

/* ── Group header ───────────────────────────────────────────────────────── */
.pl-group-hdr {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.pl-group-icon {
  font-size: 22px;
  line-height: 1;
}

.pl-group-title {
  font-size: 17px;
  font-weight: 600;
}

.pl-group-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Strip (horizontal scroll) ──────────────────────────────────────────── */
.pl-strip {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.pl-strip::-webkit-scrollbar {
  height: 4px;
}
.pl-strip::-webkit-scrollbar-track {
  background: transparent;
}
.pl-strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.pl-card {
  flex-shrink: 0;
  width: 160px;
  cursor: pointer;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  user-select: none;
}

.pl-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
}

.pl-card.pl-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 153, 106, 0.20);
}

/* ── Card image area ────────────────────────────────────────────────────── */
.pl-card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #1f1f1f;
}

.pl-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Swatch (color placeholder while image loading / not available) */
.pl-swatch {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

/* Spinner */
.pl-spinner-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Check badge */
.pl-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #1a0f06;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}

.pl-card.pl-selected .pl-check {
  opacity: 1;
}

/* Paint box — 3D hair dye box */
.pl-paint-box {
  position: absolute;
  bottom: 10px;
  left: 8px;
  width: 28px;
  height: 42px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  /* 3D perspective tilt */
  transform: perspective(90px) rotateY(-18deg) rotateX(5deg);
  /* Solid offset = visible side face; blurred = ambient shadow */
  box-shadow:
    5px 5px 0 rgba(0, 0, 0, 0.85),
    6px 6px 14px rgba(0, 0, 0, 0.65);
  z-index: 2;
  pointer-events: none;
}

/* Label area — dark, like a brand panel */
.pl-paint-box-label {
  flex: 1;
  background: linear-gradient(160deg, #2d2d2d 0%, #111 100%);
  position: relative;
}

/* Brand line (like logo strip) */
.pl-paint-box-label::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 1px;
}

/* Oval sample window on label */
.pl-paint-box-label::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Color swatch — the promised shade */
.pl-paint-box-color {
  height: 48%;
  flex-shrink: 0;
  position: relative;
}

/* Gloss highlight on color swatch */
.pl-paint-box-color::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 55%);
}

/* Retry button inside card */
.pl-retry-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.pl-retry-btn:hover {
  background: rgba(0, 0, 0, 0.62);
}

/* ── Card labels ────────────────────────────────────────────────────────── */
.pl-card-name {
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  text-align: center;
  padding: 0 4px;
  line-height: 1.3;
}

.pl-card-lv {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

/* ── Sticky bottom bar ──────────────────────────────────────────────────── */
.pl-sticky {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  background: rgba(12, 12, 12, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
  z-index: 200;
}

.pl-sticky.visible {
  transform: translateY(0);
}

.pl-sticky-btn {
  flex: 1;
  max-width: 400px;
  padding: 13px 24px;
  font-size: 0.9rem;
}

.pl-dl-btn {
  flex-shrink: 0;
  padding: 13px 18px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ── Result section ─────────────────────────────────────────────────────── */
.pl-result {
  padding: 32px 0;
  border-top: 2px solid var(--border);
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pl-result-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pl-result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pl-chip {
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(201, 153, 106, 0.10);
  color: var(--accent);
  font-size: 13px;
  border: 1px solid rgba(201, 153, 106, 0.22);
}

/* ── Recommendation grid ────────────────────────────────────────────────── */
.pl-rec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
}

.pl-rec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pl-rec-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: default;
  border: 1px solid var(--border);
}

.pl-rec-name {
  font-size: 12px;
  text-align: center;
  margin-top: 4px;
  line-height: 1.3;
  color: var(--text);
}

.pl-rec-lv {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pl-rec-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pl-card {
    width: 140px;
  }

  .pl-sticky {
    padding: 10px 12px;
  }
}
