/* feetcounter.com — MiniScience Counters Catalogue
   Institutional palette + shared site chrome (header/nav, footer, catalog grid) */

:root {
  --header-bg: #082A63;      /* Deep Blue */
  --blue: #0B3D91;           /* Royal Blue oscuro — primary buttons */
  --blue-hover: #1557C0;     /* Bright Royal Blue — hover */
  --red: #B5121B;            /* Deep Red — Request Quote / Buy */
  --red-dark: #7F0D14;       /* Burgundy Red — secondary/hover on red */
  --gold: #D99A16;           /* Corporate Gold — prices, accents */
  --gold-light: #F2B632;     /* Warm Gold — light accent */
  --charcoal: #252B33;       /* Titles */
  --text: #3F4852;           /* Body text */
  --text-dim: #5D6773;       /* Slate Gray — secondary text */
  --border: #D8DEE6;         /* Light Steel — borders */
  --bg-alt: #F4F6F8;         /* Cool Background */
  --white: #FFFFFF;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(8, 42, 99, 0.08), 0 1px 2px rgba(8, 42, 99, 0.06);
  --shadow-hover: 0 8px 20px rgba(8, 42, 99, 0.14);
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--white);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--blue); }
a:hover { color: var(--blue-hover); }

h1, h2, h3 { color: var(--charcoal); margin: 0 0 0.5rem; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--blue);
}
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.site-logo { display: inline-flex; align-items: center; line-height: 0; }
.site-logo img { height: 72px; width: auto; display: block; }
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  width: 100%;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.site-nav a:hover, .site-nav a.active { color: var(--blue); }
.site-nav a.active { border-bottom: 2px solid var(--blue); padding-bottom: 2px; }
/* The site's namesake product gets its own accented shortcut, distinct
   from the plain category links. */
.site-nav a.nav-feet {
  color: var(--blue);
  background: #eaf1fb;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #c9dcf5;
}
.site-nav a.nav-feet:hover { background: #dbe9fa; color: var(--blue-hover); }
.site-nav a.nav-cta {
  background: var(--red);
  color: var(--white);
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
}
.site-nav a.nav-cta:hover { background: var(--red-dark); color: var(--white); }

/* ---------- Hero / intro ---------- */
.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 2.25rem 1.25rem 1.75rem;
  text-align: center;
}
.hero h1, .hero h2 { font-size: 1.9rem; margin-bottom: 0.4rem; }
.hero p { max-width: 680px; margin: 0 auto; color: var(--text-dim); font-size: 1rem; }

/* Compact variant: used for the "Browse the Full Catalogue" section once
   the featured-product hero above it has already made the big pitch — this
   one just needs to read as a section label, not a second hero banner. */
.hero.hero-compact {
  padding: 0.85rem 1.25rem 0.6rem;
  border-bottom: none;
  background: transparent;
}
.hero.hero-compact h2 { font-size: 1.1rem; margin-bottom: 0.15rem; }
.hero.hero-compact p { font-size: 0.82rem; max-width: 620px; }

/* ---------- Featured-product hero (the Feet Counter, MSJY316W) ----------
   Opt-in via "featured": true in product.json — index.php builds this from
   whichever product carries the flag, so it isn't hardcoded to one SKU. */
.hero-featured-wrap { position: relative; }
.hero-featured {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  transition: opacity 0.2s ease;
}
/* Minimized: the full pitch is hidden (not just faded) so it can't be
   tabbed/clicked into by accident, and the slim reminder bar takes over —
   see .hero-mini-bar below. Nothing about the Feet Counter is ever fully
   gone: the mini bar stays on screen and one click restores the hero. */
.hero-featured-wrap.is-collapsed .hero-featured { display: none; }

.hero-collapse-btn {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}
.hero-collapse-btn:hover { color: var(--blue); background: var(--bg-alt); }

/* Slim reminder bar — what's left of the hero once minimized. The whole
   bar is a button: click anywhere on it to bring the full hero back. */
.hero-mini-bar {
  display: none;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(90deg, #eaf1fb, #dbe9fa, #eaf1fb);
  border: none;
  border-bottom: 1px solid #c9dcf5;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.hero-featured-wrap.is-collapsed .hero-mini-bar { display: flex; }
.hero-mini-thumb {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid #c9dcf5;
  padding: 3px;
  flex-shrink: 0;
}
.hero-mini-label { flex: 1 1 auto; color: var(--blue); font-weight: 700; font-size: 0.88rem; }
.hero-mini-expand { color: var(--blue); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.hero-mini-bar:hover { background: linear-gradient(90deg, #dbe9fa, #cfe0f8, #dbe9fa); }

/* One-shot pulse when the hero first minimizes mid-search/filter, so the
   visitor notices where it went instead of it just disappearing. */
.hero-mini-bar.is-pulsing { animation: hero-mini-pulse 0.8s ease-in-out 2; }
@keyframes hero-mini-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0); }
  50% { box-shadow: inset 0 0 0 2px var(--blue-hover); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mini-bar.is-pulsing { animation: none; }
}
@media (max-width: 480px) {
  .hero-mini-label { font-size: 0.8rem; }
  .hero-mini-expand { display: none; }
}
.hero-featured-media {
  flex: 0 0 320px;
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-featured-media img { width: 100%; height: 100%; object-fit: contain; padding: 1.25rem; }
.hero-featured-body { flex: 1 1 380px; min-width: 0; }
.hero-featured-eyebrow {
  margin: 0 0 0.4rem;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hero-featured-body h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.hero-featured-teaser { color: var(--text-dim); font-size: 1.02rem; margin: 0 0 0.85rem; }
.hero-featured-benefits { margin: 0 0 1.25rem; padding-left: 1.2rem; }
.hero-featured-benefits li { font-size: 0.92rem; margin-bottom: 0.3rem; }
.hero-featured-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero-cta {
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
}
.hero-cta:hover { background: var(--red-dark); color: var(--white); }
.hero-cta-secondary {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
}
.hero-cta-secondary:hover { background: #eaf1fb; color: var(--blue-hover); }
.hero-cta-tertiary { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.hero-cta-tertiary:hover { color: var(--blue); }

@media (max-width: 780px) {
  .hero-featured { flex-direction: column; text-align: center; padding: 1.5rem 1.25rem; gap: 1.25rem; }
  .hero-featured-media { flex-basis: auto; width: 100%; max-width: 280px; }
  .hero-featured-benefits { text-align: left; display: inline-block; }
  .hero-featured-cta { justify-content: center; }
  .hero-featured-body h1 { font-size: 1.5rem; }
}

/* ---------- Toolbar: search + filters ---------- */
.catalog-toolbar {
  max-width: 1200px;
  margin: 1.5rem auto 0.5rem;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.catalog-search {
  flex: 1 1 260px;
  min-width: 200px;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  animation: search-glow 2.6s ease-in-out infinite;
}
.catalog-search:focus {
  outline: 2px solid var(--blue-hover);
  outline-offset: 1px;
  animation: none;
  box-shadow: none;
}

/* Gentle pulsing glow so the search box is easy to spot at a glance —
   subtle on purpose, pauses as soon as the field is focused. */
@keyframes search-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0.16); }
  50% { box-shadow: 0 0 0 5px rgba(11, 61, 145, 0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-search { animation: none; }
}
.catalog-count { color: var(--text-dim); font-size: 0.9rem; white-space: nowrap; }

.catalog-filters {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.filter-pill {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-pill:hover { border-color: var(--blue); color: var(--blue); }
.filter-pill.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ---------- Card grid ---------- */
.catalog-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  opacity: 1;
  transition: opacity 0.13s ease;
}
/* Brief cross-fade when switching category — just enough to read as a
   page/section change, not a showy animation. */
.catalog-grid.is-switching { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .catalog-grid { transition: none; }
}
@media (max-width: 980px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; } }
@media (max-width: 480px) { .catalog-grid { grid-template-columns: 1fr; } }

/* Mobile: shrink the hero, stack the toolbar, and let the category pills
   scroll horizontally in one row instead of wrapping into a tall block. */
@media (max-width: 640px) {
  .site-header-inner { padding: 1rem 1rem 0.85rem; }
  .site-logo img { height: 52px; }
  .site-nav { gap: 0.75rem 1.1rem; font-size: 0.9rem; }
  .site-nav a.nav-cta { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
  .site-nav a.nav-feet { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

  .hero { padding: 1.5rem 1rem 1.25rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 0.88rem; }

  .catalog-toolbar { flex-direction: column; align-items: stretch; margin-top: 1.1rem; }
  /* Reset flex-basis/grow: in a column toolbar they'd apply to height, not
     width, and stretch the input to fill the container vertically. */
  .catalog-search { flex: 0 0 auto; width: 100%; padding: 0.5rem 0.75rem; font-size: 0.9rem; min-width: 0; }
  .catalog-count { flex: 0 0 auto; }
  .catalog-count { text-align: left; }

  .catalog-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
  }
  .filter-pill { flex: 0 0 auto; white-space: nowrap; }
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.product-card.featured { border-color: var(--blue-hover); box-shadow: 0 0 0 3px #eaf1fb, var(--shadow); }
.product-card.featured:hover { box-shadow: 0 0 0 3px #eaf1fb, var(--shadow-hover); }
.card-featured-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue);
  margin-top: 0.1rem;
}
.product-card .card-img {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card .card-img img { width: 100%; height: 100%; object-fit: contain; padding: 0.75rem; }
.product-card .card-body { padding: 0.85rem 0.95rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card-category {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: #e8eefb;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}
.card-title { font-size: 0.98rem; font-weight: 700; color: var(--charcoal); margin: 0.15rem 0 0; }
.card-sku { font-size: 0.78rem; color: var(--text-dim); font-family: "SFMono-Regular", Consolas, monospace; }
.card-teaser { font-size: 0.85rem; color: var(--text-dim); margin: 0.15rem 0 0.4rem; flex: 1; }
.card-cta {
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
}
.product-card.contact-only .card-cta { color: var(--red); }

.catalog-empty {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  color: var(--text-dim);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg);
  color: #c9d6ef;
  margin-top: 2rem;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) { .site-footer-inner { grid-template-columns: 1fr; } }
.site-footer h3 { color: var(--white); font-size: 0.95rem; margin-bottom: 0.6rem; }
.site-footer p, .site-footer li { font-size: 0.85rem; color: #c9d6ef; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.site-footer a { color: #c9d6ef; text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  padding: 0.9rem 1.25rem;
  font-size: 0.78rem;
  color: #9fb3d6;
}

/* ---------- Contact page ---------- */
.contact-wrap {
  max-width: 640px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}
.contact-notice {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}
.contact-notice p { margin: 0.4rem 0 0; }
.contact-notice-ok { background: #eaf6ee; border: 1px solid #b9e2c4; color: #1c5c33; }
.contact-notice-ok a { color: #1c5c33; text-decoration: underline; }
.contact-notice-error { background: #fdeceb; border: 1px solid #f3b8b3; color: var(--red-dark); }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row-pair { display: flex; gap: 1rem; }
.form-row-pair .form-row { flex: 1 1 0; }
.contact-form label { font-size: 0.85rem; font-weight: 700; color: var(--charcoal); }
.contact-form input,
.contact-form textarea {
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--blue-hover); outline-offset: 1px; }
.contact-form textarea { resize: vertical; min-height: 120px; }
.form-error { color: var(--red); font-size: 0.82rem; }

/* Honeypot: present in the DOM for bots to fill, invisible and unreachable
   for real visitors (off-screen, not display:none, so basic bot heuristics
   that skip hidden fields still tend to fill it in). */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.form-submit:hover { background: var(--red-dark); }

.contact-alt {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.contact-alt h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.contact-alt p { margin: 0.25rem 0; font-size: 0.92rem; }

@media (max-width: 480px) {
  .form-row-pair { flex-direction: column; gap: 1.1rem; }
}
