/* ============================================================
   YumnAI — Product Discovery Flow Stylesheet (V1)
   Luxury Mobile-First Editorial Aesthetic matching Result Screen
   ============================================================ */

.yn-pd-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #FBF4EF;
  background: linear-gradient(180deg, #FDF7F3 0%, #F8EFEA 100%);
  color: var(--ink, #1A1A1A);
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-bottom: 36px;
}

#hero-discovery {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

#hero-discovery.yn-hero-state {
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
}

@media (min-width: 769px) {
  body[data-flow-state="discovery"] #hero-discovery,
  body[data-flow-state="discovery"] #hero-discovery.active,
  body[data-flow-state="discovery"] #yn-product-discovery-root,
  body[data-flow-state="discovery"] .yn-pd-container {
    display: flex !important;
  }
}

/* ─── Top Header Bar (Mathematically Centered YUMNAI) ───────── */
.yn-pd-topbar {
  width: 100%;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 247, 243, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.yn-pd-back-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ink, #1A1A1A);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
  padding: 0;
}

.yn-pd-back-btn:active {
  transform: translateY(-50%) scale(0.92);
  background: rgba(0, 0, 0, 0.05);
}

.yn-pd-brand-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--ink, #1A1A1A);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Body Wrapper ──────────────────────────────────────────── */
.yn-pd-body {
  width: 100%;
  padding: 16px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ─── Sub-Headings & Editorial Hierarchy ─────────────────────── */
.yn-pd-subhead-wrap {
  text-align: center;
  margin: 12px 0 24px 0;
}

.yn-pd-pretitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent, #945B4B);
  margin-bottom: 6px;
}

.yn-pd-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink, #1A1A1A);
  letter-spacing: 0.02em;
  margin: 0 0 6px 0;
}

.yn-pd-subtext {
  font-size: 0.82rem;
  color: #666666;
  margin: 0;
  line-height: 1.4;
}

.yn-pd-gender-view,
.yn-pd-category-view,
.yn-pd-products-view {
  padding-top: 24px;
}

.yn-pd-gender-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.yn-pd-gender-card {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.yn-pd-gender-card:active {
  transform: scale(0.98);
  border-color: var(--accent, #945B4B);
  box-shadow: 0 6px 20px rgba(148, 91, 75, 0.12);
}

.yn-pd-gender-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FAF3EE;
  color: var(--ink, #1A1A1A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.yn-pd-gender-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink, #1A1A1A);
  margin: 0 0 6px 0;
}

.yn-pd-gender-desc {
  font-size: 0.82rem;
  color: #666666;
  margin: 0;
}

/* ─── Screen 2: Dynamic Category Selection ──────────────────── */
.yn-pd-category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yn-pd-category-card {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.yn-pd-category-card:active {
  transform: scale(0.985);
  border-color: var(--accent, #945B4B);
  box-shadow: 0 4px 16px rgba(148, 91, 75, 0.1);
}

.yn-pd-cat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.yn-pd-cat-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink, #1A1A1A);
}

.yn-pd-cat-count {
  font-size: 0.78rem;
  color: #777777;
}

.yn-pd-cat-arrow {
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Screen 3: Matched Products Header & Chips ─────────────── */
.yn-pd-results-banner {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.yn-pd-banner-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yn-pd-banner-pre {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent, #945B4B);
}

.yn-pd-banner-season-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yn-pd-banner-season {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink, #1A1A1A);
  margin: 0;
}

.yn-pd-banner-match {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2E7D32;
  background: rgba(46, 125, 50, 0.09);
  padding: 3px 8px;
  border-radius: 12px;
}

.yn-pd-context-pill {
  font-size: 0.8rem;
  font-weight: 500;
  color: #666666;
  margin-top: 2px;
}

/* Horizontal Color Filter Chips */
.yn-pd-chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.yn-pd-chips-container::-webkit-scrollbar {
  display: none;
}

.yn-pd-chip {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #555555;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.yn-pd-chip.active {
  background: var(--ink, #1A1A1A);
  color: #FFFFFF;
  border-color: var(--ink, #1A1A1A);
}

/* ─── Product Cards Grid ────────────────────────────────────── */
.yn-pd-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.yn-pd-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.yn-pd-card:active {
  transform: scale(0.975);
}

.yn-pd-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #F4EFEA;
  overflow: hidden;
}

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

.yn-pd-store-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.yn-badge-libas {
  background: rgba(128, 0, 32, 0.9);
  color: #FFFFFF;
}

.yn-badge-amazon {
  background: rgba(230, 122, 0, 0.92);
  color: #FFFFFF;
}

.yn-pd-card-info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.yn-pd-card-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink, #1A1A1A);
  line-height: 1.35;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}

.yn-pd-card-prices {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.yn-pd-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink, #1A1A1A);
}

.yn-pd-orig-price {
  font-size: 0.72rem;
  color: #888888;
  text-decoration: line-through;
}

.yn-pd-discount {
  font-size: 0.65rem;
  font-weight: 700;
  color: #C62828;
}

.yn-pd-avail-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #777777;
}

.yn-pd-match-badge-row {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yn-pd-color-tag {
  display: flex;
  align-items: center;
  gap: 5px;
}

.yn-pd-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.yn-pd-color-name {
  font-size: 0.7rem;
  color: #444444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.yn-pd-score-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1B5E20;
  background: #E8F5E9;
  padding: 3px 6px;
  border-radius: 6px;
  text-align: center;
}

/* ─── Load More & Loading Helpers ───────────────────────────── */
.yn-pd-load-more-wrap {
  text-align: center;
  margin-top: 20px;
}

.yn-pd-btn-load-more {
  width: 100%;
  padding: 13px 20px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #1A1A1A);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.yn-pd-btn-load-more:active {
  background: #F4EFEA;
}

.yn-pd-loading-spinner {
  text-align: center;
  padding: 40px 20px;
  font-size: 0.85rem;
  color: #777777;
  grid-column: 1 / -1;
}

.yn-pd-empty-msg {
  text-align: center;
  padding: 40px 20px;
  font-size: 0.85rem;
  color: #777777;
}
