/* ================================================================
   NeoSkin Demo — Stylesheet
   ================================================================
   Reference styling for a skincare PDP that mirrors the structure
   of the Beauty/VTO demos but tones the palette down for skincare:
   cool neutrals, generous whitespace, soft pastels for swatches.
   ================================================================ */

/* ─── Reset & Base ─────────────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Mirrors libs/shared/ui/src/styles/_colours.scss so the demo page reads
   as part of the app family. The brand accent is a two-stop gradient
   (gold → peach); the solid accent falls back to the primary stop. */
:root {
  --color-primary: #f1b301;
  --color-secondary: #ffc0ab;
  --gradient-accent: linear-gradient(
    105deg,
    var(--color-primary) 0%,
    var(--color-secondary) 100%
  );
  --accent-soft-bg: rgba(241, 179, 1, 0.12);
  --accent-soft-fg: #8a6500;
  --accent-shadow: rgba(241, 179, 1, 0.32);
}

body {
  font-family:
    'Open Sans',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  background-color: #fafaf8;
  color: #2a2a2a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ───────────────────────────────────────────────────── */

.header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .brand {
  position: absolute;
  left: 24px;
  display: inline-flex;
  align-items: center;
}
.header .brand img {
  height: 28px;
  width: auto;
}

#header-categories {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-cat-tile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 999px;
  font:
    700 11px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.header-cat-tile:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.22);
  color: #1f2421;
}
.header-cat-tile.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-shadow);
}
.tile-chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
}

/* ─── Category dropdowns ───────────────────────────────────────── */

.cat-dropdown {
  position: fixed;
  transform: translateX(-50%) translateY(-8px);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 8px;
  min-width: 220px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.cat-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Accordion group: a product type header + its 6 products */
.cat-dd-group {
  border-radius: 8px;
  overflow: hidden;
}
.cat-dd-group + .cat-dd-group {
  margin-top: 2px;
}

.cat-dd-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  font:
    700 11px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #2a2a2a;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cat-dd-subhead:hover {
  background: #f4f1ec;
}
.dd-chev {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
  color: #888;
}
.cat-dd-group.expanded .dd-chev {
  transform: rotate(180deg);
}

.cat-dd-lines {
  display: none;
  padding: 4px 0 6px;
}
.cat-dd-group.expanded .cat-dd-lines {
  display: block;
}

.cat-dd-line {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px 8px 24px;
  background: transparent;
  border: none;
  font:
    500 13px/1.35 'Open Sans',
    sans-serif;
  color: #4a4a4a;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.cat-dd-line:hover {
  background: #f4f1ec;
  color: #1f2421;
}
.cat-dd-line.active {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-fg);
  font-weight: 600;
}

/* ─── Loading & Error States ───────────────────────────────────── */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 20px;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-text {
  color: #777;
  font-size: 14px;
}
.error {
  text-align: center;
  padding: 60px 20px;
  color: #c0392b;
}

/* ─── Layout ───────────────────────────────────────────────────── */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 28px 96px;
}

/* ─── Product hero (desktop) ───────────────────────────────────── */

.product-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  margin-bottom: 64px;
}

.product-image-container {
  background: linear-gradient(160deg, #f1ede5 0%, #e7e0d5 100%);
  border-radius: 16px;
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.product-image {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.1));
}

/* Right column */
.product-details {
  padding-top: 12px;
}

.product-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font:
    700 11px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary);
  margin-bottom: 14px;
}

.product-line {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.1;
  color: #1f2421;
  margin-bottom: 10px;
}

.product-price {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 28px;
  color: #2a2a2a;
}

/* ─── About / How to apply ─────────────────────────────────────── */

.about-product {
  margin-bottom: 24px;
}

.about-title {
  font:
    700 11px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #777;
  margin-bottom: 10px;
}

.about-description {
  font-size: 15px;
  color: #4a4a4a;
  line-height: 1.7;
}

.apply-block {
  margin-top: 18px;
}

/* ─── Tags (concerns / skin types) ─────────────────────────────── */

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  background: #f0ece4;
  color: #5a5750;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-soft {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-fg);
}

/* ─── CTAs ─────────────────────────────────────────────────────── */

.ask-ai-btn,
.try-on-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 28px;
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font:
    700 13px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px var(--accent-shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}
.ask-ai-btn:hover,
.try-on-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--accent-shadow);
}

/* Same three-stars mark as the floating widget button. Source lives at
   libs/shared/assets/public/icons/three-stars.svg and is mirrored as
   `THREE_STARS_SVG` inside widget-launcher.js. */
.ask-ai-icon {
  width: 18px;
  height: 20px;
  background: url('/icons/three-stars.svg') center / contain no-repeat;
}

.add-to-bag,
.mobile-add-to-bag {
  display: block;
  width: 100%;
  padding: 16px 28px;
  background: transparent;
  color: #1f2421;
  border: 1.5px solid #1f2421;
  border-radius: 999px;
  font:
    600 13px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}
.add-to-bag:hover,
.mobile-add-to-bag:hover {
  background: #1f2421;
  color: #fff;
}

/* ─── Ingredients section ──────────────────────────────────────── */

.ingredients-section {
  margin-top: 80px;
  padding-top: 56px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  color: #1f2421;
  text-align: center;
  margin-bottom: 36px;
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.ingredient-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 22px;
}
.ingredient-card h4 {
  font:
    700 13px/1 'Open Sans',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.ingredient-card p {
  font-size: 13.5px;
  color: #5a5a5a;
  line-height: 1.6;
}

/* ─── Mobile-only elements (hidden on desktop) ─────────────────── */

.mobile-product-info,
.mobile-image-container,
.mobile-about-product,
.mobile-add-to-bag {
  display: none;
}

/* ─── Mobile styles ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .header {
    height: 56px;
    padding: 0 16px;
  }
  .header .brand {
    left: 16px;
  }
  .header .brand img {
    height: 22px;
  }
  #header-categories {
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 4px;
    margin-left: 110px;
    -webkit-overflow-scrolling: touch;
  }
  #header-categories::-webkit-scrollbar {
    display: none;
  }
  .header-cat-tile {
    padding: 7px 12px;
    font-size: 10px;
  }

  .main-content {
    padding: 24px 16px 96px;
  }

  /* Hide desktop layout */
  .product-hero {
    display: none;
  }

  /* Show mobile sections */
  .mobile-product-info {
    display: block;
    text-align: center;
    margin-bottom: 16px;
  }
  .mobile-product-info .product-eyebrow {
    margin-bottom: 8px;
  }
  .mobile-product-info .product-line {
    font-size: 26px;
  }
  .mobile-product-info .product-price {
    margin-bottom: 0;
  }

  .mobile-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f1ede5 0%, #e7e0d5 100%);
    border-radius: 16px;
    padding: 32px;
    aspect-ratio: 1;
    margin-bottom: 24px;
  }
  .mobile-image-container img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.1));
  }

  .mobile-about-product {
    display: block;
    text-align: center;
    margin-bottom: 24px;
  }
  .mobile-about-product .about-description {
    text-align: left;
  }
  .mobile-about-product .apply-block {
    text-align: left;
  }

  .mobile-add-to-bag {
    display: block;
  }

  .ingredients-section {
    margin-top: 48px;
    padding-top: 36px;
  }
  .section-title {
    font-size: 24px;
  }
}

/* ─── Onboarding tooltip ───────────────────────────────────────── */

.neoai-onboarding {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 999998;
  max-width: 360px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: neoai-tooltip-in 0.4s ease 1.5s forwards;
}
.neoai-onboarding::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 24px;
  width: 16px;
  height: 16px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.06);
}
.neoai-onboarding-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.neoai-onboarding-text {
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 12px;
}
.neoai-onboarding-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.3px;
}
.neoai-onboarding.hidden {
  display: none;
}

@keyframes neoai-tooltip-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .neoai-onboarding {
    right: 12px;
    bottom: 90px;
    max-width: 260px;
    padding: 16px;
  }
}
