/* ==========================================================================
   Hautberatung – Shopify Storefront Skin Advisor Styles
   Scoped under .hb-section-wrapper / .hb-app for clean theme integration
   ========================================================================== */

.hb-section-wrapper {
  --hb-accent: #2f5d50;
  --hb-accent-hover: #23473d;
  --hb-accent-soft: #eaf2ee;
  --hb-accent-border: #b8d2c7;
  --hb-bg: #faf8f5;
  --hb-surface: #ffffff;
  --hb-surface-subtle: #f4f1ec;
  --hb-text: #1c2420;
  --hb-text-muted: #5a6560;
  --hb-border: #e5dfd6;
  --hb-border-hover: #c9bfb0;
  --hb-radius: 14px;
  --hb-radius-sm: 10px;
  --hb-shadow: 0 2px 10px rgba(28, 36, 32, 0.04);
  --hb-shadow-hover: 0 6px 20px rgba(28, 36, 32, 0.08);
  --hb-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  background-color: var(--hb-bg);
  color: var(--hb-text);
  font-family: var(--hb-font);
  padding: clamp(24px, 4vw, 48px) clamp(14px, 3vw, 28px);
  box-sizing: border-box;
  line-height: 1.45;
}

.hb-section-wrapper *,
.hb-section-wrapper *::before,
.hb-section-wrapper *::after {
  box-sizing: border-box;
}

.hb-app {
  max-width: 1240px;
  margin: 0 auto;
}

.hb-loading,
.hb-error {
  text-align: center;
  padding: 48px 20px;
  color: var(--hb-text-muted);
  font-size: 15px;
}

/* Header */
.hb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hb-border);
}

.hb-header-copy {
  max-width: 720px;
}

.hb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-accent);
  margin-bottom: 6px;
}

.hb-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hb-text);
  line-height: 1.18;
}

.hb-subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--hb-text-muted);
}

.hb-progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 210px;
}

.hb-progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--hb-text-muted);
}

.hb-progress-count strong {
  color: var(--hb-text);
}

.hb-reset-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--hb-text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.hb-reset-btn:hover {
  border-color: var(--hb-text);
  color: var(--hb-text);
  background: var(--hb-surface);
}

.hb-reset-btn[hidden] {
  display: none;
}

.hb-progress-track {
  width: 210px;
  height: 6px;
  background: var(--hb-border);
  border-radius: 999px;
  overflow: hidden;
}

.hb-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--hb-accent);
  border-radius: 999px;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Main Split Grid: All 6 questions on left, live results sticky on right */
.hb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(350px, 0.95fr);
  gap: 28px;
  align-items: start;
}

/* Questions Column */
.hb-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hb-q-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  padding: 20px 22px;
  box-shadow: var(--hb-shadow);
  transition: border-color 0.2s ease;
}

.hb-q-card.is-answered {
  border-color: var(--hb-accent-border);
}

.hb-q-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hb-q-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hb-q-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--hb-surface-subtle);
  color: var(--hb-text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
  transition: all 0.2s ease;
}

.hb-q-card.is-answered .hb-q-num {
  background: var(--hb-accent);
  color: #ffffff;
}

.hb-q-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--hb-text);
  line-height: 1.35;
}

.hb-q-subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--hb-text-muted);
}

.hb-q-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--hb-surface-subtle);
  color: var(--hb-text-muted);
  white-space: nowrap;
}

.hb-q-badge.is-active {
  background: var(--hb-accent-soft);
  color: var(--hb-accent);
}

.hb-q-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #9a4b25;
  background: #fdf2ec;
  border: 1px solid #f2d2c2;
  padding: 7px 11px;
  border-radius: 8px;
}

.hb-q-hint[hidden] {
  display: none;
}

/* Option Grids */
.hb-options {
  display: grid;
  gap: 9px;
}

.hb-options--pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hb-options--cards-1 {
  grid-template-columns: 1fr;
}

.hb-options--cards-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hb-options--cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Option Button */
.hb-opt {
  appearance: none;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--hb-radius-sm);
  border: 1.5px solid var(--hb-border);
  background: var(--hb-surface);
  color: var(--hb-text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.hb-options--pills .hb-opt {
  width: auto;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  text-align: center;
}

.hb-opt:hover {
  border-color: var(--hb-border-hover);
  background: #fcfbf9;
}

.hb-opt:focus-visible {
  outline: 2px solid var(--hb-accent);
  outline-offset: 2px;
}

.hb-opt.is-selected {
  border-color: var(--hb-accent);
  background: var(--hb-accent-soft);
  box-shadow: 0 0 0 1px var(--hb-accent) inset;
}

.hb-opt-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1.5px solid var(--hb-border-hover);
  background: var(--hb-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  transition: all 0.15s ease;
}

.hb-opt--multi .hb-opt-check {
  border-radius: 5px;
}

.hb-options--pills .hb-opt-check {
  display: none;
}

.hb-opt.is-selected .hb-opt-check {
  background: var(--hb-accent);
  border-color: var(--hb-accent);
  color: #ffffff;
}

.hb-opt-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hb-opt-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--hb-text);
  line-height: 1.3;
}

.hb-opt.is-selected .hb-opt-label {
  color: var(--hb-accent);
}

.hb-opt-desc {
  font-size: 12.5px;
  color: var(--hb-text-muted);
  line-height: 1.35;
}

/* Sticky Results Column */
.hb-results-col {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Advice Summary Card */
.hb-advice-card {
  background: linear-gradient(155deg, #eef5f1 0%, #f7f4ee 100%);
  border: 1px solid var(--hb-accent-border);
  border-radius: var(--hb-radius);
  padding: 18px 20px;
}

.hb-advice-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hb-accent);
  margin-bottom: 4px;
}

.hb-advice-headline {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--hb-text);
}

.hb-advice-summary {
  margin: 0;
  font-size: 13.5px;
  color: var(--hb-text-muted);
  line-height: 1.5;
}

.hb-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hb-profile-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--hb-accent-border);
  color: var(--hb-accent);
}

.hb-advice-tips {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(47, 93, 80, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hb-advice-tips li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--hb-text);
  line-height: 1.4;
}

.hb-advice-tips li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--hb-accent);
  font-weight: 700;
}

/* Per-Answer Consultation Notes (presented directly before products) */
.hb-consult-list {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(47, 93, 80, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hb-consult-item {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(47, 93, 80, 0.16);
  border-left: 3px solid var(--hb-accent);
  border-radius: 9px;
  padding: 10px 13px;
  animation: hbFadeSlide 0.2s ease both;
}

.hb-consult-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hb-accent);
  margin-bottom: 3px;
  line-height: 1.3;
}

.hb-consult-text {
  margin: 0;
  font-size: 12.8px;
  color: var(--hb-text);
  line-height: 1.48;
  white-space: pre-line;
}

/* Products Panel Header */
.hb-products-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hb-products-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--hb-text);
}

.hb-sort-toggle {
  display: inline-flex;
  background: var(--hb-surface-subtle);
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  padding: 2px;
}

.hb-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hb-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hb-sort-btn.is-active {
  background: var(--hb-surface);
  color: var(--hb-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Product Cards */
.hb-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hb-product-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  padding: 14px;
  box-shadow: var(--hb-shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  animation: hbFadeSlide 0.22s ease both;
}

.hb-product-card:hover {
  border-color: var(--hb-border-hover);
  box-shadow: var(--hb-shadow-hover);
}

.hb-product-card.is-top-match {
  border-color: var(--hb-accent-border);
}

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

.hb-product-img-link {
  display: block;
  width: 84px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--hb-surface-subtle);
  flex-shrink: 0;
}

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

.hb-product-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hb-product-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hb-routine-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--hb-surface-subtle);
  color: var(--hb-text);
  border: 1px solid var(--hb-border);
}

.hb-match-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--hb-accent);
  color: #ffffff;
}

.hb-match-badge.is-good {
  background: #4e7d6d;
}

.hb-match-badge.is-soft {
  background: #8a8376;
}

.hb-match-badge.is-featured {
  background: var(--hb-accent-soft);
  color: var(--hb-accent);
}

.hb-product-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.hb-product-title a {
  color: var(--hb-text);
  text-decoration: none;
}

.hb-product-title a:hover {
  color: var(--hb-accent);
  text-decoration: underline;
}

.hb-product-tip {
  margin: 0;
  font-size: 12.5px;
  color: var(--hb-text-muted);
  line-height: 1.4;
}

.hb-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hb-reason-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--hb-accent-soft);
  color: var(--hb-accent);
}

.hb-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--hb-surface-subtle);
}

.hb-product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--hb-text);
}

.hb-atc-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  background: var(--hb-accent);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}

.hb-atc-btn:hover {
  background: var(--hb-accent-hover);
}

.hb-atc-btn:active {
  transform: scale(0.98);
}

.hb-atc-btn.is-added {
  background: #1f7a4c;
}

.hb-atc-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Mobile Floating Bar */
.hb-mobile-bar {
  display: none;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hb-layout {
    grid-template-columns: 1fr;
  }

  .hb-results-col {
    position: static;
  }

  .hb-progress-wrap {
    align-items: flex-start;
  }

  .hb-mobile-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--hb-text);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    font-size: 13px;
  }

  .hb-mobile-bar[hidden] {
    display: none;
  }

  .hb-mobile-bar-btn {
    appearance: none;
    border: 0;
    background: var(--hb-accent);
    color: #ffffff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .hb-options--cards-2,
  .hb-options--cards-3 {
    grid-template-columns: 1fr;
  }

  .hb-q-card {
    padding: 16px;
  }

  .hb-product-card {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 12px;
  }

  .hb-product-img-link {
    width: 70px;
    height: 86px;
  }
}
