/* HealthyPour — reusable components (Back Bar). */

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em;
  border-radius: var(--r-sm); border: 1.5px solid transparent; padding: 10px 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--dur-fast) var(--ease-standard);
}
.btn-lg { padding: 13px 26px; font-size: var(--fs-md); width: 100%; }
.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.btn-primary { background: var(--brand-primary); color: var(--text-inverse); box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--brand-primary-hover); box-shadow: var(--sh-md), 0 0 22px color-mix(in srgb, var(--brand-primary) 40%, transparent); }
.btn-secondary { background: transparent; color: var(--brand-secondary); border-color: var(--brand-secondary); }
.btn-secondary:hover { background: var(--brand-secondary-tint); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text-1); }
.btn-destructive { background: transparent; color: var(--error); border-color: var(--error); }
.btn-destructive:hover { background: var(--error-bg); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-full); flex: none; }
.btn-block { width: 100%; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.field .hint { font-size: .6875rem; color: var(--text-3); }
.input, textarea.input, select.input {
  font-family: var(--font-body); font-size: var(--fs-sm); color: var(--text-1); background: var(--bg-surface);
  border: 1.5px solid var(--border-default); border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast); appearance: none;
}
textarea.input { line-height: 1.55; resize: vertical; min-height: 88px; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236F777B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.input::placeholder { color: var(--text-disabled); }
.input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-tint); }
/* iOS auto-zooms the page when a focused field's font-size is < 16px. Keep the
   compact look on pointer devices; bump to 16px on touch so Safari/WKWebView
   (Hotwire Native) doesn't zoom on focus. */
@media (pointer: coarse) {
  .input, textarea.input, select.input { font-size: 16px; }
}
.input-search { position: relative; }
.input-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-search .input { padding-left: 36px; }
.field-error .input { border-color: var(--error); }
.field-errors { color: var(--error); font-size: var(--fs-xs); }

/* ---------------- chips / tags ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .6875rem;
  letter-spacing: .03em; text-transform: uppercase; padding: 5px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border-default); color: var(--text-2); background: var(--bg-surface);
  cursor: pointer; transition: all var(--dur-fast);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.active { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-tint); }
.chip-flavor { border-radius: var(--r-full); text-transform: none; font-family: var(--font-body); font-weight: 500; font-size: var(--fs-xs); cursor: default; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-static { cursor: default; }

/* ---------------- rating drops ---------------- */
.drops { display: inline-flex; gap: 3px; }
.drops svg { width: 15px; height: 15px; }
.drops.lg svg { width: 26px; height: 26px; }
.drop-filled { fill: var(--rating-fill); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--rating-fill) 55%, transparent)); }
.drop-empty { fill: none; stroke: var(--rating-empty); stroke-width: 1.5; }
.drop-btn { background: none; border: none; padding: 2px; cursor: pointer; line-height: 0; }

/* ---------------- badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: .625rem; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px;
  border-radius: var(--r-full); border: 1px solid transparent;
}
.badge-house { color: var(--brand-secondary); background: var(--brand-secondary-tint); border-color: color-mix(in srgb, var(--brand-secondary) 40%, transparent); }
.badge-community { color: var(--text-3); background: var(--bg-surface-2); border-color: var(--border-default); }

/* ---------------- stat tiles ---------------- */
.stat-tile { border: 1px solid var(--border-default); border-radius: var(--r-md); background: var(--bg-surface); padding: var(--sp-4) var(--sp-3); text-align: center; }
.stat-tile .st-label { font-family: var(--font-mono); font-size: .5625rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.stat-tile .st-value { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------------- empty state ---------------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-6); color: var(--text-3); }
.empty-state svg { color: var(--text-disabled); }
.empty-state h3 { font-size: var(--fs-lg); color: var(--text-2); }
.empty-state p { font-size: var(--fs-sm); line-height: 1.6; max-width: 32ch; }

/* ---------------- flash / toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: var(--sp-3); background: var(--char-900); color: var(--char-50);
  padding: 10px 18px; border-radius: var(--r-full); box-shadow: var(--sh-lg); font-size: var(--fs-xs); font-weight: 600;
  white-space: nowrap; z-index: 80; animation: toast-in var(--dur-base) var(--ease-standard);
}
:root[data-theme="dark"] .toast { background: var(--char-50); color: var(--char-900); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: var(--char-50); color: var(--char-900); } }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--verdant-400); flex: none; }
.toast-error .dot { background: var(--bitters-400); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------------- log entries (pour history) ---------------- */
.log-entry { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--sp-3); align-items: start; padding: var(--sp-4) 0; border-bottom: 1px solid var(--border-subtle); }
.log-entry:last-child { border-bottom: none; }
.log-date { font-family: var(--font-mono); font-size: .6875rem; color: var(--text-3); padding-top: 2px; }
.log-main .log-venue { font-size: .75rem; color: var(--text-3); margin: 2px 0 6px; }
.log-main .log-note { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.log-actions { display: flex; gap: var(--sp-2); align-items: center; }

/* ---------------- recipe rows ---------------- */
.pour-row {
  width: 100%; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-subtle); background: none; cursor: pointer; text-align: left; color: inherit;
}
.pour-row:last-child { border-bottom: none; }
.pour-row:hover .pr-name { color: var(--brand-primary); }
.pr-accent { width: 4px; align-self: stretch; min-height: 34px; border-radius: var(--r-full); flex: none; }
.pr-main { flex: 1; min-width: 0; }
.pr-name { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); transition: color var(--dur-fast); }
.pr-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; }
.pr-meta .chip { padding: 2px 8px; font-size: .625rem; }
.pr-tags { font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.pr-date { font-family: var(--font-mono); font-size: .625rem; color: var(--text-3); }
.pr-chevron { color: var(--text-disabled); flex: none; }
.pr-bookmark { color: var(--brand-secondary); display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: .625rem; }

/* ---------------- recipe detail ---------------- */
.detail-accent { display: block; width: 48px; height: 4px; border-radius: var(--r-full); margin-bottom: var(--sp-4); }
.detail-hero .eyebrow { margin-bottom: var(--sp-2); }
.detail-hero h1 { font-size: var(--fs-3xl); line-height: 1.02; }
.detail-hero .chip-row { margin-top: var(--sp-3); }
.rating-block { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-6) 0; margin: var(--sp-5) 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.rating-block .rb-label { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.rating-block .rb-sub { font-size: .75rem; color: var(--text-3); }
.spec-section { margin-bottom: var(--sp-6); }
.spec-section .ss-title { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-3); }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.spec-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; font-size: var(--fs-sm); color: var(--text-2); gap: 10px; }
.spec-list .amt { font-family: var(--font-mono); color: var(--text-1); white-space: nowrap; font-size: .8125rem; }
.ing-link { color: inherit; text-decoration: none; }
.ing-link:hover { color: var(--brand-primary); text-decoration: underline; }

/* Ingredient name type-ahead */
.ac-field { position: relative; }
.ac-menu { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); max-height: 220px; overflow-y: auto; }
.ac-menu[hidden] { display: none; }
.ac-item { padding: 8px 10px; border-radius: var(--r-xs); font-size: var(--fs-sm); color: var(--text-1); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover, .ac-item.active { background: var(--bg-surface-2); }
.spec-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.spec-row span:first-child { color: var(--text-3); }
.method-text { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.65; }
.detail-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.detail-actions .btn { flex: 1; min-width: 140px; }

/* add-to-shopping inline button on ingredient rows */
.ing-add-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid transparent; background: none; color: var(--text-disabled); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur-fast); flex: none; }
.ing-add-btn:hover { color: var(--brand-primary); border-color: var(--brand-primary); }

/* ---------------- rating input (log a pour) ---------------- */
.rate-input { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-3) 0; }

/* ---------------- recipe form ingredient rows ---------------- */
.ingredient-row { display: grid; grid-template-columns: 1fr 96px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ingredient-row .btn-icon { width: 34px; height: 34px; }
.add-ing-btn { align-self: flex-start; }

/* ---------------- shopping list ---------------- */
.shop-section-title { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: var(--sp-5) 0 var(--sp-2); }
.shop-section-title:first-child { margin-top: 0; }
.shop-section-title--got { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-8); }
.shop-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-subtle); }
.shop-check-form { flex: none; display: flex; margin: 0; }
.shop-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); background-color: transparent;
  background-repeat: no-repeat; background-position: center; flex: none; cursor: pointer; padding: 0; transition: all var(--dur-fast);
}
.shop-check[aria-pressed="true"] {
  background-color: var(--brand-primary); border-color: var(--brand-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}
.shop-main { flex: 1; min-width: 0; }
.shop-name { font-size: var(--fs-sm); font-weight: 600; }
.shop-name.checked { text-decoration: line-through; color: var(--text-disabled); font-weight: 500; }
.shop-from { font-size: .6875rem; color: var(--text-3); margin-top: 2px; }
/* Inline "clear" action in the Got it section header */
.shop-clear-form { display: inline; margin: 0; }

/* ---------------- pagination ---------------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-5); }
.pager-btn { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--brand-primary); padding: 6px 10px; border-radius: var(--r-sm); }
.pager-btn.is-disabled { color: var(--text-disabled); cursor: default; }
.pager-info { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* ---------------- share link box ---------------- */
.link-box { display: flex; align-items: center; gap: var(--sp-2); border: 1.5px dashed var(--border-default); border-radius: var(--r-sm); padding: 10px 12px; background: var(--bg-surface-2); }
.link-box .lb-url { flex: 1; font-family: var(--font-mono); font-size: .75rem; color: var(--text-2); overflow-x: auto; white-space: nowrap; }

/* ---------------- profile ---------------- */
.profile-head { display: flex; align-items: center; gap: var(--sp-4); }
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-secondary); color: var(--text-inverse); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); flex: none; }
.profile-name { font-size: var(--fs-lg); font-weight: 600; font-family: var(--font-display); }
.profile-handle { font-family: var(--font-mono); font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.stat-row-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-6) 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) 0; border-top: 1px solid var(--border-subtle); gap: var(--sp-3); }
.settings-row:last-of-type { border-bottom: 1px solid var(--border-subtle); }
.settings-row .sr-label { font-size: var(--fs-sm); font-weight: 600; }
.settings-row .sr-sub { font-size: .6875rem; color: var(--text-3); margin-top: 2px; }
