/* Beerculator-only additions on top of sites/shared/base.css.
 * Zero raw px font-size, border-radius, or colour literals (enforced by scripts/check_tokens.py).
 */

.country-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.country-switch[hidden] {
  display: none;
}

.country-btn {
  border: none;
  background: transparent;
  color: var(--outer-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.25;
}

.country-btn:hover {
  color: var(--outer-ink-bright);
}

.country-btn.active {
  background: var(--bg-surface);
  color: var(--ink);
  font-weight: 700;
}

/* Multi-select Style picker panel (reuses store-dropdown-panel shell) */
.filter-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.style-dropdown-panel {
  left: 0;
  right: auto;
  width: 310px;
}

.style-dd-opt {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}

.style-dd-opt:hover {
  background: var(--bg-hover);
}

.style-dd-opt input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.style-dd-opt.is-checked {
  background: var(--bg-selected);
}

.style-dd-text {
  flex: 1;
  min-width: 0;
}

.style-dd-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

.style-dd-opt.is-checked .style-dd-name {
  font-weight: 700;
}

.style-dd-desc {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* Price per litre / Price per unit axis caption beneath chart */
.axis-caption {
  text-align: center;
  margin-top: 2px;
  margin-bottom: var(--space-1);
}

.axis-title-row {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.axis-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
}

.axis-switch-link {
  border: none;
  background: none;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.axis-switch-link:hover {
  color: var(--accent);
}

.axis-switch-link[hidden] {
  display: none;
}

.axis-def {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 2px;
}

.axis-def[hidden] {
  display: none;
}

/* Table column proportions for Beerculator (6 columns) */
.wine-table col.c-beer { width: 31%; }
.wine-table col.c-shop { width: 14%; }
.wine-table col.c-rating { width: 12%; }
.wine-table col.c-metric { width: 12%; }
.wine-table col.c-pack { width: 20%; }
.wine-table col.c-link { width: 11%; }

/* Multi-pack comparison table inside beer detail drawer */
.packs-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.pack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.pack-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-muted);
  padding: 6px var(--space-1);
  border-bottom: 1px solid var(--line-strong);
}

.pack-table th.num,
.pack-table td.num {
  text-align: right;
  white-space: nowrap;
}

.pack-table td {
  padding: var(--space-2) var(--space-1);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.pack-table tr.is-best td {
  font-weight: 700;
}

.pack-table tr.is-other-store td {
  opacity: 0.72;
}

.pack-diff {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.drawer-hero {
  flex: 1;
  min-width: 0;
}

.drawer-hero-text {
  flex: 1;
  min-width: 0;
}

.drawer-img-wrap {
  width: 48px;
  height: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  isolation: isolate;
}

.drawer-img-wrap img {
  width: 48px;
  height: 88px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

#drawer-close {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .filter-bar-beer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .filter-bar-beer .filter-picker,
  .filter-bar-beer .store-picker {
    display: flex;
    width: 100%;
  }

  .filter-bar-beer .filter-label {
    display: none;
  }

  .filter-bar-beer .picker-trigger {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  .style-dropdown-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 78vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-4) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-sheet);
    z-index: 60;
  }

  .drawer-img-wrap,
  .drawer-img-wrap img {
    width: 40px;
    height: 72px;
  }
}
