/* =========================================
   Whisky detail-page styles — extracted from main.css. Loaded only on /whisky/* (loadWhiskyDetailCss).
   NOTE: shared rules (.breadcrumb, .currency-note, .btn-buy, blog, catalogue-mobile) stay in main.css.
   ========================================= */

/* ---- Breadcrumb (detail page) ---- */

.detail-breadcrumb {
  margin-bottom: .75rem;
}
.detail-breadcrumb a {
  font-size: .82rem;
  color: var(--text-dim);
  text-decoration: none;
}
.detail-breadcrumb a:hover {
  color: var(--amber-light);
}

/* ---- Filter trail (detail page) ---- */

.filter-trail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}

.trail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.trail-sep {
  color: var(--text-dim);
  font-size: 0.75rem;
  opacity: 0.5;
  margin: 0 0.05rem;
  user-select: none;
}

/* Base chip */
.trail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}
.trail-link:hover {
  border-color: var(--amber-dim);
  color: var(--cream);
  background: rgba(200,135,42,.07);
}

/* Crumb trail — slightly more prominent */
.trail-crumb {
  font-weight: 600;
  color: var(--cream-dim);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
}
.trail-crumb:hover {
  color: var(--amber-light);
  background: transparent;
  border-color: transparent;
}

/* Style chips (Peated, CS, NCF) */
.trail-style-chip {
  background: rgba(200,135,42,.08);
  border-color: rgba(200,135,42,.25);
  color: var(--amber);
}
.trail-style-chip:hover {
  background: rgba(200,135,42,.18);
  border-color: var(--amber-dim);
  color: var(--amber-light);
}

/* Cask chips */
.trail-cask-chip {
  background: rgba(78,124,94,.08);
  border-color: rgba(78,124,94,.25);
  color: var(--green);
}
.trail-cask-chip:hover {
  background: rgba(78,124,94,.18);
  border-color: var(--green);
  color: #6ecf9a;
}

[data-theme="light"] .trail-crumb          { color: var(--cream-dim); }
[data-theme="light"] .trail-style-chip     { color: var(--amber); }
[data-theme="light"] .trail-cask-chip      { color: var(--green); }

/* ---- Detail Page ---- */

.whisky-detail { max-width: 900px; margin: 0 auto; }

.detail-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.detail-header--no-image { grid-template-columns: 1fr; }

.detail-image {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: start;
}
.detail-image img { height: 100%; width: 100%; object-fit: contain; padding: 0.15rem; opacity: 0; transition: opacity 0.25s; }

.detail-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

.detail-info h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--cream);
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.detail-distillery { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 1.25rem; }

.detail-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.9rem;
}

.detail-specs dt { color: var(--text-dim); white-space: nowrap; }
.detail-specs dd { color: var(--cream); }

.spec-wb-rating {
  color: var(--amber);
  font-weight: 600;
}
.spec-wb-votes {
  color: var(--text-dim);
  font-size: 0.82em;
}

/* ---- Size Switcher ---- */

.size-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.size-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3em 0.9em;
  border-radius: 1.5em;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}

.size-btn:hover {
  border-color: var(--amber-dim);
  color: var(--cream);
  background: rgba(200,135,42,.07);
}

.size-btn.active {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(200,135,42,.10);
  font-weight: 600;
}

.size-btn__count {
  font-size: 0.75em;
  opacity: 0.6;
}

/* ---- Batch / release info bar + edition column ---- */

.batch-info-bar {
  margin: 1rem 0 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--amber-dim);
  border-radius: 8px;
  background: rgba(200, 135, 42, .06);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.batch-info-bar strong { color: var(--amber); }

.col-edition { white-space: nowrap; }

.batch-edition-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  background: rgba(200, 135, 42, .12);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  text-decoration: none;
  transition: background 0.12s;
}
.batch-edition-link:hover {
  background: rgba(200, 135, 42, .22);
}

/* ---- Price Table ---- */

.price-comparison, .tasting-notes, .description {
  margin-bottom: 2.5rem;
}

.price-comparison h2, .tasting-notes h2, .description h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--cream);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.price-table-wrap { overflow-x: auto; }

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.price-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.price-table tr:last-child td { border-bottom: none; }

.price-table tr:hover td { background: var(--bg-card); }
.price-table tr[data-href] { cursor: pointer; }
.price-table tr[data-href]:hover td { background: var(--bg-hover, var(--bg-card)); }

.best-price td:first-child {
  position: relative;
  padding-left: 1rem;
  box-shadow: inset 3px 0 0 var(--amber);
}
.best-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.1rem;
}
.deal-label {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  background: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
}

.near-best-price td:first-child {
  box-shadow: inset 2px 0 0 var(--amber-dim);
}

.near-best-pct {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: 0.4em;
  font-variant-numeric: tabular-nums;
}

.good-price td:first-child {
  box-shadow: inset 2px 0 0 var(--amber-dim);
}

.good-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--amber-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.retailer-name { color: var(--cream); font-weight: 500; }

.price-cell strong { color: var(--amber); font-size: 1.05rem; }

/* ── Price spread (% vs cheapest) ─────────────────────────── */
.price-spread-summary {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg-card);
  border-left: 3px solid var(--amber-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Compact trust signal above the price table (plan 32 P1-3) */
.trust-compact {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.trust-compact-sep { opacity: 0.5; }
.trust-compact time { white-space: nowrap; }

.vs-best-col { text-align: right; }
.vs-best-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vs-best-zero  { color: var(--text-dim); }
.vs-best-good  { color: var(--text-dim); }        /* within good threshold (2–3%) */
.vs-best-up    { color: var(--cream-dim); }       /* neutral (above good cap, ≤25%) */
.vs-best-near  { color: var(--text-dim); }        /* legacy — kept for compatibility */
.vs-best-muted { color: var(--text-dim); opacity: 0.7; }

.vs-best-over {                                    /* overpriced (>25%) */
  display: inline-block;
  font-weight: 700;
  color: #e08a8a;
  background: rgba(139, 58, 58, 0.18);
  padding: 0.05em 0.45em;
  border-radius: 999px;
}
.overpriced-price td { opacity: 0.82; }
.overpriced-price td:first-child { box-shadow: inset 2px 0 0 var(--red); }

.stock-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 4px;
}
.in-stock  { background: #1a2e22; color: #6ecf9a; }
.out-of-stock { background: #2d1a1a; color: #cf6e6e; }

.date-cell { color: var(--text-dim); font-size: 0.82rem; }

/* ── Out-of-stock collapsible section ──────────────────────────── */
.oos-section {
  margin-top: 1.5rem;
}

.oos-summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.4rem 0;
  user-select: none;
  list-style: none;
}

.oos-summary::-webkit-details-marker { display: none; }

.oos-summary::before {
  content: "▶ ";
  font-size: 0.7em;
  transition: transform 0.15s;
  display: inline-block;
}

.oos-section[open] .oos-summary::before {
  transform: rotate(90deg);
}

.price-table-wrap--oos { margin-top: 0.5rem; }

.price-table--oos td,
.price-table--oos th { opacity: 0.6; }

.price-table--oos .price-cell { font-style: italic; }

/* ── Whisky detail price table — mobile trim ──────────────────────────
   On phones the offer table is cramped, so we drop the two least-essential
   columns (Dostępność / Aktualizacja) and hide the out-of-stock section
   entirely — shoppers on mobile only care about who has it and for how much. */
@media (max-width: 600px) {
  .price-table .col-stock,
  .price-table .col-updated { display: none; }
  .oos-section { display: none; }
}

/* ---- Whisky description (inline in detail-info) ---- */

.detail-description {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.detail-description__heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}
.detail-description p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ---- WB Flavour Profile ---- */

.wb-flavor-profile {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Collapsed summary row ── */
.wb-flavor-collapsed {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.wb-flavor-collapsed__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.wb-flavor-collapsed__tags {
  font-size: 0.83rem;
  color: var(--cream);
}

.wb-flavor-expand-btn {
  background: none;
  border: none;
  padding: 0 0.05rem;
  color: var(--amber);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  transition: opacity 0.15s;
}
.wb-flavor-expand-btn:hover { opacity: 0.75; }

/* ── Expanded full section ── */
.wb-flavor-full { margin-top: 0.9rem; }

.wb-flavor-tags {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr;
  column-gap: 0.5rem;
  row-gap: 0.4rem;
  align-items: center;
}

.wb-flavor-tag__name {
  font-size: 0.78rem;
  color: var(--cream);
  text-align: right;
  white-space: nowrap;
}

.wb-flavor-tag__track {
  height: 6px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  cursor: default;
  min-width: 0;
}

.wb-flavor-tag__bar {
  height: 100%;
  background: linear-gradient(to right, var(--amber-dim), var(--amber));
  border-radius: 4px;
  min-width: 2px;
}

.wb-flavor-source {
  margin-top: 0.75rem;
  font-size: 0.68rem;
  color: var(--text-dim, #6b7790);
}

@media (max-width: 600px) {
  .wb-flavor-tags { grid-template-columns: auto 1fr; }
}

/* ---- Tasting Notes ---- */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.note {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.note h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
}

.note p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; }

/* Detail-header responsive collapse — base rules are above; this override must
   load AFTER them. It lived in a shared @media block in main.css; since main.css
   loads before this file, the override is kept here so it still wins on mobile. */
@media (max-width: 700px) {
  .detail-header { grid-template-columns: 1fr; }
  .detail-image { height: 220px; }
}
