/* ── RECIPE DETAIL ───────────────────────────── */

.recipe {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Hero ─────────────────────────────────────── */

.recipe__hero {
  height: 240px;
  position: relative;
  flex-shrink: 0;
}

.recipe__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,.4) 100%);
}

.recipe__hero-controls {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.recipe__hero-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard);
}

.recipe__hero-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

.recipe__hero-title-wrap {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
}

.recipe__hero-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-semibold);
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.recipe__hero-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.recipe__hero-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.85);
}

.recipe__hero-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}

/* ── Scrollable body ──────────────────────────── */

.recipe__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--screen-padding) 0;
}

/* ── Meta ─────────────────────────────────────── */

.recipe__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.recipe__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-body-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-subtle);
}

.recipe__desc {
  font-size: var(--text-body-md);
  color: var(--color-text-subtle);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

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

.recipe__card {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  margin-bottom: var(--space-4);
}

/* ── Servings stepper ─────────────────────────── */

.recipe__servings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recipe__servings-label {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.recipe__servings-sub {
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-top: 2px;
}

.recipe__stepper {
  display: flex;
  align-items: center;
  background: var(--color-bg-muted);
  border-radius: 12px;
  padding: 4px;
  gap: 0;
}

.recipe__stepper-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: var(--fw-semibold);
  color: var(--color-brand-primary);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-standard);
}

.recipe__stepper-btn:active { background: rgba(0, 0, 0, 0.06); }

.recipe__stepper-val {
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
  width: 36px;
  text-align: center;
}

/* ── Match card ───────────────────────────────── */

.recipe__match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.recipe__match-title {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.recipe__match-pct {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
}

.recipe__match-bar {
  height: 6px;
  background: var(--color-border-subtle);
  border-radius: 999px;
  margin-bottom: 14px;
  overflow: hidden;
}

.recipe__match-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s var(--ease-standard);
}

.recipe__match-grid {
  display: flex;
  gap: var(--space-2);
}

.recipe__match-stat {
  flex: 1;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe__match-stat--green { background: #e8f0e9; }
.recipe__match-stat--terra { background: #fdf3ee; }
.recipe__match-stat--muted { background: #f5f5f5; }

.recipe__match-stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--fw-bold);
}

.recipe__match-stat--green .recipe__match-stat-val { color: var(--color-brand-primary); }
.recipe__match-stat--terra .recipe__match-stat-val { color: #c96f4a; }
.recipe__match-stat--muted .recipe__match-stat-val { color: var(--color-text-subtle); }

.recipe__match-stat-key {
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--color-text-subtle);
  margin-top: 2px;
}

/* ── Tabs ─────────────────────────────────────── */

.recipe__tabs {
  display: flex;
  background: var(--color-bg-muted);
  border-radius: 14px;
  padding: 4px;
  gap: 2px;
  position: relative;
  margin-bottom: var(--space-3);
}

.recipe__tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

/* ── Tab content ──────────────────────────────── */

.recipe__tab-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* Ingredients */

.recipe__ing-row {
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipe__ing-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-circle);
  flex-shrink: 0;
}

.recipe__ing-info { flex: 1; min-width: 0; }

.recipe__ing-name {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  text-transform: capitalize;
}

.recipe__ing-qty {
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--color-text-subtle);
  margin-top: 2px;
}

.recipe__ing-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}

/* Substitutions */

.recipe__subs { gap: 0; }

.recipe__subs-title {
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: 12px;
}

.recipe__sub-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.recipe__sub-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: #c96f4a;
  margin-top: 6px;
  flex-shrink: 0;
}

.recipe__sub-text {
  font-size: var(--text-body-sm);
  color: var(--color-text-primary);
  line-height: 1.4;
}

.recipe__sub-ing {
  color: #c96f4a;
  font-weight: var(--fw-semibold);
}

.recipe__sub-note {
  font-size: 12px;
  color: var(--color-text-subtle);
  line-height: 1.5;
  margin-top: 2px;
}

/* Steps */

.recipe__step {
  display: flex;
  gap: 14px;
}

.recipe__step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  background: var(--color-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.recipe__step-body { flex: 1; }

.recipe__step-title {
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.recipe__step-desc {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  line-height: 1.6;
}

/* Tips */

.recipe__tips-card { gap: 0; }

.recipe__tips-label {
  font-size: var(--text-label-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: 10px;
}

.recipe__tip-row {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  line-height: 1.6;
  margin-bottom: 6px;
}

/* Chef IA */

.recipe__chef-card {
  background: var(--color-bg-elevated);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.recipe__chef-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recipe__chef-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.recipe__chef-tag {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}

.recipe__chef-title {
  font-size: var(--text-label-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  margin-top: 2px;
  line-height: 1.2;
}

.recipe__chef-desc {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  line-height: 1.65;
  margin-bottom: 10px;
}

.recipe__chef-reason {
  background: #fdfbea;
  border-left: 2px solid #d4a830;
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 12px;
  color: var(--color-text-subtle);
  line-height: 1.55;
}

.recipe__chef-reason-label {
  color: #8a6800;
  font-weight: var(--fw-bold);
}

.recipe__master-tip {
  background: #fdfbea;
  border: 1.5px solid #e6d472;
  border-radius: 20px;
  padding: 18px;
}

.recipe__master-tip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.recipe__master-tip-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #d4a830, #b8860b);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recipe__master-tip-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: #8a6800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.recipe__master-tip-text {
  font-size: var(--text-body-sm);
  color: var(--color-text-subtle);
  line-height: 1.65;
}

.recipe__sub-btn {
  width: 100%;
  padding: 14px;
  border-radius: 13px;
  border: 2px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.recipe__sub-btn:active { background: var(--color-bg-muted); }

/* ── CTA buttons ──────────────────────────────── */

.recipe__cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 100px;
}

.recipe__cta-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  font-size: var(--text-body-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--duration-fast) var(--ease-standard);
}

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

.recipe__cta-btn--outline {
  border: 2px solid var(--color-brand-primary);
  background: var(--color-bg-elevated);
  color: var(--color-brand-primary);
}

.recipe__cta-btn--primary {
  border: none;
  background: var(--color-brand-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 90, 64, 0.3);
}
