:root {
  --bg: #12263a;        /* Deep Space Blue */
  --white: #ffffff;
  --sky: #adcad6;       /* Pale Sky */
  --button: #fb5012;	/* orange */
  --alert: #db504a;     /* Rosy Copper */
  --text-main: #ffffff;
  --text-muted: #adcad6;
  --card-bg: #192b3f;
  --accent: #ffc53a;    /* School Bus Yellow */
  --border-subtle: rgba(173, 202, 214, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
}

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

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

/* LAYOUT WRAPPER */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* =========================
   HEADER
   ========================= */

.header {
  padding-top: 0rem;
  margin-bottom: 1rem;
}

/* desktop: logo left, blurb right */
.header-top {
  display: flex;
  align-items: center;       /* vertical centering */
  justify-content: flex-start;
  gap: 1.5rem;
}

.logo-block {
  flex-shrink: 0;
}

.logo-block img {
  width: 150px;
  height: auto;
  display: block;
}

/* shared blurb styling */
.header-blurb {
  max-width: 40rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* desktop: show long blurb, hide mobile */
.header-blurb-mobile {
  display: none;
}

/* NAV BAR */

.nav-bar {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.35rem;
  background: #439a86;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-list a {
  text-decoration: none;
  color: #ffffff;
}

.nav-separator {
  color: #ffffff;
}

/* =========================
   MAIN FEATURED PRODUCT
   ========================= */

.main {
  margin-top: 2rem;
}

.featured-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Big featured card */

.featured-card {
  width: 100%;
  max-width: 720px;
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem 1.25rem 1.5rem;
}

/* Placeholder media area */
.featured-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  background: radial-gradient(circle at top left,
              rgba(255, 197, 58, 0.18),
              transparent),
              #21344a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.featured-media img,
.featured-media a {
  width: 100%;
  height: 100%;
  display: block;
}

.featured-media img {
  object-fit: contain;
  object-position: center;
}

.featured-content h1 {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}

.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.featured-tag-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background-color: var(--button);
}

.featured-copy {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
}

.btn-primary {
  background-color: var(--button);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-secondary:hover {
  border-color: var(--button);
  color: var(--button);
}

/* RELATED PRODUCTS ROW */

.related-section {
  width: 100%;
  max-width: 720px;
  margin: 1.75rem auto 0;
}

.related-heading {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.related-grid {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.related-card {
  flex: 1 1 0;
  min-width: 0;
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  padding: 0.9rem 0.9rem 1rem;
}

.related-title {
  font-size: 0.95rem;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.related-title a {
  text-decoration: none;
}

.related-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.related-media {
  border-radius: 0.5rem;
}

/* stack nicely on small screens */
@media (max-width: 640px) {
  .related-grid {
    flex-direction: column;
  }
}

/* Refresh button under card */

.refresh-button {
  margin-top: 0.5rem;
}

/* CATEGORIES PAGE */

.categories-section {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.categories-heading {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.category-card {
  text-align: center;
}

.category-link {
  display: block;
}

.category-box {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.category-title {
  font-size: 0.95rem;
}

/* mobile: 1 x 9 stack */
@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

/* ALL PRODUCTS LISTING */

.products-filters {
    max-width: none;
    width: 100%;
    margin: 1rem 0rem 1.5rem 0rem;
    padding-left: .5rem; /* optional: match grid left padding */
    padding-right: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.products-filters form {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

.filters-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filters-group select {
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-subtle);
  background-color: #0f2032;
  color: var(--text-main);
  font-size: 0.9rem;
}

/* grid of products: 3 columns desktop, 1 mobile */

.products-grid {
  max-width: 960px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.product-card {
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
}

.product-link {
  display: block;
  text-align: center;
}

.product-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: #21344a;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* never crop products: square, portrait, and landscape all fit */
  object-position: center;
}

.product-title {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.product-price {
  font-size: 1rem;
  color: #ffffff;
}

/* pagination */

.products-pagination {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.page-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.page-btn-active {
  background-color: var(--button);
  color: #ffffff;
  border-color: transparent;
}

.page-btn-disabled {
  opacity: 0.4;
  cursor: default;
}

/* responsive */

@media (max-width: 640px) {

  .products-filters {
  justify-content: flex-start;
}

  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* FOOTER */

.footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 640px) {
  .header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
  }

  .logo-block img {
    width: 145px;
    margin-bottom: 0;
  }

  /* hide desktop blurb, show mobile one */
  .header-blurb-desktop {
    display: none;
  }

  .header-blurb-mobile {
    display: block;
    max-width: 90%;
    margin: 0.35rem 0 1rem;   /* tight gap above/below */
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .nav-bar {
    margin-top: 0;               /* kills that big gap */
  }

  .nav-list {
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    font-size: 0.9rem;
  }

.nav-separator {
  color: #ffffff;
  }
}

/* =========================
   v2 ADDITIONS (audit fixes)
   ========================= */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #12263a;
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 0.4rem 0;
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { left: 0; }

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.featured-content h1 a:hover,
.related-title a:hover,
.featured-tag a:hover { color: var(--accent); }
.featured-tag a { text-decoration: underline; text-underline-offset: 2px; }

.featured-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.affiliate-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}
.affiliate-note a,
.text-link,
.footer a,
.products-empty a { color: var(--button); text-decoration: underline; text-underline-offset: 2px; }

.bullet-list {
  list-style: disc;
  padding-left: 1.2rem;
}
.bullet-list li + li { margin-top: 0.15rem; }

.detail-heading { font-size: 1.1rem; margin-bottom: 0.5rem; }
.detail-subheading { font-size: 1.05rem; margin: 0.75rem 0 0.35rem; }

/* related cards: fixed square frame so portrait/landscape images line up */
.related-card {
  display: flex;
  flex-direction: column;
  max-width: calc((100% - 1.8rem) / 3);
}
.related-card .btn { margin-top: auto; align-self: flex-start; }
.related-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #21344a;
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.related-price { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.35rem; }

/* listing page */
.products-heading {
  font-size: 1.3rem;
  margin: 0 0 0.5rem 0.5rem;
}
.products-heading-q { color: var(--text-muted); font-weight: 400; }

.filters-group input[type="search"] {
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-subtle);
  background-color: #0f2032;
  color: var(--text-main);
  font-size: 0.9rem;
  min-width: 14rem;
}
.filters-actions { flex-direction: row; align-items: center; gap: 0.75rem; }
.btn-small { padding: 0.35rem 0.9rem; font-size: 0.85rem; background: transparent; font-family: inherit; }
.filters-reset { font-size: 0.85rem; color: var(--text-muted); text-decoration: underline; }
.products-empty { grid-column: 1 / -1; color: var(--text-muted); }
.page-btn-active { cursor: default; }

.categories-all { text-align: center; margin-top: 1.5rem; }

.footer p + p { margin-top: 0.4rem; }
.footer-disclosure { max-width: 40rem; margin: 0 auto; }

@media (max-width: 640px) {
  .related-card { max-width: none; }
  .related-thumb { max-width: 260px; margin: 0 auto; }
  .filters-group-search { width: 100%; }
  .filters-group input[type="search"] { min-width: 0; width: 100%; }
  .products-filters { padding-right: 0.5rem; }
  .nav-list { gap: 0.5rem 0.75rem; }
}
