/* Bourbon Pour: warm charcoal, amber and cream. Mobile-first. */
:root {
  --bg: #14110f;
  --bg-2: #1b1714;
  --surface: #211c18;
  --surface-2: #2a231e;
  --line: rgba(243, 233, 215, 0.09);
  --line-2: rgba(243, 233, 215, 0.16);
  --cream: #f3e9d7;
  --cream-2: #e8dcc6;
  --text: #efe6d6;
  --muted: #a99d8d;
  --amber: #c8873a;
  --amber-2: #e3a857;
  --amber-deep: #8a5622;
  --sealed: #9fbf8f;
  --open: #e3a857;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(200, 135, 58, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(138, 86, 34, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--amber-2); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--amber); color: #1a120a; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--amber-2); outline-offset: 2px; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber-2); font-weight: 600; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner {
  max-width: 1280px; margin: 0 auto; padding: 22px var(--pad) 18px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__mark { width: 44px; height: 44px; color: var(--amber-2); flex: none; }
.brand__pour { fill: var(--amber); }
.brand__eyebrow { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.brand__name {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 7vw, 52px);
  line-height: 0.95; letter-spacing: 0.01em; color: var(--cream);
}
.totals { display: flex; gap: 10px; margin: 0; }
.totals__item {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; min-width: 104px;
}
.totals dt { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.totals dd { margin: 0; font-family: var(--serif); font-size: 28px; line-height: 1.1; color: var(--amber-2); font-weight: 600; font-variant-numeric: lining-nums; }

/* Toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(20, 17, 15, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar__inner {
  max-width: 1280px; margin: 0 auto; padding: 10px var(--pad);
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
}
.search {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px;
}
.search:focus-within { border-color: var(--amber); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; outline: none; }
.search input::placeholder { color: #7f7467; }
.sort select {
  appearance: none; -webkit-appearance: none; width: 100%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a99d8d' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 11px;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 34px 9px 14px; cursor: pointer;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 9px 16px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  font-weight: 500; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber-2); }
.btn--amber { background: linear-gradient(180deg, var(--amber-2), var(--amber)); color: #1d130a; border-color: transparent; font-weight: 600; }
.btn--amber:hover { filter: brightness(1.06); }
.badge-count { background: var(--amber); color: #1d130a; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(20,17,15,0.6); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--amber); color: var(--amber-2); }

/* Layout */
.layout { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); display: block; }
.results { padding: 16px 0 40px; min-width: 0; }
.results__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.results__meta p { margin: 0; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: rgba(200, 135, 58, 0.12); border: 1px solid rgba(200, 135, 58, 0.35); color: var(--cream-2);
  border-radius: 999px; padding: 3px 6px 3px 10px; cursor: pointer;
}
.chip span { font-size: 14px; line-height: 1; color: var(--amber-2); }

/* Filters: mobile drawer */
.filters {
  position: fixed; inset: auto 0 0 0; z-index: 40; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--bg-2); border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0;
  transform: translateY(105%); transition: transform 0.28s ease; box-shadow: var(--shadow);
}
.filters.is-open { transform: translateY(0); }
.filters__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.filters__head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--cream); }
.filters__body { overflow-y: auto; padding: 4px 18px 12px; }
.filters__foot { display: flex; gap: 10px; justify-content: space-between; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.filters__apply { flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 35; }
.facet { border: 0; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facet legend { padding: 0; margin-bottom: 8px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.facet__options { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: inline-block; font-size: 13px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--cream-2); cursor: pointer; user-select: none;
}
.opt span small { color: var(--muted); margin-left: 4px; font-size: 11px; }
.opt input:checked + span { background: var(--amber); border-color: var(--amber); color: #1d130a; }
.opt input:checked + span small { color: #3d2814; }
.opt input:focus-visible + span { outline: 2px solid var(--amber-2); outline-offset: 2px; }
.range { position: relative; height: 28px; }
.range input {
  position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 3px; border-radius: 3px; background: var(--surface-2); }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--amber-2); border: 3px solid var(--bg-2); box-shadow: 0 0 0 1px var(--amber); cursor: pointer; }
.range input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--amber-2); border: 3px solid var(--bg-2); box-shadow: 0 0 0 1px var(--amber); cursor: pointer; }
.range input::-moz-range-track { background: transparent; }
.range__label { margin: 4px 0 0; font-size: 13px; color: var(--cream-2); font-variant-numeric: tabular-nums; }

/* Grid + cards */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { min-width: 0; }
.card__link {
  position: relative; display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card__link:hover { transform: translateY(-2px); border-color: rgba(227, 168, 87, 0.45); box-shadow: var(--shadow); }
.thumb {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 18%, #fffaf1 0%, var(--cream) 55%, #dccdb2 100%);
  display: grid; place-items: center;
}
.thumb img { position: absolute; left: 7%; top: 6%; width: 86%; height: 88%; max-width: none; object-fit: contain; object-position: center bottom; mix-blend-mode: multiply; transition: transform 0.25s ease; }
.card__link:hover .thumb img { transform: scale(1.03); }
.thumb::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 4.5%; height: 3%; border-radius: 50%; background: radial-gradient(closest-side, rgba(60, 35, 10, 0.22), transparent); pointer-events: none; }
.thumb--placeholder::after { position: static; left: auto; right: auto; bottom: auto; border-radius: 0; }
.thumb--placeholder::after {
  content: ""; width: 34%; height: 72%;
  background: rgba(138, 86, 34, 0.28);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 120'%3E%3Cpath d='M15 0h10v6h-1v22c0 6 13 12 13 26v60a6 6 0 0 1-6 6H9a6 6 0 0 1-6-6V54c0-14 13-20 13-26V6h-1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 120'%3E%3Cpath d='M15 0h10v6h-1v22c0 6 13 12 13 26v60a6 6 0 0 1-6 6H9a6 6 0 0 1-6-6V54c0-14 13-20 13-26V6h-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.thumb--placeholder::before { content: "Image coming soon"; position: absolute; bottom: 10px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a6a45; }
.card__body { padding: 12px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card__name { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.12; color: var(--cream); }
.card__distillery { margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__stats { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.stat { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(243, 233, 215, 0.06); border: 1px solid var(--line); color: var(--cream-2); font-variant-numeric: tabular-nums; }
.stat:empty, .stat[hidden] { display: none; }
.stat--batch { color: var(--amber-2); border-color: rgba(227, 168, 87, 0.35); }
.card__foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card__msrp { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--amber-2); font-variant-numeric: lining-nums; }
.card__status, .tag--status { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.status--sealed { color: var(--sealed); }
.status--open { color: var(--open); }
.qty {
  position: absolute; top: 10px; right: 10px; min-width: 30px; height: 26px; padding: 0 9px;
  border-radius: 999px; background: rgba(20, 17, 15, 0.82); color: var(--amber-2);
  font-weight: 700; font-size: 12.5px; display: grid; place-items: center; border: 1px solid rgba(227, 168, 87, 0.5);
}
.empty { text-align: center; padding: 60px 16px; }
.empty__title { font-family: var(--serif); font-size: 28px; color: var(--cream); margin: 0 0 4px; }
.error { color: #f0a58a; background: rgba(240, 120, 90, 0.08); border: 1px solid rgba(240, 120, 90, 0.3); padding: 12px 14px; border-radius: var(--radius-sm); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(8, 6, 5, 0.72); backdrop-filter: blur(3px); }
.modal__panel {
  position: relative; max-height: 92vh; overflow-y: auto; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); outline: none;
  animation: rise 0.26s ease;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.thumb--lg { aspect-ratio: auto; height: min(46vh, 380px); }
.modal__body { padding: 18px var(--pad) calc(24px + env(safe-area-inset-bottom)); }
.modal__title { margin: 4px 0 10px; font-family: var(--serif); font-size: clamp(28px, 6vw, 38px); line-height: 1.05; font-weight: 600; color: var(--cream); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--cream-2); }
.tag--amber { border-color: rgba(227, 168, 87, 0.55); color: var(--amber-2); }
.modal__notes { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--cream-2); font-style: italic; margin: 0 0 18px; padding-left: 14px; border-left: 2px solid var(--amber); }
.facts { display: grid; grid-template-columns: 1fr; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 128px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.facts dd a { font-size: 13px; }
.modal__link { margin: 16px 0 0; font-size: 13px; }

.footer { max-width: 1280px; margin: 0 auto; padding: 26px var(--pad) 40px; border-top: 1px solid var(--line); font-size: 12.5px; }
.footer p { margin: 0 0 4px; }
body.no-scroll { overflow: hidden; }

/* Tablet */
@media (min-width: 640px) {
  .toolbar__inner { grid-template-columns: 1fr auto auto; }
  .search { grid-column: auto; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .modal { align-items: center; justify-items: center; padding: 24px; }
  .modal__panel { width: min(920px, 100%); border-radius: 20px; display: grid; grid-template-columns: 0.9fr 1.1fr; }
  .modal__media { position: sticky; top: 0; align-self: start; }
  .thumb--lg { height: calc(min(92vh, 100vh - 48px) - 2px); min-height: 0; border-radius: 20px 0 0 20px; }
  .modal__body { padding: 30px 30px 30px; }
}

/* Desktop: sidebar filters */
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
  .filter-toggle, .filters__close, .filters__apply, .scrim { display: none !important; }
  .filters {
    position: sticky; top: 64px; align-self: start; transform: none; max-height: calc(100vh - 80px);
    background: transparent; border: 0; border-radius: 0; box-shadow: none; z-index: 1; margin-top: 16px;
  }
  .filters__head, .filters__body, .filters__foot { padding-left: 0; padding-right: 0; }
  .filters__foot { border-top: 0; padding-bottom: 0; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
