/* ==========================================================================
   moodbuying.com — Mood-Adaptive Discovery Platform
   Stylesheet: CSS Variables + Editorial Styling
   All mood-variable properties use var(--...), never hardcoded values.
   Bootstrap utilities handle grid layout; custom CSS is for mood theming only.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Property Declarations
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  --color-dark: #27445D;
  --color-primary: #497D74;
  --color-accent: #71BBB2;
  --color-warm-bg: #EFE9D5;
  --color-white: #ffffff;
  --color-text: #2c3e50;
  --color-text-muted: #6c757d;

  /* Mood-driven defaults (cozy) */
  --text-weight-narrative: 600;
  --text-weight-heading: 700;
  --text-weight-body: 400;
  --text-weight-caption: 300;
  --color-saturation: 75%;
  --spacing-card: 18px;
  --animation-duration: 350ms;
  --spacing-level: generous;

  /* Vibe-driven hue + accent defaults (warm) */
  --primary-hue: 163;
  --accent-hue: 172;
  --color-text-accent: #6b5b3e;

  /* Derived adaptive colors */
  --color-primary-adaptive: hsl(var(--primary-hue), var(--color-saturation), 35%);
  --color-accent-adaptive: hsl(var(--accent-hue), var(--color-saturation), 58%);

  /* Layout */
  --header-height: 64px;
  --card-border-radius: 16px;
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.14);
}

/* --------------------------------------------------------------------------
   2. Base / Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-warm-bg);
  color: var(--color-text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: var(--text-weight-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--text-weight-heading);
  line-height: 1.2;
  color: var(--color-dark);
}

.text-narrative {
  font-weight: var(--text-weight-narrative);
  font-style: italic;
  color: var(--color-primary);
  line-height: 1.5;
}

.text-caption {
  font-weight: var(--text-weight-caption);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   3b. Sub-Screen Header — Back button + title bar for non-home views
   -------------------------------------------------------------------------- */
.sub-screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 8px;
}

.back-btn {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-dark);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all var(--animation-duration) ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn:hover {
  background: var(--color-warm-bg);
  transform: scale(1.05);
}

.sub-screen-title {
  font-size: 1.1rem;
  font-weight: var(--text-weight-heading);
  color: var(--color-dark);
}

/* Mood selector overlay variant — light text on dark overlay */
.mood-selector-header {
  padding: 0 0 16px;
}

.mood-selector-header .back-btn {
  color: var(--color-warm-bg);
  border-color: rgba(255, 255, 255, 0.25);
}

.mood-selector-header .back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mood-selector-header .sub-screen-title {
  color: var(--color-warm-bg);
  font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   4. Header — Fixed size, no collapsing
   -------------------------------------------------------------------------- */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--color-dark), var(--color-primary));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-white);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: var(--header-height);
}

.header-brand {
  font-size: 1.2rem;
  font-weight: var(--text-weight-heading);
  letter-spacing: 0.3px;
  color: var(--color-warm-bg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-brand i {
  font-size: 1.1rem;
  color: var(--color-accent);
}

.brand-text {
  white-space: nowrap;
}

.brand-tld {
  opacity: 0.6;
  font-weight: 400;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-subtitle {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-accent);
  letter-spacing: 0.3px;
  margin-top: 2px;
}

@media (max-width: 374px) {
  .brand-tld {
    display: none;
  }
  .header-brand {
    font-size: 1.1rem;
  }
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--color-warm-bg);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all var(--animation-duration) ease;
  position: relative;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.header-icon-btn.nav-active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-accent);
}

.header-icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 0.65rem;
  padding: 2px 5px;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 10px;
  font-weight: 700;
}

/* Collapsible controls area */
.header-controls {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--animation-duration) ease,
              padding var(--animation-duration) ease;
  padding: 0 16px;
}

.header-controls.expanded {
  max-height: 400px;
  padding: 8px 16px 16px;
}

.header-toggle-btn {
  background: none;
  border: none;
  color: var(--color-warm-bg);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 2px 12px;
  opacity: 0.7;
  transition: all var(--animation-duration) ease;
  position: relative;
}



.header-toggle-btn:hover {
  opacity: 1;
}

.header-toggle-btn i {
  transition: transform var(--animation-duration) ease;
}

.header-toggle-btn.active i {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   5. Mood Selector — Scrollable Grid for 51 Moods
   -------------------------------------------------------------------------- */
.mood-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: rgba(39, 68, 93, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--animation-duration) ease;
}

.mood-selector-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.mood-selector-container {
  text-align: center;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}

.mood-selector-container::-webkit-scrollbar {
  width: 5px;
}

.mood-selector-container::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}

.mood-selector-container::-webkit-scrollbar-track {
  background: transparent;
}

.mood-selector-title {
  color: var(--color-warm-bg);
  font-size: 1.4rem;
  font-weight: var(--text-weight-heading);
  margin-bottom: 20px;
}

.mood-section-label {
  color: var(--color-warm-bg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.5;
  margin: 20px 0 10px;
  text-align: left;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  text-align: left;
}

.mood-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--animation-duration) ease;
  color: var(--color-warm-bg);
}

.mood-tile:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(113, 187, 178, 0.4);
}

.mood-tile.active {
  background: rgba(113, 187, 178, 0.25);
  border-color: var(--color-accent);
}

.mood-tile-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.mood-tile-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mood-tile.temporal {
  background: rgba(255, 255, 255, 0.05);
}

.mood-tile.temporal:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   6. Product Cards
   -------------------------------------------------------------------------- */
.product-card {
  background: var(--color-white);
  border-radius: var(--card-border-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all var(--animation-duration) ease;
  padding: 0;
  margin-bottom: var(--spacing-card);
  cursor: default;
}

.product-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e0d0, #d4cfc2);
}

/* Aesthetic background layer — placeholder image per mood */
.card-bg-aesthetic {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

/* Product thumbnail overlaid on the background */
.card-product-thumb {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 55%;
  max-width: 200px;
  z-index: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid var(--color-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.1);
  background: var(--color-white);
  transition: transform var(--animation-duration) ease, box-shadow var(--animation-duration) ease;
}

.card-product-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.product-card:hover .card-product-thumb {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card-body-content {
  padding: var(--spacing-card);
}

/* Tier 1: Mood trigger narrative */
.card-narrative {
  font-weight: var(--text-weight-narrative);
  font-style: italic;
  color: var(--color-primary);
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Tier 2: Title */
.card-title-text,
.card-title-link {
  font-weight: var(--text-weight-heading);
  font-size: 1rem;
  color: var(--color-dark);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Clickable card links (image + title) */
.card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-image-link {
  display: block;
}

.card-title-link:hover {
  color: var(--color-primary-adaptive);
}

/* Tier 3: Transparency bar */
.card-transparency {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
}

.card-price {
  font-weight: var(--text-weight-heading);
  font-size: 1.15rem;
  color: var(--color-dark);
}

.card-shipping {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.card-shipping.free-shipping {
  color: var(--color-primary);
  font-weight: 500;
}

.card-delivery {
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 500;
}

/* Tier 4: Actions */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.card-save-btn,
.card-detail-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--animation-duration) ease;
}

.card-save-btn {
  color: var(--color-text-muted);
}

.card-save-btn:hover,
.card-save-btn.liked {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}

/* heart-fill icon handled by JS toggling bi-heart / bi-heart-fill classes */

.card-detail-btn {
  color: var(--color-primary);
  font-weight: 600;
}

.card-detail-btn:hover {
  background: rgba(73, 125, 116, 0.1);
}

.card-vendor-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-dark);
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   6b. Card Template Variants
   -------------------------------------------------------------------------- */

/* Bold card (explorer persona - adventurous, energetic) */
.card-bold .card-narrative {
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.card-bold .card-image-wrapper {
  aspect-ratio: 16 / 10;
}

.card-contrast-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 6px;
  padding: 3px 8px;
  background: rgba(113, 187, 178, 0.08);
  border-radius: 6px;
  display: inline-block;
}

.card-feature-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-feature-list li {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.03);
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Soft card (soother persona - cozy, calm) */
.card-soft .card-narrative {
  font-style: italic;
  font-weight: var(--text-weight-narrative);
}

.card-emotion-tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 6px;
  opacity: 0.85;
}

.card-copy-blurb {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 4px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Palette overrides */
.palette-vivid .card-narrative {
  color: var(--color-dark);
}

/* Image badge overlay */
.card-image-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
}

.card-image-badge.bold-badge {
  background: rgba(39, 68, 93, 0.85);
  color: var(--color-warm-bg);
}

/* --------------------------------------------------------------------------
   7. Card Feed — Editorial Rhythm
   -------------------------------------------------------------------------- */
#card-feed {
  padding-top: calc(var(--header-height) + 36px);
  padding-bottom: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.feed-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-card);
  padding: 0 8px;
}

.feed-col-full {
  flex: 0 0 100%;
  max-width: 100%;
}

.feed-col-half {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Hero card (full-width) — every 3rd card */
.feed-col-full .product-card .card-image-wrapper {
  aspect-ratio: 16 / 9;
}

.feed-col-full .product-card .card-product-thumb {
  width: 45%;
  max-width: 240px;
}

.feed-col-full .product-card .card-narrative {
  font-size: 1rem;
}

/* Chain divider — subtle visual break between pathway chains */
.chain-divider {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.chain-divider span {
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  opacity: 0.15;
}

/* End of feed message */
.feed-end {
  flex: 0 0 100%;
  text-align: center;
  padding: 40px 20px;
}

.feed-end-message {
  color: var(--color-text-muted);
}

.feed-end-message i {
  font-size: 2rem;
  opacity: 0.4;
  margin-bottom: 8px;
  display: block;
  color: var(--color-primary);
}

.feed-end-message p {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.feed-end-message span {
  font-size: 0.82rem;
  opacity: 0.6;
}

/* Loading spinner */
.feed-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.feed-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(73, 125, 116, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sentinel for infinite scroll */
.feed-sentinel {
  height: 1px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   8. Category Grid
   -------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--animation-duration) ease;
  color: var(--color-warm-bg);
  font-size: 0.7rem;
  text-align: center;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.category-item.active {
  border-color: var(--color-accent);
  background: rgba(113, 187, 178, 0.2);
}

.category-item i {
  font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   9. Budget Buttons
   -------------------------------------------------------------------------- */
.budget-group {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.budget-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  color: var(--color-warm-bg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--animation-duration) ease;
}

.budget-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.budget-btn.active {
  border-color: var(--color-accent);
  background: rgba(113, 187, 178, 0.25);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   10. Liked / Clicked Tile Grids
   -------------------------------------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 8px;
}

.tile-card {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all var(--animation-duration) ease;
  cursor: pointer;
}

.tile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.tile-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.tile-card-info {
  padding: 10px;
}

.tile-card-title {
  font-size: 0.82rem;
  font-weight: var(--text-weight-body);
  color: var(--color-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.tile-card-price {
  font-size: 0.9rem;
  font-weight: var(--text-weight-heading);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   11. (Removed — bottom navigation no longer used)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   12. Profile View
   -------------------------------------------------------------------------- */
.profile-view {
  padding: 24px 16px;
  max-width: 600px;
  margin: 0 auto;
}

.profile-header {
  text-align: center;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 2rem;
  color: var(--color-white);
}

.profile-section {
  background: var(--color-white);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.profile-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--color-dark);
}

.profile-action-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: rgba(73, 125, 116, 0.1);
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  text-align: left;
  font-size: 0.9rem;
  transition: all var(--animation-duration) ease;
}

.profile-action-btn:hover {
  background: rgba(73, 125, 116, 0.2);
}

.profile-action-btn.danger {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}

.profile-action-btn.danger:hover {
  background: rgba(231, 76, 60, 0.15);
}

/* Budget Threshold Controls */
.threshold-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.threshold-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.threshold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(73, 125, 116, 0.06);
  border-radius: 8px;
}

.threshold-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-dark);
  margin: 0;
}

.threshold-emoji {
  font-size: 1.1rem;
}

.threshold-input-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-white);
  border: 1px solid rgba(73, 125, 116, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
}

.threshold-currency {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.threshold-input {
  width: 64px;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-dark);
  background: transparent;
  text-align: right;
  -moz-appearance: textfield;
}

.threshold-input::-webkit-outer-spin-button,
.threshold-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.threshold-input:focus {
  color: var(--color-primary);
}

.threshold-row-readonly {
  background: rgba(73, 125, 116, 0.03);
}

.threshold-yolo-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   13. Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 4px;
}

.empty-state .empty-hint {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ─── Mantra Cards ──────────────────────────────────────── */

/* ─── Editorial Content Blocks ──────────────────────────── */
.content-block {
  padding: 24px var(--spacing-card);
  max-width: 640px;
  margin: 8px auto;
}

.content-block-title {
  font-weight: var(--text-weight-heading);
  font-size: 1.15rem;
  color: var(--color-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.content-block-body p {
  font-size: 0.92rem;
  font-weight: var(--text-weight-body);
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 10px;
}

.content-block-body p:last-child {
  margin-bottom: 0;
}

/* ─── Editorial Quote Blocks ────────────────────────────── */
.quote-block {
  padding: 32px;
  max-width: 560px;
  margin: 16px auto;
  text-align: center;
}

.quote-block-mark {
  font-size: 4rem;
  line-height: 1;
  color: var(--color-primary-adaptive);
  opacity: 0.15;
  pointer-events: none;
}

.quote-block-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0 0 12px;
}

.quote-block-attribution {
  font-size: 0.8rem;
  font-variant: small-caps;
  color: var(--color-text-muted);
  letter-spacing: 0.5px;
}

/* ─── Mantra Cards ──────────────────────────────────────── */
.mantra-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  box-shadow: none;
  border: none;
  /* Organic rough-edge mask with spatter transition:
     1. Coarse turbulence displaces the rect for organic shape
     2. Gaussian blur softens the hard edge into a gradient zone
     3. Fine turbulence re-displaces the softened edge, scattering it
        into spatter dots that dissolve into the page background */
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><defs><filter id='f' x='-5%25' y='-5%25' width='110%25' height='110%25'><feTurbulence baseFrequency='0.04' numOctaves='4' seed='2' type='fractalNoise' result='noise'/><feDisplacementMap in='SourceGraphic' in2='noise' scale='20' xChannelSelector='R' yChannelSelector='G' result='displaced'/><feGaussianBlur in='displaced' stdDeviation='3' result='soft'/><feTurbulence baseFrequency='0.12' numOctaves='3' seed='5' type='fractalNoise' result='grain'/><feDisplacementMap in='soft' in2='grain' scale='8' xChannelSelector='R' yChannelSelector='G'/></filter></defs><rect x='8' y='8' width='384' height='384' rx='8' fill='white' filter='url(%23f)'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><defs><filter id='f' x='-5%25' y='-5%25' width='110%25' height='110%25'><feTurbulence baseFrequency='0.04' numOctaves='4' seed='2' type='fractalNoise' result='noise'/><feDisplacementMap in='SourceGraphic' in2='noise' scale='20' xChannelSelector='R' yChannelSelector='G' result='displaced'/><feGaussianBlur in='displaced' stdDeviation='3' result='soft'/><feTurbulence baseFrequency='0.12' numOctaves='3' seed='5' type='fractalNoise' result='grain'/><feDisplacementMap in='soft' in2='grain' scale='8' xChannelSelector='R' yChannelSelector='G'/></filter></defs><rect x='8' y='8' width='384' height='384' rx='8' fill='white' filter='url(%23f)'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

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

.mantra-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 8%;
  pointer-events: none;
}

.mantra-card-overlay p {
  margin: 0;
  line-height: 1.3;
  max-width: 90%;
}

.mantra-text-backdrop {
  display: inline-block;
  border-radius: 16px;
  padding: 12px 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1.4;
  max-width: 85%;
}

/* --------------------------------------------------------------------------
   14. Section Labels
   -------------------------------------------------------------------------- */
.controls-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.6;
  margin-bottom: 8px;
  color: var(--color-warm-bg);
}

/* --------------------------------------------------------------------------
   15. Responsive Overrides
   -------------------------------------------------------------------------- */
@media (min-width: 576px) {
  .feed-col-half {
    flex: 0 0 calc(50% - calc(var(--spacing-card) / 2));
    max-width: calc(50% - calc(var(--spacing-card) / 2));
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mood-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .feed-col-half {
    flex: 0 0 calc(50% - calc(var(--spacing-card) / 2));
    max-width: calc(50% - calc(var(--spacing-card) / 2));
  }

  .category-grid {
    grid-template-columns: repeat(10, 1fr);
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #card-feed {
    padding-left: 24px;
    padding-right: 24px;
  }

  .mood-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  #card-feed {
    padding-left: 10vw;
    padding-right: 10vw;
    padding-bottom: 24px;
  }

  .tile-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   16. Vibe-Specific Overrides via [data-vibe]
   -------------------------------------------------------------------------- */

/* Vibrant: sharper shadows, tighter feel, bold accents */
[data-vibe="vibrant"] .product-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

[data-vibe="vibrant"] .product-card:hover {
  transform: translateY(-6px);
}

[data-vibe="vibrant"] .card-narrative {
  font-style: normal;
  font-weight: var(--text-weight-narrative);
  color: var(--color-dark);
}

[data-vibe="vibrant"] .card-product-thumb img {
  filter: saturate(1.15) contrast(1.05);
}

[data-vibe="vibrant"] .chain-divider span {
  background: var(--color-accent);
  opacity: 0.3;
}

/* Bold: exploratory, vivid */
[data-vibe="bold"] .product-card {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  border-radius: 14px;
}

[data-vibe="bold"] .product-card:hover {
  transform: translateY(-5px) scale(1.01);
}

[data-vibe="bold"] .card-narrative {
  font-style: normal;
  font-weight: 700;
  color: var(--color-dark);
}

[data-vibe="bold"] .card-product-thumb img {
  filter: saturate(1.1);
}

[data-vibe="bold"] .chain-divider span {
  width: 50px;
  background: var(--color-dark);
  opacity: 0.2;
}

/* Serene: softer corners, muted palette */
[data-vibe="serene"] .product-card {
  border-radius: 20px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

[data-vibe="serene"] .product-card:hover {
  transform: translateY(-2px);
}

[data-vibe="serene"] .card-product-thumb img {
  filter: saturate(0.85);
}

[data-vibe="serene"] .chain-divider span {
  width: 30px;
  opacity: 0.1;
}

/* Warm: inviting defaults */
[data-vibe="warm"] .product-card {
  border: 1px solid rgba(239, 233, 213, 0.5);
}

[data-vibe="warm"] .card-narrative {
  color: var(--color-text-accent);
}

[data-vibe="warm"] .chain-divider span {
  background: var(--color-text-accent);
  opacity: 0.12;
}

/* Vibe overrides — editorial content & quotes */
[data-vibe="serene"] .quote-block-text {
  font-size: 1.3rem;
  line-height: 1.7;
}

[data-vibe="bold"] .content-block-title {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-vibe="vibrant"] .quote-block-mark {
  opacity: 0.25;
}

[data-vibe="warm"] .content-block-body p {
  color: var(--color-text-accent);
}

/* --------------------------------------------------------------------------
   17. Utility / Animation Helpers
   -------------------------------------------------------------------------- */
.fade-in {
  animation: fadeIn var(--animation-duration) ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Smooth transitions for all mood-variable-driven properties */
.mood-transition {
  transition: all var(--animation-duration) ease;
}

/* Hide scrollbar for a cleaner editorial feel */
body::-webkit-scrollbar {
  width: 6px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   18. (Brand subtitle styles moved to header section above)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   19. Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  display: block;
  width: 100%;
  text-align: center;
  padding: 24px 16px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.footer-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   20. Legal Page Views (Terms, Privacy, About)
   -------------------------------------------------------------------------- */
.legal-page {
  padding: 24px 16px;
  max-width: 600px;
  margin: 0 auto;
}

.legal-page-body {
  background: var(--color-white);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-dark);
}

.legal-page-body h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 16px 0 6px;
  color: var(--color-dark);
}

.legal-page-body p {
  margin-bottom: 10px;
}

.legal-page-body a {
  color: var(--color-primary);
  text-decoration: underline;
}
