/* ---------- Cairns Butcher Supplies ---------- */
:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-alt: #f1ead9;
  --ink: #1f1714;
  --ink-soft: #5b504a;
  --muted: #8a7f78;
  --line: #e3d9c2;
  --brand: #7a1f1f;          /* deep butcher red */
  --brand-dark: #5a1414;
  --brand-soft: #f3e1e1;
  --accent: #b8842b;         /* warm brass */
  --accent-soft: #f5e6c4;
  --green: #2f6b3a;
  --shadow: 0 6px 18px rgba(31, 23, 20, 0.08);
  --radius: 12px;
  --radius-sm: 6px;
  --max: 1200px;
  --sticky-toolbar-top: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  margin: 0 0 .5em;
  line-height: 1.2;
  scroll-margin-top: 80px;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.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;
}

/* ---------- Header ---------- */
.site-header {
  background: #3d3d3d;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 130px;
  /* height: 56px; */
  object-fit: contain;
  border-radius: 8px;
  /* background: #fff; */
  padding: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: Georgia, serif; font-weight: 700; font-size: 1.05rem; }
.brand-tag { font-size: .75rem; opacity: .8; }

.primary-nav { display: flex; gap: 1.25rem; }
.primary-nav a { color: #fff; font-weight: 500; padding: .25rem 0; }
.primary-nav a:hover { text-decoration: none; border-bottom: 2px solid var(--accent); }

.nav-toggle {
  display: none;
  background: transparent; border: 0; cursor: pointer;
  padding: .5rem; flex-direction: column; gap: 4px;
}
.nav-toggle span { display:block; width: 24px; height: 2px; background: #fff; }

@media (max-width: 760px) {
  .brand-text {
    display: none;
  }

  .brand-logo {
    width: 130px;
    /* height: 48px; */
  }

  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--brand-dark);
    flex-direction: column; gap: 0;
    transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .primary-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .primary-nav a { padding: .9rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(43,43,45,.96), rgba(24,24,26,.88)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.05), transparent 60%),
    var(--brand-dark);
  color: #fff;
  padding: 4rem 0 4.5rem;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><path fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1' d='M0 40h80M40 0v80'/></svg>");
  opacity: .35;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .15em; font-size: .75rem;
  color: var(--accent-soft); margin: 0 0 .75rem;
}
.hero h1 { color: #fff; }
.lede { font-size: 1.1rem; color: rgba(255,255,255,.85); max-width: 60ch; }

.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }

.btn {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  font-size: .95rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1f1714; border-color: var(--accent); }
.btn-primary:hover { background: #d09a3a; border-color: #d09a3a; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.section-light .btn-ghost,
.section .btn-ghost { color: var(--brand); border-color: var(--brand); }
.section-light .btn-ghost:hover,
.section .btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }

@media (max-width: 520px) {
  .hero { padding: 3rem 0 3rem; }
}

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-light { background: var(--surface-alt); }
.section-dark { background: #1f1714; color: #f5ecdc; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); margin: 0; }
.section-dark .section-head p { color: rgba(255,255,255,.75); }

/* Toggle category/product sections by selection state */
#products {
  display: none;
}

body.category-selected #products {
  display: block;
}

body.category-selected #categories {
  display: none;
}

/* ---------- Categories grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

body.category-selected .category-grid {
  display: none;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem .8rem 1rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex; flex-direction: column; gap: .35rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-card .cat-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--surface-alt);
  overflow: hidden;
  margin-bottom: .35rem;
  position: relative;
}
.category-card .cat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-card .cat-image.placeholder::after {
  content: "Category image";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}
.category-card .cat-name {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-dark);
  text-transform: capitalize;
}
.category-card .cat-meta {
  font-size: .85rem; color: var(--muted);
}
.category-card .cat-depts {
  font-size: .8rem; color: var(--ink-soft);
  margin-top: .35rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Product toolbar ---------- */
.product-toolbar {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: stretch;
}

body.category-selected .product-toolbar {
  position: sticky;
  top: var(--sticky-toolbar-top);
  z-index: 30;
  padding: .75rem;
  border-radius: var(--radius);
  background: rgba(250, 246, 239, .96);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(31, 23, 20, 0.08);
}
.search { flex: 1 1 280px; display: flex; }
.search input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
}
.search input:focus, select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.filter-group { display: flex; gap: .5rem; }
.filter-group select {
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; min-width: 200px;
}
.result-count { color: var(--muted); margin: 0 0 1rem; font-size: .9rem; }

/* ---------- Product groups & cards ---------- */
.group-block { margin-bottom: 2.5rem; }
.group-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  border-bottom: 2px solid var(--brand);
  padding-bottom: .5rem; margin-bottom: 1rem;
}
.group-header h3 {
  font-size: 1.5rem; color: var(--brand-dark);
  text-transform: capitalize; margin: 0;
}
.group-header .group-count { font-size: .85rem; color: var(--muted); }

.dept-block { margin: 1.25rem 0 1.5rem; }
.dept-name {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0 0 .5rem;
  text-transform: capitalize;
}
.dept-name .pill {
  display: inline-block; margin-left: .5rem;
  background: var(--accent-soft); color: var(--brand-dark);
  font-size: .7rem; padding: .15rem .55rem; border-radius: 999px;
  font-family: inherit; letter-spacing: .04em;
  text-transform: uppercase;
}

.cat-subhead {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 1rem 0 .5rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.product-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.product-img {
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img.placeholder::after {
  content: "Cairns Butcher Supplies";
  position: absolute;
  font-family: Georgia, serif;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .05em;
  text-align: center; padding: 0 .5rem;
}

.product-body {
  padding: .85rem 1rem 1rem;
  display: flex; flex-direction: column; gap: .35rem;
  flex: 1;
}
.product-name {
  font-weight: 600; font-size: .98rem;
  color: var(--ink); margin: 0;
  text-transform: capitalize;
}
.product-meta { font-size: .8rem; color: var(--muted); }
.product-price {
  margin-top: auto;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.product-soldout {
  display: inline-block;
  font-size: .7rem;
  background: #f3d6d6; color: var(--brand-dark);
  padding: .15rem .5rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
  margin-top: .25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ---------- Visit / Location ---------- */
.visit-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 820px) {
  .visit-grid { grid-template-columns: 1fr; }
}
.visit-info h2 { margin-top: 0; }
.address-block { margin: 1rem 0; }
.address-block p { margin: .25rem 0; }
.contact-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .35rem; }
.contact-list a { color: #f5d28a; }

.hours-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.hours-card h3 { margin-top: 0; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  text-align: left; padding: .55rem .25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .95rem;
}
.hours-table th { font-weight: 600; color: #f5ecdc; width: 45%; }
.hours-table td { color: rgba(255,255,255,.85); }
.hours-table tr.today th, .hours-table tr.today td {
  color: #f5d28a;
  font-weight: 700;
}
.hours-table .closed { color: rgba(255,255,255,.55); font-style: italic; }
.now-status {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  background: rgba(255,255,255,.1);
  margin-bottom: 1rem;
}
.now-status .dot {
  width: .6rem; height: .6rem; border-radius: 50%;
  background: #888;
}
.now-status.open .dot { background: #6dd47b; box-shadow: 0 0 0 4px rgba(109,212,123,.2); }
.now-status.closed .dot { background: #d96b6b; }

.map-link {
  display: inline-block; margin-top: .75rem;
  background: var(--accent); color: #1f1714;
  padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 600;
}
.map-link:hover { text-decoration: none; background: #d09a3a; }

/* ---------- Footer ---------- */
.site-footer {
  background: #110b09;
  color: #d9cdb8;
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.footer-brand {
  font-family: Georgia, serif;
  font-weight: 700;
  color: #fff;
  font-size: 1.15rem;
  margin: 0 0 .5rem;
}
.footer-meta { text-align: right; }
.footer-meta .muted { color: #8e8170; font-size: .85rem; }
.site-footer a { color: #f5d28a; }
@media (max-width: 600px) {
  .footer-meta { text-align: left; }
}

/* ---------- Misc ---------- */
.loading { color: var(--muted); font-style: italic; }
.back-to-top {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 0;
  font-size: 1.25rem; cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--brand-dark); }

mark {
  background: var(--accent-soft);
  padding: 0 .15em;
  border-radius: 2px;
}

/* ---------- Error pages ---------- */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(184, 132, 43, 0.14), transparent 38%),
    radial-gradient(circle at 85% 0%, rgba(122, 31, 31, 0.1), transparent 42%),
    var(--bg);
}

.error-card {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 2.5vw, 2rem);
}

.error-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-size: .75rem;
  margin: 0 0 .5rem;
}

.error-title {
  margin: 0 0 .65rem;
  color: var(--brand-dark);
}

.error-lede {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.error-note {
  margin: 0 0 1.25rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--ink-soft);
}

.error-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.error-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .6rem;
}

.error-links li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.error-links .label {
  color: var(--muted);
  font-size: .85rem;
  min-width: 8.8rem;
}

.error-links a {
  font-weight: 600;
}

.error-help {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: .95rem;
}

@media (max-width: 560px) {
  .error-links li {
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
  }

  .error-links .label {
    min-width: 0;
  }
}
