/*
Theme Name: Cascade Ballistics
Theme URI: https://cascadeballistics.com/
Author: Cascade Ballistics Corp
Author URI: https://cascadeballistics.com/
Description: Custom storefront theme for CascadeBallistics.com (Freedom For Less). Hand-built — no parent theme, no framework. Optimized for the multi-vendor catalog and Max Mega Menu integration.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
Text Domain: cascade-ballistics
Tags: e-commerce, woocommerce, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ------------------------------------------------------------------ */
/* Tokens                                                             */
/* ------------------------------------------------------------------ */
:root {
  --cb-bg: #ffffff;
  --cb-surface-dark: #0f172a;
  --cb-text: #1e293b;
  --cb-muted: #64748b;
  --cb-border: #e2e8f0;
  --cb-accent: #d97706;
  --cb-accent-hover: #b45309;
  --cb-on-dark: #f8fafc;
  --cb-on-dark-muted: #cbd5e1;

  --cb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
             Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
             "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --cb-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
             "Liberation Mono", "Courier New", monospace;

  --cb-radius: 6px;
  --cb-radius-lg: 10px;

  --cb-container: 1280px;
  --cb-gap: 1.25rem;

  --cb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --cb-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* ------------------------------------------------------------------ */
/* Reset                                                              */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cb-bg);
  color: var(--cb-text);
  font-family: var(--cb-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cb-accent); text-decoration: none; }
a:hover { color: var(--cb-accent-hover); text-decoration: underline; }
ul, ol { padding-left: 1.25rem; }

/* ------------------------------------------------------------------ */
/* Typography                                                         */
/* ------------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  color: var(--cb-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; }

/* ------------------------------------------------------------------ */
/* Layout                                                             */
/* ------------------------------------------------------------------ */
.cb-container {
  width: 100%;
  max-width: var(--cb-container);
  margin: 0 auto;
  padding: 0 1rem;
}
.cb-section { padding: 3rem 0; }
.cb-section--tight { padding: 1.75rem 0; }

.cb-grid { display: grid; gap: var(--cb-gap); }
.cb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 960px) {
  .cb-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cb-grid--4, .cb-grid--3, .cb-grid--2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Buttons                                                            */
/* ------------------------------------------------------------------ */
.cb-btn,
.button,
button.button,
input[type="submit"] {
  display: inline-block;
  background: var(--cb-accent);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: var(--cb-radius);
  font-weight: 600;
  text-transform: none;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.cb-btn:hover,
.button:hover,
input[type="submit"]:hover {
  background: var(--cb-accent-hover);
  color: #fff;
  text-decoration: none;
}
.cb-btn--lg { padding: 0.95rem 1.8rem; font-size: 1.05rem; }
.cb-btn--ghost {
  background: transparent;
  color: var(--cb-on-dark);
  border: 1px solid var(--cb-on-dark-muted);
}
.cb-btn--ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.cb-site-header { border-bottom: 1px solid var(--cb-border); }

.cb-topbar {
  background: var(--cb-surface-dark);
  color: var(--cb-on-dark);
}
.cb-topbar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1rem;
  max-width: var(--cb-container);
  margin: 0 auto;
}
.cb-brand a {
  color: var(--cb-on-dark);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.cb-brand__tagline {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--cb-on-dark-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cb-search { width: 100%; max-width: 620px; justify-self: center; }
.cb-search__form {
  display: flex;
  background: #fff;
  border-radius: var(--cb-radius);
  overflow: hidden;
  box-shadow: var(--cb-shadow-sm);
}
.cb-search__input {
  flex: 1;
  border: 0;
  padding: 0.7rem 0.9rem;
  color: var(--cb-text);
  background: transparent;
}
.cb-search__input:focus { outline: 2px solid var(--cb-accent); outline-offset: -2px; }
.cb-search__submit {
  background: var(--cb-accent);
  color: #fff;
  padding: 0 1.1rem;
  border: 0;
  font-weight: 600;
}
.cb-search__submit:hover { background: var(--cb-accent-hover); }

.cb-utility { display: flex; gap: 1.25rem; align-items: center; }
.cb-utility a {
  color: var(--cb-on-dark);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}
.cb-utility a:hover { color: var(--cb-accent); }
.cb-cart-count {
  background: var(--cb-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  min-width: 1.4rem;
  text-align: center;
}

.cb-navbar { background: #fff; border-top: 1px solid var(--cb-border); }
.cb-navbar__inner {
  max-width: var(--cb-container);
  margin: 0 auto;
  padding: 0 1rem;
}
.cb-navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.cb-navbar li > a {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--cb-text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.cb-navbar li > a:hover,
.cb-navbar .current-menu-item > a {
  color: var(--cb-accent);
  border-bottom-color: var(--cb-accent);
}
.cb-navbar__empty {
  padding: 0.85rem 0;
  color: var(--cb-muted);
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .cb-topbar__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand utility" "search search";
  }
  .cb-brand   { grid-area: brand; }
  .cb-utility { grid-area: utility; }
  .cb-search  { grid-area: search; max-width: none; }
}

/* ------------------------------------------------------------------ */
/* Hero                                                               */
/* ------------------------------------------------------------------ */
.cb-hero {
  background: var(--cb-surface-dark);
  color: var(--cb-on-dark);
  padding: 5rem 1rem;
  text-align: center;
}
.cb-hero h1 {
  color: #fff;
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 0.5rem;
}
.cb-hero__sub {
  color: var(--cb-on-dark-muted);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}
.cb-hero .cb-search {
  margin: 0 auto 1.5rem;
  max-width: 640px;
}
.cb-hero__cta { margin-top: 0.5rem; }

/* ------------------------------------------------------------------ */
/* Category tiles                                                     */
/* ------------------------------------------------------------------ */
.cb-tiles {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1100px) { .cb-tiles { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .cb-tiles { grid-template-columns: repeat(2, 1fr); } }

.cb-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 0.75rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  background: #fff;
  color: var(--cb-text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cb-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--cb-shadow-md);
  border-color: var(--cb-accent);
  color: var(--cb-accent);
  text-decoration: none;
}
.cb-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fef3c7;
  color: var(--cb-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
}
.cb-tile__label { font-weight: 600; font-size: 0.95rem; }

/* ------------------------------------------------------------------ */
/* Value props                                                        */
/* ------------------------------------------------------------------ */
.cb-valueprops {
  background: #f8fafc;
  border-top: 1px solid var(--cb-border);
  border-bottom: 1px solid var(--cb-border);
}
.cb-valueprops__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.5rem 0;
}
@media (max-width: 800px) { .cb-valueprops__grid { grid-template-columns: repeat(2, 1fr); } }
.cb-valueprop {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.75rem;
}
.cb-valueprop__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--cb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-accent);
  font-weight: 700;
}
.cb-valueprop__title { font-weight: 600; font-size: 0.95rem; }
.cb-valueprop__sub   { font-size: 0.8rem; color: var(--cb-muted); }

/* ------------------------------------------------------------------ */
/* Featured products                                                  */
/* ------------------------------------------------------------------ */
.cb-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.cb-section__heading h2 { margin: 0; }
.cb-section__heading a  { font-weight: 600; }

.cb-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 1000px) { .cb-product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .cb-product-grid { grid-template-columns: repeat(2, 1fr); } }

.cb-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.cb-product-card:hover { box-shadow: var(--cb-shadow-md); transform: translateY(-2px); }
.cb-product-card a { color: inherit; text-decoration: none; }
.cb-product-card__thumb {
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cb-product-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cb-product-card__body { padding: 0.9rem 1rem 1.1rem; }
.cb-product-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--cb-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cb-product-card__price { color: var(--cb-accent); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* WooCommerce wrapper                                                */
/* ------------------------------------------------------------------ */
.cb-wc-wrap { padding: 2rem 0 3rem; }
.cb-wc-wrap .woocommerce { margin: 0; }

/* ------------------------------------------------------------------ */
/* Footer                                                             */
/* ------------------------------------------------------------------ */
.cb-site-footer {
  background: var(--cb-surface-dark);
  color: var(--cb-on-dark);
  margin-top: 4rem;
}
.cb-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  padding: 3rem 1rem;
  max-width: var(--cb-container);
  margin: 0 auto;
}
@media (max-width: 900px) { .cb-footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cb-footer-cols { grid-template-columns: 1fr; } }

.cb-footer-col h3 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.cb-footer-col ul { list-style: none; padding: 0; margin: 0; }
.cb-footer-col li { margin-bottom: 0.5rem; }
.cb-footer-col a {
  color: var(--cb-on-dark-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.cb-footer-col a:hover { color: var(--cb-accent); text-decoration: none; }

.cb-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--cb-on-dark-muted);
  font-size: 0.85rem;
}
.cb-footer-bottom span + span::before {
  content: " · ";
  color: rgba(255,255,255,0.3);
  margin: 0 0.25rem;
}

/* ------------------------------------------------------------------ */
/* Utility                                                            */
/* ------------------------------------------------------------------ */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cb-accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }
