/* Meyer Cocktail Co. — minimalist storefront styles. No external fonts or assets. */

:root {
  --ink: #161213;
  --ink-soft: #3a3334;
  --muted: #5e5652;
  --burgundy: #5c1a2e;
  --burgundy-dark: #43111f;
  --cream: #f7f1e6;
  --cream-deep: #eee4d1;
  --paper: #fffdf8;
  --gold: #b08d45;          /* decorative rules and borders only (not text on cream) */
  --line: #dccfb6;
  --danger: #8f1d1d;
  --success: #2d5a39;
  --radius: 4px;
  --space: 1rem;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; padding: 2rem 0 4rem; }
main:focus { outline: none; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 34rem; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

a { color: var(--burgundy); text-underline-offset: 0.18em; }
a:hover { color: var(--burgundy-dark); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--ink); color: var(--cream); padding: 0.5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.95em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--burgundy); font-weight: 600; margin-bottom: 0.5rem; }

/* Header and navigation */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 var(--gold); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-sub { color: var(--burgundy); font-weight: 600; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.nav-list a { color: var(--ink); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list a[aria-current="page"] { border-bottom-color: var(--burgundy); }
.nav-list .nav-cta { color: var(--burgundy); font-weight: 600; }
.nav-list .link-button { color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.nav-list .link-button:hover { border-bottom-color: var(--burgundy); }
.badge { display: inline-block; min-width: 1.5rem; padding: 0 0.4rem; border-radius: 999px; background: var(--burgundy); color: var(--cream); font-size: 0.8rem; text-align: center; }

/* Footer */
.site-footer { background: var(--ink); color: var(--cream-deep); padding: 2.5rem 0; }
.site-footer a { color: var(--cream); }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; color: var(--cream); margin-bottom: 0.25rem; }
/* Standalone links get at least a 24px-tall target (WCAG 2.2 target size). */
.footer-links a, .breadcrumb a, .card > a:not(.button) { display: inline-block; padding: 0.25rem 0; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--gold); padding-top: 1rem; }

/* Buttons */
.button {
  display: inline-block; font: inherit; font-weight: 600; line-height: 1.2;
  padding: 0.8rem 1.4rem; min-height: 2.75rem; border-radius: var(--radius);
  background: var(--burgundy); color: var(--cream); border: 2px solid var(--burgundy);
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); color: var(--cream); }
.button-secondary { background: transparent; color: var(--burgundy); }
.button-secondary:hover { background: var(--cream-deep); color: var(--burgundy-dark); }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-small { padding: 0.45rem 0.8rem; min-height: 2.25rem; font-size: 0.95rem; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-button { font: inherit; background: none; border: 0; padding: 0.35rem 0; color: var(--burgundy); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }

/* Messages */
.notice { background: #e7f0e8; border-left: 4px solid var(--success); padding: 0.75rem 1rem; margin-bottom: 1.5rem; border-radius: var(--radius); }
.callout { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 0.75rem 1rem; border-radius: var(--radius); }
.empty-state { padding: 2rem; text-align: center; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); }
.error-summary { border: 2px solid var(--danger); background: #fbeeee; padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-radius: var(--radius); }
.error-summary h2 { font-size: 1.15rem; margin-top: 0; color: var(--danger); }
.error-summary ul { margin: 0; padding-left: 1.25rem; }
.error-summary a { color: var(--danger); font-weight: 600; }

/* Forms */
.stack > * + * { margin-top: 1rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.5rem; background: var(--paper); }
legend { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; padding: 0 0.4rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.required-mark { color: var(--danger); }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.35rem; }
.field-error { display: block; color: var(--danger); font-weight: 600; font-size: 0.95rem; margin: 0.25rem 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="url"], input[type="date"], input[type="file"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink-soft); border-radius: var(--radius); padding: 0.6rem 0.75rem; min-height: 2.75rem;
}
input[type="number"] { max-width: 9rem; }
.field-invalid input, .field-invalid textarea { border-color: var(--danger); }
.field-row { display: grid; gap: 0 1rem; }
.checkbox, .choice { display: flex; align-items: flex-start; gap: 0.6rem; }
.checkbox input, .choice input { width: 1.5rem; height: 1.5rem; margin-top: 0.05rem; accent-color: var(--burgundy); flex: none; }
.choice-list { display: grid; gap: 0.75rem; margin-bottom: 1.25rem; }
.choice label { cursor: pointer; }
.address-lines { display: block; color: var(--muted); }
.subfields { border-top: 1px solid var(--line); padding-top: 1rem; }

/* Hero and sections */
.hero { padding: 2rem 0 2.5rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); max-width: 18ch; }
.hero-compact h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.section { margin-bottom: 2.5rem; }
.section-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.split { display: grid; gap: 2rem; }
/* A grid/flex item defaults to a content-based min-width, so a wide table
   (e.g. the shipping packages breakdown) inside a .split column can grow the
   column past the viewport instead of scrolling inside its own .table-scroll. */
.split > * { min-width: 0; }
.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: 0.5rem; }
.plain-list { padding-left: 1.1rem; }
.plain-list li { margin-bottom: 0.5rem; }

/* Cards and grids */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card h2, .card-title { margin-top: 0; font-size: 1.2rem; }
.card-warning { border-left: 4px solid var(--danger); margin-top: 2rem; }
.card-grid { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }

.email-preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; margin-top: 0.5rem; background: #fff; }
.email-preview p { margin: 0 0 1em; }

.product-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.product-card-link { text-decoration: none; color: var(--ink); }
.product-card-link:hover .product-card-title { text-decoration: underline; }
.product-card-title { font-size: 1.15rem; margin: 0.75rem 0 0.25rem; }
.product-card-meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.product-card-price { margin: auto 0 0; }
.product-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--cream-deep); border-radius: var(--radius); }
.stock-out { color: var(--danger); font-weight: 600; margin: 0.5rem 0 0; }

.filter-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 1.5rem; }
.filter-nav a { display: inline-block; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--paper); }
.filter-nav a[aria-current="page"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0 0 1.5rem; font-size: 0.95rem; }
.breadcrumb li + li::before { content: "/"; color: var(--muted); margin-right: 0.35rem; }

/* Product detail */
.product-detail { display: grid; gap: 2rem; }
.product-detail-media { max-width: 26rem; }

/* Photo/video gallery: thumbnails wrap below the main image on a phone-width
   screen (no min-width wider than the screen anywhere here). */
.gallery-main { margin-bottom: 0.75rem; }
.gallery-thumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.gallery-thumbs form { margin: 0; }
.gallery-thumb-button {
  display: block; padding: 0; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--cream-deep); cursor: pointer; width: 4rem; height: 5rem; overflow: hidden;
}
.gallery-thumb-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb-active { border-color: var(--burgundy); }
.gallery-thumb-video { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 1.25rem; color: var(--ink-soft); }
.panel-title { font-size: 1.1rem; margin-top: 1.5rem; }
.price-panel { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.price-panel .panel-title { margin-top: 0; }
.price-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin-bottom: 0.25rem; }
.price-label { width: 100%; font-weight: 600; color: var(--ink-soft); }
.price-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--burgundy); }
.price-note { font-weight: 600; }
.price-reference { border: 1px dashed var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; background: var(--cream); }
.price-reference p { margin: 0 0 0.25rem; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1rem 0.45rem; border: 1px solid var(--ink-soft); border-radius: var(--radius); margin-right: 0.35rem; vertical-align: 0.1em; }
.order-panel { margin-bottom: 1.5rem; }
.add-to-cart { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; }
.add-to-cart .field { margin-bottom: 0; }
.details-list { margin: 0; }
.details-list div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.details-list dt { font-weight: 600; }
.details-list dd { margin: 0; }

/* Tables */
/* position: relative keeps absolutely positioned visually-hidden text inside the scroll box;
   without it that text escapes and makes the whole page scroll sideways on phones. */
.table-scroll { position: relative; overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.data-table { width: 100%; border-collapse: collapse; min-width: 36rem; }
.data-table caption { text-align: left; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; padding: 0.75rem 1rem 0; }
.data-table th, .data-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.data-table tbody th { font-weight: 600; }
.row-unavailable { background: #fbeeee; }
.qty-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.qty-form input { width: 6rem; }

/* Small inline-table inputs (media reorder position, variant price override) --
   classes instead of a style attribute, which the CSP (style-src 'self') blocks. */
.input-xs { width: 4.5em; }
.input-sm { width: 6em; }
.media-thumb { object-fit: cover; }
.media-video-thumb { max-width: 120px; }

/* Totals, summaries, status */
.summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.summary h2 { margin-top: 0; font-size: 1.25rem; }
.summary-items { list-style: none; padding: 0; margin: 0 0 1rem; }
.summary-items li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; }
.totals { margin: 0 0 1rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.totals dd { margin: 0; text-align: right; }
.totals-grand { font-weight: 700; font-size: 1.1rem; border-bottom: 0 !important; }
.facts { display: grid; gap: 0.5rem 2rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); margin: 1rem 0; }
.facts dt { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.status { display: inline-block; font-size: 0.85rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; }
.status-approved, .status-delivered, .status-shipped { color: var(--success); }
.status-pending, .status-processing { color: var(--ink-soft); }
.status-rejected, .status-cancelled { color: var(--danger); }
.status-none { color: var(--muted); }
.status-line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.history { padding-left: 1.25rem; }
address { font-style: normal; margin-bottom: 1rem; }

.checkout-layout { display: grid; gap: 2rem; }

/* Admin */
.admin-nav { margin: -0.5rem 0 1.75rem; border-bottom: 1px solid var(--line); }
.admin-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.admin-nav a { display: inline-block; padding: 0.5rem 0; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { border-bottom-color: var(--burgundy); }
.stat-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.stat a { display: block; height: 100%; padding: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.stat a:hover { border-color: var(--burgundy); }
.stat-value { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--burgundy); line-height: 1.1; }
.stat-label { display: block; margin-top: 0.25rem; }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.facts-compact { grid-template-columns: 1fr; gap: 0.35rem; }
.facts-compact div { display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem; }
.facts-compact dd { font-weight: 400; overflow-wrap: anywhere; }
.review-form { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.data-table-compact { min-width: 20rem; }
.row-warning { background: #fdf6e3; }
.tag-warning { border-color: var(--danger); color: var(--danger); }
.form-wide { max-width: 48rem; }
.checkbox .hint { display: block; margin: 0.1rem 0 0; font-weight: 400; }
.message { margin: 0.75rem 0; padding: 0.75rem 1rem; border-left: 3px solid var(--gold); background: var(--cream); white-space: pre-line; overflow-wrap: anywhere; }

@media (min-width: 40rem) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* Narrow screens: cart rows become labeled blocks so every column (including Remove) stays visible. */
@media (max-width: 39.99rem) {
  .stack-on-phone { min-width: 0; }
  .stack-on-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-on-phone tr { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
  .stack-on-phone th, .stack-on-phone td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.35rem 0; border: 0; }
  .stack-on-phone tbody th { display: block; font-size: 1.05rem; }
  .stack-on-phone td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--muted); }
  .stack-on-phone .cell-actions { justify-content: flex-end; }
}

@media (min-width: 52rem) {
  main { padding-top: 3rem; }
  .split { grid-template-columns: 1fr 1fr; align-items: start; }
  .product-detail { grid-template-columns: minmax(16rem, 26rem) 1fr; align-items: start; }
  .checkout-layout { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); align-items: start; }
  .checkout-layout .summary { position: sticky; top: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .nav-list a, .filter-nav a { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
}
