/* ==========================================================================
   DecantPricer — luxury perfumery aesthetic
   cream #faf7f2 · ink #1a1611 · amber #b8860b · bordeaux #6d1a2e
   ========================================================================== */

:root {
  --cream: #faf7f2;
  --ink: #1a1611;
  --amber: #b8860b;
  --amber-soft: #f4e6c4;
  --bordeaux: #6d1a2e;
  --card: #fffdf9;
  --line: #e7dfd0;
  --line-strong: #d8cdb8;
  --muted: #7c7364;
  --zebra: #f6f1e7;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(26, 22, 17, 0.04), 0 8px 28px rgba(26, 22, 17, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
}

a { color: var(--bordeaux); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.1rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: 0.01em; }

.muted { color: var(--muted); }
.small { font-size: 0.83rem; }
.strong { font-weight: 600; }
code {
  background: var(--zebra); border: 1px solid var(--line);
  border-radius: 4px; padding: 0.05em 0.35em; font-size: 0.85em;
}

/* --- header -------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 242, 0.95);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.65rem; padding-bottom: 0.65rem;
}
.logo { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-text {
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.01em;
}
.logo-text em { font-style: italic; color: var(--amber); }
.site-nav { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink); font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.14em; padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { text-decoration: none; border-bottom-color: var(--amber); }

/* --- hero ---------------------------------------------------------------- */

.hero { text-align: center; padding: 3.2rem 0 2.2rem; }
.hero-logo { color: var(--ink); }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0.4rem 0 0.2rem;
}
.hero h1 em { font-style: italic; color: var(--amber); }
.tagline {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: 1.12rem; margin: 0 0 1.8rem;
}

/* search */
.search-box { position: relative; max-width: 560px; margin: 0 auto; }
#search-input {
  width: 100%; padding: 0.85rem 1.15rem; font-size: 1rem;
  font-family: var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 999px; box-shadow: var(--shadow); outline: none;
}
#search-input:focus { border-color: var(--amber); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; z-index: 60; text-align: left;
}
.search-results a {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.6rem 1rem; color: var(--ink);
  border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--zebra); text-decoration: none; }
.search-results .sr-brand { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.search-results .sr-price { color: var(--amber); font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-results .sr-empty { display: block; padding: 0.7rem 1rem; color: var(--muted); }

/* counters */
.counters {
  display: flex; justify-content: center; gap: 2.6rem; flex-wrap: wrap;
  margin-top: 2rem;
}
.counter strong {
  display: block; font-family: var(--serif); font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.counter span {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--muted);
}

/* --- panels & tables ------------------------------------------------------ */

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.5rem; margin: 1.6rem 0;
}
.panel-title {
  font-size: 1.28rem; margin: 0 0 0.2rem;
}
.panel-title::after {
  content: ""; display: block; width: 44px; height: 2px;
  background: var(--amber); margin-top: 0.45rem; opacity: 0.7;
}
.panel-sub { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0 1rem; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
.data-table th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.13em; font-weight: 600; color: var(--muted);
  padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td {
  padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:nth-child(even) { background: var(--zebra); }
.data-table tbody tr:hover { background: var(--amber-soft); transition: background 120ms; }
.data-table .num {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.frag-link { color: var(--ink); }
.frag-link .brand {
  display: block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
}
.frag-link:hover { color: var(--bordeaux); }
.mini-link { white-space: nowrap; font-size: 0.85rem; }

.gap-badge {
  display: inline-block; background: var(--amber-soft); color: #7a5a08;
  border: 1px solid rgba(184, 134, 11, 0.45); border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; padding: 0.08rem 0.55rem;
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-block; border-radius: 999px; font-size: 0.74rem;
  padding: 0.06rem 0.55rem; border: 1px solid var(--line-strong);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status-success { background: #e9f2e4; color: #33582a; border-color: #bcd3b1; }
.status-failed { background: #f7e3e6; color: var(--bordeaux); border-color: #ddb2bb; }
.status-running { background: var(--amber-soft); color: #7a5a08; }

/* --- fragrance page ------------------------------------------------------- */

.page-head { padding: 2rem 0 0.2rem; }
.page-head h1 { font-size: 2rem; margin: 0.1rem 0 0.3rem; }
.eyebrow {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--muted); margin: 0;
}
.eyebrow a { color: var(--muted); }
.eyebrow a:hover { color: var(--bordeaux); }

.frag-header {
  display: flex; gap: 1.6rem; align-items: center; padding: 2rem 0 0.4rem;
}
.frag-image img,
.img-placeholder {
  width: 116px; height: 116px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--line-strong); background: var(--card);
  box-shadow: var(--shadow);
}
.img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--line-strong);
}
.frag-title h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0.15rem 0 0.4rem; }
.frag-meta { color: var(--muted); font-size: 0.95rem; margin: 0; }
.frag-meta .gap-badge { margin-left: 0.5rem; }

/* comparative grid */
.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky; left: 0; background: var(--card); z-index: 2;
  border-right: 1px solid var(--line-strong); min-width: 108px;
}
.compare-table tbody tr:nth-child(even) td:first-child { background: var(--zebra); }
.site-cell { font-family: var(--serif); font-size: 1rem; }
.offer-link { display: inline-block; color: var(--ink); line-height: 1.25; }
.offer-link:hover { text-decoration: none; color: var(--bordeaux); }
.offer-price { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.offer-ppml { display: block; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.offer-link.oos { opacity: 0.45; }
.oos-note { display: block; font-size: 0.68rem; color: var(--bordeaux); text-transform: uppercase; letter-spacing: 0.06em; }
.row-oos { opacity: 0.55; }

.best-cell {
  background: linear-gradient(180deg, #f9edd0, var(--amber-soft)) !important;
  box-shadow: inset 0 0 0 1.5px var(--amber);
  border-radius: 6px;
}
.best-badge {
  display: inline-block; margin-top: 0.15rem; background: var(--amber);
  color: #fffdf5; border-radius: 999px; font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; padding: 0.1rem 0.5rem;
}

/* sparkline + histogram */
.sparkline, .histogram { width: 100%; height: auto; display: block; }
.spark-label { font: 11px var(--sans); fill: var(--muted); }
.spark-last { font-weight: 700; fill: var(--bordeaux); }
.histo-count { font: 11px var(--sans); fill: var(--muted); }
.histo-label { font: 11px var(--sans); fill: var(--muted); }
.histo-axis {
  font: 10px var(--sans); fill: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* alert form */
.alert-panel { border-color: rgba(184, 134, 11, 0.5); }
#alert-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
#alert-form input {
  flex: 1 1 200px; padding: 0.6rem 0.9rem; font-size: 0.95rem;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--cream); color: var(--ink); outline: none;
}
#alert-form input:focus { border-color: var(--amber); }
#alert-form button {
  padding: 0.6rem 1.4rem; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; cursor: pointer;
  background: var(--bordeaux); color: #fdf8f2; border: none;
  border-radius: 10px; transition: background 140ms;
}
#alert-form button:hover { background: #521323; }
.alert-feedback { font-size: 0.9rem; color: var(--bordeaux); margin: 0.7rem 0 0; }
.alert-feedback.ok { color: #33582a; }

/* --- brands -------------------------------------------------------------- */

.letter-block { margin: 1.4rem 0; }
.letter {
  font-size: 1.5rem; color: var(--amber); border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.2rem; margin: 0 0 0.6rem;
}
.brand-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.35rem 1.4rem;
}
.brand-list a { color: var(--ink); font-family: var(--serif); font-size: 1.02rem; }
.brand-list a:hover { color: var(--bordeaux); }
.brand-list .small { display: block; }

.pagination {
  display: flex; justify-content: center; gap: 1.4rem; align-items: baseline;
  padding: 1.4rem 0 0.6rem; font-size: 0.92rem;
}

/* --- prose (about / faq) -------------------------------------------------- */

.prose { max-width: 720px; margin: 0 auto; padding: 2.2rem 0; }
.prose h1 { font-size: 2.1rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1.8rem; }
.prose li { margin: 0.4rem 0; }

/* --- footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line); margin-top: 3rem;
  padding: 1.8rem 0 2.4rem; text-align: center;
}
.footer-tag { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0 0 0.4rem; }
.footer-inner .small { max-width: 640px; margin: 0.2rem auto 0.8rem; }
.footer-nav { font-size: 0.85rem; }

/* --- admin --------------------------------------------------------------- */

.email-details { margin-top: 0.8rem; font-size: 0.9rem; }
.email-body {
  background: var(--zebra); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1rem; white-space: pre-wrap; font-size: 0.82rem;
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 700px) {
  .hero { padding-top: 2.2rem; }
  .counters { gap: 1.6rem; }
  .frag-header { flex-direction: column; text-align: center; }
  .frag-meta .gap-badge { display: inline-block; margin: 0.4rem 0 0; }
  .panel { padding: 1.1rem 1rem 1.2rem; }
  .header-inner { flex-direction: column; gap: 0.4rem; }
  .site-nav { justify-content: center; gap: 0.9rem; }
}
