/* ============================================================
   Down Range Firearms — design tokens
   Palette pulled from the brand mark: white ground, brass ring,
   gunmetal silver, crimson underline.
   ============================================================ */
:root {
  --ink: #18191a;
  --ink-raised: #212224;
  --ink-line: #35373a;
  --steel: #d8d7d3;
  --steel-dim: #98968f;
  --brass: #a67827;
  --brass-bright: #c99a3f;
  --crimson: #c53347;
  --crimson-bright: #e0435a;
  --paper: #f2f1ec;
  --paper-dim: #3a3b3d;
  --ink-on-paper: #efeeea;

  --font-display: "Bitter", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --nav-h: 132px;
  --edge: 1px solid var(--ink-line);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--steel);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--paper);
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 700;
}

p { margin: 0 0 1em; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline;
  margin-bottom: 18px;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--crimson);
  display: inline-block;
  vertical-align: middle;
}
.eyebrow::before { margin-right: 10px; }
.eyebrow::after { margin-left: 10px; }

/* ---------- reticle bracket frame — signature motif ----------
   Echoes the crosshair-ring ticks on the brand mark. Used to
   frame the hero art, photo placeholders, and stat cards. */
.bracket-frame {
  position: relative;
  padding: 22px;
}
.bracket-frame::before,
.bracket-frame::after,
.bracket-frame > .bf-tl,
.bracket-frame > .bf-tr,
.bracket-frame > .bf-bl,
.bracket-frame > .bf-br {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--brass);
}
.bracket-frame::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.bracket-frame::after  { top: 0; right: 0; border-left: none; border-bottom: none; }
.bracket-frame > .bf-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.bracket-frame > .bf-br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* crosshair tick divider */
.tick-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--brass);
  margin: 0 auto;
  width: fit-content;
}
.tick-divider::before, .tick-divider::after {
  content: "";
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-line));
}
.tick-divider::before { background: linear-gradient(90deg, transparent, var(--ink-line)); }
.tick-divider .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--crimson); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn--brass {
  background: var(--brass);
  color: var(--ink);
}
.btn--brass:hover { background: var(--brass-bright); }
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--ink-line);
}
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-bright); }
.btn--crimson { background: var(--crimson); color: #ffffff; }
.btn--crimson:hover { background: var(--crimson-bright); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Top utility bar + nav
   ============================================================ */
.topbar {
  background: var(--ink-raised);
  border-bottom: var(--edge);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--steel-dim);
}
.topbar .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
  gap: 6px 16px;
  padding-top: 6px;
  padding-bottom: 6px;
  max-width: 1400px;
}
.topbar a:hover { color: var(--brass-bright); }
.topbar .topbar-right { display: flex; gap: 22px; }
.topbar .topbar-right a { white-space: nowrap; }

@media (max-width: 420px) {
  .topbar { font-size: 0.62rem; }
  .topbar .topbar-right { gap: 12px; }
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(24, 25, 26, 0.94);
  border-bottom: var(--edge);
  backdrop-filter: blur(6px);
  transition: box-shadow 0.25s ease;
}
.navbar.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }

/* ---------- scroll reveal ----------
   Progressive enhancement: only hides content once JS has
   confirmed it can reveal it again (see html.js below). */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 98px;
  gap: 16px;
  max-width: 1400px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand img { height: 72px; width: 72px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; }
.brand-text .name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--paper);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
  white-space: nowrap;
}
.brand-text .place {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 15px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brass);
  border-bottom-color: var(--crimson);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-phone {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--paper);
  white-space: nowrap;
}
.nav-phone strong { color: var(--brass); }

.cart-btn {
  position: relative;
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--paper);
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-btn:hover { border-color: var(--brass); color: var(--brass-bright); }
.cart-count {
  background: var(--crimson);
  color: #ffffff;
  font-size: 0.68rem;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--paper);
  padding: 10px 12px;
  cursor: pointer;
}

@media (max-width: 1260px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-phone { display: none; }
}

@media (max-width: 560px) {
  .navbar .container { flex-wrap: nowrap; gap: 10px; }
  .brand { flex-shrink: 1; min-width: 0; gap: 10px; }
  .brand img { height: 52px; width: 52px; }
  .brand-text { min-width: 0; }
  .brand-text .name {
    white-space: normal;
    font-size: 0.98rem;
    line-height: 1.15;
  }
  .brand-text .place { white-space: normal; }
  .nav-right { flex-shrink: 0; gap: 8px; }
}

.mobile-menu {
  display: none;
  border-top: var(--edge);
  background: var(--ink);
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 10px 24px 20px; }
.mobile-menu a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  border-bottom: var(--edge);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 82% 20%, rgba(198, 162, 83, 0.10), transparent),
    linear-gradient(180deg, rgba(24,25,26,0.55) 0%, rgba(24,25,26,0.68) 100%),
    url('../img/hero-handgun-ammo.jpg?v=2') center 35% / cover no-repeat;
  border-bottom: var(--edge);
}
.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 88px;
  min-height: 560px;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.2vw, 3.6rem);
  letter-spacing: 0.01em;
}
.hero h1 .accent { color: var(--brass); }
.hero-sub {
  color: var(--steel);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-art .bracket-frame img {
  width: min(360px, 100%);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.5));
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 48px; text-align: left; }
  .hero-art { order: -1; margin-bottom: 8px; }
  .hero-art .bracket-frame img { width: 180px; }
}

/* ============================================================
   Sections (generic)
   ============================================================ */
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--raised { background: var(--ink-raised); border-top: var(--edge); border-bottom: var(--edge); }
.section--paper { background: #0a0a0a; color: var(--ink-on-paper); }
.section--paper h1, .section--paper h2, .section--paper h3 { color: var(--ink-on-paper); }
.section--paper .eyebrow { color: var(--crimson); }
.section--paper .eyebrow::before { background: var(--brass); }

.section-head { max-width: 62ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: var(--steel-dim); }
.section--paper .section-head p { color: #b0aeaa; }

/* ---------- quick facts strip ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink-line);
  border-top: var(--edge);
  border-bottom: var(--edge);
}
.fact {
  background: var(--ink);
  padding: 40px 36px;
}
.fact .icon { color: var(--brass); margin-bottom: 18px; }
.fact h3 { font-size: 1.1rem; margin-bottom: 8px; }
.fact p { color: var(--steel-dim); margin: 0; font-size: 0.95rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* ---------- category grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

.cat-card {
  border: var(--edge);
  padding: 30px 24px;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cat-card:hover { border-color: var(--brass); transform: translateY(-3px); }
.cat-card .cat-index { font-family: var(--font-mono); color: var(--brass); font-size: 0.75rem; letter-spacing: 0.1em; }
.cat-card h3 { margin: 14px 0 10px; font-size: 1.25rem; }
.cat-card p { color: var(--steel-dim); font-size: 0.92rem; margin-bottom: 18px; }
.cat-card .cat-link { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; color: var(--brass); letter-spacing: 0.06em; }
.cat-card.is-instore { opacity: 0.92; }
.cat-card .tag {
  position: absolute; top: 24px; right: 24px;
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em;
  color: var(--crimson-bright); text-transform: uppercase;
}

/* ---------- process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  counter-reset: step;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { border-left: 2px solid var(--brass); padding-left: 22px; }
.step .num {
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 10px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--steel-dim); font-size: 0.95rem; margin: 0; }
.section--paper .step p { color: #b0aeaa; }

/* ---------- two column band ---------- */
.band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } }
.band ul { padding-left: 0; list-style: none; margin: 0; }
.band ul li {
  padding: 12px 0;
  border-bottom: var(--edge);
  font-size: 0.95rem;
}
.section--paper .band ul li { border-bottom: 1px solid var(--paper-dim); }
.band ul li strong { color: var(--brass); font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 3px; }
.section--paper .band ul li strong { color: var(--crimson); }

.callout {
  border: 1px solid var(--brass);
  padding: 24px 26px;
  margin-top: 24px;
  font-size: 0.92rem;
  background: rgba(198,162,83,0.06);
}
.section--paper .callout { background: rgba(167,38,56,0.05); border-color: var(--crimson); }

/* ---------- about / mission ---------- */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) { .mission-grid { grid-template-columns: 1fr; } }
.mission-card { text-align: left; }
.mission-card .mark { font-family: var(--font-display); font-size: 2rem; color: var(--brass); margin-bottom: 10px; }

.quote-block {
  border-left: 3px solid var(--crimson);
  padding-left: 26px;
  margin: 40px 0;
}
.quote-block p { font-family: var(--font-display); font-size: 1.3rem; color: var(--paper); font-style: italic; }
.section--paper .quote-block p { color: var(--ink-on-paper); }
.quote-block cite { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brass); font-style: normal; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- hours / location ---------- */
.hours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 860px) { .hours-grid { grid-template-columns: 1fr; } }
table.hours { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.92rem; }
table.hours td { padding: 12px 0; border-bottom: var(--edge); }
.section--paper table.hours td { border-bottom: 1px solid var(--paper-dim); }
table.hours td:last-child { text-align: right; color: var(--brass); }
.section--paper table.hours td:last-child { color: var(--crimson); }
.map-frame { border: var(--edge); }
.map-frame iframe { width: 100%; height: 320px; border: 0; display: block; filter: grayscale(0.4) contrast(1.05); }

/* ---------- contact form ---------- */
.form-grid { display: grid; gap: 18px; max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
  display: block;
  margin-bottom: 6px;
}
.section--paper label { color: var(--crimson); }
input, select, textarea {
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  color: var(--paper);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.section--paper input, .section--paper select, .section--paper textarea {
  background: #212224;
  border-color: var(--paper-dim);
  color: var(--ink-on-paper);
}
input:focus, select:focus, textarea:focus { border-color: var(--brass); }
textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.85rem; color: var(--steel-dim); margin-top: 4px; }
.section--paper .form-note { color: #b0aeaa; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-family: var(--font-mono); font-size: 0.85rem; margin-top: 12px; display: none; }
.form-status.show { display: block; }
.form-status.ok { color: var(--brass); }

/* ============================================================
   Shop page
   ============================================================ */
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 40px;
}
.filter-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 16px;
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--steel);
  cursor: pointer;
}
.chip:hover { border-color: var(--brass); }
.chip.active { background: var(--brass); border-color: var(--brass); color: var(--ink); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 980px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .product-grid { grid-template-columns: 1fr; } }

.product-card { border: var(--edge); display: flex; flex-direction: column; cursor: pointer; }
.product-card .add-btn, .product-card .add-btn:disabled { cursor: pointer; }
.product-card .add-btn:disabled { cursor: not-allowed; }
.product-photo {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(45deg, var(--ink-raised) 0 2px, transparent 2px 14px);
  border-bottom: var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--steel-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 18px;
}
.product-photo.has-image { padding: 0; background: none; position: relative; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- multi-photo gallery within a product card ---------- */
.photo-scroll {
  display: flex;
  position: absolute;
  inset: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.photo-scroll::-webkit-scrollbar { display: none; }
.photo-scroll img { flex: 0 0 100%; scroll-snap-align: start; }
.photo-scroll img.photo-inset {
  object-fit: contain;
  padding: 14%;
  box-sizing: border-box;
  background: var(--ink-raised);
}
.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(12, 11, 9, 0.55);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  z-index: 2;
  transition: background 0.15s ease;
}
.photo-nav:hover { background: rgba(12, 11, 9, 0.8); }
.photo-nav.prev { left: 10px; }
.photo-nav.next { right: 10px; }
.photo-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.photo-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease;
}
.photo-dots span.active { background: #fff; }
.product-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat { font-family: var(--font-mono); font-size: 0.68rem; color: var(--brass); text-transform: uppercase; letter-spacing: 0.08em; }
.product-body h3 { font-size: 1.05rem; margin: 0; }
.product-spec { font-family: var(--font-mono); font-size: 0.8rem; color: var(--steel-dim); }
.product-desc { font-size: 0.85rem; color: var(--steel-dim); margin: 6px 0 0; line-height: 1.5; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price { font-family: var(--font-mono); font-size: 1.05rem; color: var(--paper); }
.add-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--brass);
  color: var(--brass);
  padding: 8px 14px;
  cursor: pointer;
}
.add-btn:hover { background: var(--brass); color: var(--ink); }
.add-btn.added { background: var(--crimson); border-color: var(--crimson); color: #ffffff; }

.instore-note {
  border: 1px dashed var(--ink-line);
  padding: 22px 24px;
  margin-bottom: 48px;
  font-size: 0.92rem;
  color: var(--steel-dim);
}
.instore-note strong { color: var(--brass); }

/* Davidson's catalog photos vary wildly in composition (some are plain
   product shots, some are diagrams with lots of surrounding whitespace),
   so cropping to fill (cover) can cut off important parts. Show the whole
   image instead, scoped to catalog cards only - the homepage's own shop
   photos (.product-photo outside .product-card) keep the cover crop. */
.product-card .product-photo.has-image { background: #fff; }
.product-card .product-photo.has-image img { object-fit: contain; }
/* Keep every catalog photo box the same fixed 4:3 size no matter what shape
   the image is. Without this the box stretched to fit each image as it
   lazy-loaded while scrolling, so cards changed height and photos appeared
   to grow/zoom. The image is laid over the box instead of sizing it. */
.product-card .product-photo.has-image { overflow: hidden; }
.product-card .product-photo.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- photo lightbox / product detail panel ---------- */
.product-photo img { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 11, 9, 0.9);
  z-index: 90;
  overflow-y: auto;
  padding: 70px 24px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.lightbox-photo {
  position: relative;
  flex: 1 1 440px;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #fff;
}
.lightbox-details {
  flex: 1 1 360px;
  max-width: 460px;
  padding: 24px 28px;
  background: var(--ink-raised);
  border: var(--edge);
  align-self: stretch;
  display: none;
}
.lightbox-details.show { display: block; }
.lightbox-details h3 { color: var(--paper); font-size: 1.2rem; margin: 0 0 10px; }
.lightbox-price {
  font-family: var(--font-mono); color: var(--brass); font-size: 1.15rem; margin-bottom: 18px;
}
.lightbox-specs {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0;
}
.lightbox-specs dt {
  font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--steel-dim); white-space: nowrap;
}
.lightbox-specs dd { margin: 0; color: var(--paper); font-size: 0.9rem; }
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 91;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
@media (max-width: 620px) {
  .lightbox-overlay { padding: 56px 16px 32px; }
  .lightbox-content { gap: 18px; }
  .lightbox-details { padding: 18px 20px; }
  .lightbox-nav { width: 38px; height: 38px; }
}

/* ---------- cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--ink);
  border-left: var(--edge);
  z-index: 61;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px;
  border-bottom: var(--edge);
  position: sticky;
  top: 0;
  background: var(--ink);
  z-index: 2;
  flex-shrink: 0;
}
.cart-head h3 { margin: 0; font-size: 1.1rem; }
.cart-close { background: transparent; border: none; color: var(--paper); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.cart-items { padding: 12px 24px; }
.cart-empty { color: var(--steel-dim); padding: 40px 0; text-align: center; font-family: var(--font-mono); font-size: 0.85rem; }
.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: var(--edge); }
.cart-item .ci-photo {
  width: 56px; height: 56px; flex-shrink: 0;
  background: var(--ink-raised);
  border: var(--edge);
}
.cart-item .ci-info { flex: 1; }
.cart-item h4 { margin: 0 0 4px; font-size: 0.92rem; color: var(--paper); font-family: var(--font-body); font-weight: 600; }
.cart-item .ci-spec { font-family: var(--font-mono); font-size: 0.72rem; color: var(--steel-dim); }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn { background: transparent; border: 1px solid var(--ink-line); color: var(--paper); width: 24px; height: 24px; cursor: pointer; font-family: var(--font-mono); }
.qty-row span { font-family: var(--font-mono); font-size: 0.85rem; min-width: 16px; text-align: center; }
.ci-remove { font-family: var(--font-mono); font-size: 0.7rem; color: var(--crimson-bright); background: none; border: none; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; }
.ci-price { font-family: var(--font-mono); font-size: 0.9rem; text-align: right; white-space: nowrap; }

.cart-foot { padding: 20px 24px 26px; border-top: var(--edge); }
.cart-subtotal { display: flex; justify-content: space-between; font-family: var(--font-mono); margin-bottom: 16px; font-size: 0.95rem; }
.cart-subtotal strong { color: var(--brass); }
.cart-foot .form-note { margin-bottom: 14px; }
.cart-foot .btn { width: 100%; justify-content: center; }

.cart-pay { padding: 20px 24px 0; border-top: var(--edge); }
.cart-pay h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin: 0 0 14px;
}
.pay-field { margin-bottom: 12px; }
.pay-field label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel-dim);
  display: block;
  margin-bottom: 5px;
}
.pay-field input,
.pay-field select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  color: var(--steel-dim);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.88rem;
}
.pay-field select { appearance: auto; }
.pay-field select option { background: var(--ink); color: var(--steel-dim); }
.pay-field input:disabled { cursor: not-allowed; opacity: 0.7; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-field {
  background: var(--ink);
  border: 1px solid var(--ink-line);
  padding: 4px 10px;
  min-height: 38px;
  box-sizing: border-box;
}
.cc-field iframe { display: block; }
.secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--steel-dim);
  margin: 4px 0 18px;
}
.cc-icons { display: flex; gap: 10px; margin-bottom: 16px; }
.cc-icons i { font-size: 1.6rem; color: var(--steel-dim); }
.secure-note svg { flex-shrink: 0; color: var(--brass); }

.apple-pay-wrap, .google-pay-wrap { margin-bottom: 14px; min-height: 40px; }
.apple-pay-wrap .apple-pay-button {
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 6px;
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: buy;
  -apple-pay-button-style: white-outline;
}
.google-pay-wrap .google-pay-button { display: flex; width: 100%; }
.google-pay-wrap .google-pay-button > button { width: 100% !important; }
.pay-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--steel-dim); }
.pay-divider::before, .pay-divider::after { content: ""; flex: 1; height: 1px; background: var(--ink-line); }

.delivery-block { margin: 4px 0 18px; padding: 14px; background: var(--ink); border: 1px solid var(--ink-line); }
.delivery-block h4 { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brass); margin: 0 0 8px; }
.delivery-block .form-note { margin-top: 0; margin-bottom: 12px; }
.delivery-block .pay-field:last-child { margin-bottom: 0; }
.radio-choice { display: flex; flex-direction: column; gap: 8px; }
.radio-choice label { display: flex; align-items: flex-start; gap: 8px; font-family: var(--font-body); font-size: 0.85rem; color: var(--steel-dim); line-height: 1.4; cursor: pointer; }
.radio-choice input[type="radio"] { width: 16px; height: 16px; margin-top: 2px; padding: 0; background: none; border: none; flex-shrink: 0; }
.ack-field { margin: 4px 0 16px; }
.ack-label { display: flex; align-items: flex-start; gap: 8px; font-family: var(--font-body); font-size: 0.8rem; color: var(--steel-dim); line-height: 1.4; cursor: pointer; }
.ack-label input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; padding: 0; background: none; border: none; flex-shrink: 0; }
.cart-total { font-size: 1.05rem; padding-top: 10px; border-top: 1px dashed var(--ink-line); }
.cart-total strong { color: var(--brass); }

.catalog-search { display: flex; gap: 10px; max-width: 100%; }
.catalog-search input {
  background: var(--ink); border: 1px solid var(--ink-line); color: var(--steel-dim);
  padding: 10px 14px; font-family: var(--font-body); font-size: 0.88rem; min-width: 0; flex: 1 1 240px;
}
.catalog-search .btn { flex: 0 0 auto; }
.catalog-stock-toggle {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 0.78rem; color: var(--steel-dim); cursor: pointer;
}
.catalog-stock-toggle input { width: 16px; height: 16px; }
.catalog-pagination { display: flex; align-items: center; gap: 16px; margin-top: 36px; }

.catalog-facets { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.catalog-facet-field { margin-bottom: 0; min-width: 200px; flex: 1 1 200px; max-width: 280px; }
.catalog-clear-filters {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--crimson-bright);
  text-decoration: underline; white-space: nowrap;
}
.catalog-clear-filters:hover { color: var(--brass); }

.ffl-search-wrap { position: relative; }
.ffl-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  background: var(--ink); border: 1px solid var(--ink-line); border-top: none;
  max-height: 260px; overflow-y: auto; display: none;
}
.ffl-results.show { display: block; }
.ffl-result {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--ink-line);
  font-size: 0.85rem; color: var(--steel-dim);
}
.ffl-result:hover { background: var(--ink-raised); color: var(--paper); }
.ffl-result strong { display: block; color: var(--paper); font-size: 0.88rem; }
.ffl-result-empty { padding: 10px 12px; font-size: 0.85rem; color: var(--steel-dim); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--ink-raised);
  border-top: var(--edge);
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.footer-brand img { height: 48px; width: 48px; }
.footer-brand .name { font-family: var(--font-display); color: var(--paper); font-size: 1.05rem; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; font-size: 0.9rem; color: var(--steel-dim); }
.footer-col a:hover { color: var(--brass-bright); }
.footer-tagline { color: var(--steel-dim); font-size: 0.9rem; max-width: 32ch; }
.footer-bottom {
  border-top: var(--edge);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel-dim);
}

/* ---------- page header (interior pages) ---------- */
.page-hero {
  background:
    linear-gradient(180deg, rgba(24,25,26,0.55) 0%, rgba(24,25,26,0.68) 100%),
    url('../img/hero-handgun-ammo.jpg?v=2') center 35% / cover no-repeat;
  border-bottom: var(--edge);
  padding: 72px 0 56px;
}
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); max-width: 20ch; }
.page-hero p { color: var(--steel-dim); max-width: 60ch; font-size: 1.02rem; }

.legal-note { font-size: 0.85rem; color: var(--steel-dim); border-top: var(--edge); padding-top: 20px; margin-top: 40px; }

/* Safety net: if any one element is ever a few pixels too wide, clip it
   instead of letting phones zoom out / pan the whole page sideways. */
html, body { overflow-x: clip; }

/* ---------- product detail pages ---------- */
.pc-link { color: inherit; text-decoration: none; }
.pc-link:hover { color: var(--brass-bright); }
.lightbox-more {
  display: inline-block; margin-top: 18px; font-family: var(--font-mono); font-size: 0.8rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-bright); text-decoration: underline;
}
.pd-section { padding-top: 40px; }
.pd-crumbs { font-family: var(--font-mono); font-size: 0.75rem; color: var(--steel-dim); margin-bottom: 24px; overflow-wrap: anywhere; }
.pd-crumbs a { color: var(--brass-bright); }
.pd-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .pd-layout { grid-template-columns: 1fr; gap: 24px; } }
.pd-photo.product-photo { aspect-ratio: 1 / 1; background: #fff; border: var(--edge); position: relative; overflow: hidden; padding: 0; }
.pd-photo.product-photo.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pd-info { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.pd-title { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.pd-price { font-family: var(--font-mono); font-size: 1.6rem; color: var(--brass-bright); }
.pd-add { align-self: flex-start; }
.pd-notes { margin: 8px 0 0; padding-left: 20px; color: var(--steel-dim); font-size: 0.9rem; display: flex; flex-direction: column; gap: 8px; }
.pd-h2 { font-size: 1.3rem; margin: 48px 0 16px; }
.pd-features { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; color: var(--steel); }
.pd-specs { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; border: var(--edge); }
.pd-specs dt, .pd-specs dd { margin: 0; padding: 12px 18px; border-bottom: var(--edge); }
.pd-specs dt { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--steel-dim); background: var(--ink-raised); }
.pd-specs dd { color: var(--steel); overflow-wrap: anywhere; }
.pd-specs dt:last-of-type, .pd-specs dd:last-of-type { border-bottom: none; }
@media (max-width: 560px) { .pd-specs { grid-template-columns: 1fr; } .pd-specs dt { border-bottom: none; padding-bottom: 2px; } }
.pd-share { align-self: flex-start; }
.lightbox-actions { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 18px; }
.lightbox-actions .lightbox-more { margin-top: 0; }
button.lightbox-more { background: none; border: none; padding: 0; cursor: pointer; }
.fl-only {
  align-self: flex-start; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brass-bright); border: 1px solid var(--brass);
  padding: 2px 8px; margin-bottom: 2px;
}
