/* ============================================================
   Envirotone Shop CSS — matches envirotone.com.au design
   Fonts: Space Grotesk (headings) + IBM Plex Sans (body) + IBM Plex Mono (accents)
   ============================================================ */

:root {
  --ink:      #1F4B4E;
  --ink-deep: #123236;
  --paper:    #FFFFFF;
  --paper-2:  #F2F5F4;
  --gold:     #C98A2C;
  --slate:    #5B6B72;
  --line:     #E3E7E6;
  --white:    #FFFFFF;
  --red:      #C0392B;
  --green:    #2e7d32;
  --shadow-sm: 0 1px 4px rgba(18,50,54,0.07);
  --shadow-md: 0 4px 14px rgba(18,50,54,0.10);
  --shadow-lg: 0 8px 28px rgba(18,50,54,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }

/* Keyboard focus visibility — applies to every interactive element by
   default so tabbing through the site always shows where you are, even
   on custom controls (buttons, tabs, filter pills, etc.) that don't get
   a focus ring for free. Scoped to :focus-visible so it only shows for
   keyboard/assistive-tech navigation, not mouse clicks, and sits above
   any individual component's own :focus-within styling rather than
   fighting it. Components that already remove outline (e.g. inputs
   inside a bordered search box) still pick this up since outline is
   drawn outside the box model, not clipped by the component's own
   border or background. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-deep);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink-deep);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.mono { font-family: 'IBM Plex Mono', monospace; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ── Promo strip ── */
.promo {
  background: var(--ink-deep);
  color: var(--paper);
  text-align: center;
  font-size: 13px;
  padding: 9px 12px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,245,240,0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(20,33,43,0.04);
}

.header-top { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; column-gap: 24px; height: 96px; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; z-index: 2; }
.logo img { height: 78px; width: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.06)); }

.header-search { position: relative; width: 100%; max-width: 640px; margin: 0 auto; z-index: 1; }
.header-search-box { display: flex; align-items: center; background: var(--paper); border: 2px solid var(--ink-deep); border-radius: 9px; padding: 0 6px 0 18px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.header-search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,138,44,0.14); }
.header-search-box input { flex: 1; border: none; outline: none; background: transparent; padding: 14px 10px; font-size: 15px; font-family: 'IBM Plex Sans'; color: var(--ink-deep); min-width: 0; }
.header-search-box input::placeholder { color: var(--slate); }
.header-search-box button { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: none; background: var(--ink-deep); color: var(--paper); border-radius: 6px; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.header-search-box button:hover { background: var(--gold); }

.search-dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; display: none; max-height: 420px; overflow-y: auto; }
.search-dropdown.open { display: block; }
.sd-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.sd-item:last-child { border-bottom: none; }
.sd-item:hover { background: var(--paper-2); }
.sd-item img { width: 40px; height: 40px; object-fit: contain; background: var(--paper-2); border-radius: 4px; padding: 4px; flex-shrink: 0; }
.sd-item-body { flex: 1; min-width: 0; }
.sd-item-name { font-size: 13px; font-weight: 600; color: var(--ink-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-item-sku { font-size: 11px; font-family: 'IBM Plex Mono'; color: var(--gold); }
.sd-item-price { font-size: 13px; font-weight: 700; font-family: 'Space Grotesk'; flex-shrink: 0; }
.sd-footer { padding: 10px 14px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-deep); background: var(--paper-2); cursor: pointer; }
.sd-empty { padding: 20px 14px; text-align: center; font-size: 13px; color: var(--slate); }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; z-index: 2; }
#account-mount { order: 1; }
.cart-btn { order: 2; }
.header-actions .btn-ghost { order: 3; }
.menu-toggle { order: 4; }

.header-navrow { border-top: 1px solid var(--line); background: var(--paper); }
.navrow-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 48px; }
.navlinks { display: flex; align-items: center; gap: 26px; }
.navlinks a { font-size: 13.5px; font-weight: 500; opacity: 0.75; white-space: nowrap; transition: opacity .15s; }
.navlinks a:hover, .navlinks a.active { opacity: 1; }
.mobile-portal-link { display: none; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--ink-deep); margin: 5px 0; }

@media (max-width: 900px) {
  header { background: #FFFFFF; }
  .header-navrow { border-top: none; }
  .navlinks { display: none; position: fixed; top: 126px; left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: flex-start; padding: 22px 28px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); gap: 18px; height: auto; z-index: 55; }
  .navlinks.open { display: flex; }
  .navlinks .mobile-portal-link { display: block; color: var(--gold); font-weight: 600; }
  .menu-toggle { display: block; }
  .header-actions .btn-ghost { display: none; }
  .header-top { display: flex; flex-wrap: wrap; height: auto; padding: 14px 16px; gap: 12px; }
  .header-search { position: static; width: 100%; max-width: none; order: 3; flex-basis: 100%; }
  /* Search is the primary way to navigate on mobile — make it much bigger and easier to tap */
  .header-search-box { padding: 0 8px 0 22px; border-radius: 12px; }
  .header-search-box input { padding: 24px 12px; font-size: 18px; }
  .header-search-box button { width: 60px; height: 60px; border-radius: 9px; }
  .header-search-box button svg { width: 23px; height: 23px; }
  .logo img { height: 54px; }
  .header-top { padding: 12px 16px 10px; }
}

/* ── Buttons ── */
.btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
  line-height: 1;
}

.btn-primary {
  background: var(--ink-deep);
  color: var(--paper);
  box-shadow: 0 2px 8px rgba(29,50,50,0.22);
}
.btn-primary:hover {
  background: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(29,50,50,0.28);
}

.btn-ghost {
  background: var(--paper);
  border-color: var(--ink-deep);
  color: var(--ink-deep);
}
.btn-ghost:hover {
  background: var(--ink-deep);
  color: var(--paper);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: #b87a20; transform: translateY(-1px); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cart button ── */
.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px 0 12px;
  height: 40px;
  border-radius: 6px;
  color: var(--ink-deep);
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color .15s, background .15s;
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Sans';
}
.cart-btn:hover { border-color: var(--ink-deep); background: var(--paper-2); }
.cart-label { white-space: nowrap; }

.cart-count {
  position: relative;
  top: auto;
  right: auto;
  min-width: 18px;
  height: 18px;
  background: var(--gold);
  color: white;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: 'IBM Plex Mono', monospace;
}
.cart-count.visible { display: flex; }
@media (max-width: 900px) {
  .cart-label { display: none; }
  .cart-count { position: absolute; top: -6px; right: -6px; }
}

.account-btn { display: flex; align-items: center; gap: 7px; padding: 0 12px; height: 40px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-deep); transition: border-color .15s, background .15s; font-size: 13px; font-weight: 600; font-family: 'IBM Plex Sans'; }
.account-btn:hover { border-color: var(--ink-deep); background: var(--paper-2); }
.account-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .account-name { display: none; } .account-btn { padding: 0; width: 40px; justify-content: center; } }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
  padding: 10px 0;
  font-family: 'IBM Plex Mono', monospace;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--ink-deep); }
.breadcrumb .sep { color: var(--line); }
.breadcrumb .current { color: var(--ink-deep); font-weight: 500; }

/* ── Hero ── */
.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}

.hero-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 { font-size: clamp(30px, 4.2vw, 48px); margin-bottom: 16px; }
.hero p { font-size: 17px; color: var(--slate); max-width: 580px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Stat bar ── */
.stat-bar {
  background: var(--ink-deep);
  padding: 28px 0;
}

.stat-row {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--paper);
}
.stat-num span { color: var(--gold); }
.stat-label { font-size: 12px; color: #9FC2BB; letter-spacing: 0.04em; }

/* ── Section layout ── */
.section { padding: 64px 0; }
.section-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.section h2 { margin-bottom: 12px; }
.section-sub { color: var(--slate); font-size: 16px; margin-bottom: 36px; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}
.see-all { font-size: 13.5px; font-weight: 600; color: var(--ink-deep); font-family: 'IBM Plex Mono', monospace; }
.see-all:hover { color: var(--gold); }

/* ── Category grid ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.cat-card {
  background: var(--paper);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); position: relative; z-index: 1; }

.cat-icon { font-size: 26px; flex-shrink: 0; }
.cat-body h3 { font-size: 15px; margin-bottom: 3px; }
.cat-body p { font-size: 12.5px; color: var(--slate); }

/* ── Refresh promo band ── */
.refresh-band {
  background: var(--ink-deep);
  padding: 56px 0;
}

.refresh-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.refresh-band .section-kicker { color: var(--gold); }
.refresh-band h2 { color: var(--paper); margin-bottom: 14px; }
.refresh-band p { color: rgba(247,245,240,0.7); margin-bottom: 28px; font-size: 16px; line-height: 1.7; }

.refresh-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(247,245,240,0.85);
  font-size: 13.5px;
  font-weight: 500;
}
.badge-tick { color: var(--gold); font-weight: 700; }

/* ── Product cards ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  background: var(--paper-2);
  padding: 16px;
}

.product-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 5px; }

.product-sku {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}

.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-deep);
  line-height: 1.3;
  flex: 1;
}
.product-name:hover { color: var(--gold); }

.product-yield { font-size: 12px; color: var(--slate); }

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-top: 4px;
}
.product-price-ex { font-size: 11.5px; color: var(--slate); font-family: 'IBM Plex Mono', monospace; }

.product-footer { padding: 0 16px 16px; }

.btn-add-cart {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--ink-deep);
  color: var(--paper);
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background .15s, transform .15s;
}
.btn-add-cart:hover { background: var(--gold); transform: translateY(-1px); }
.btn-add-cart:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-add-cart.added { background: var(--green); }

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}
.tag-refresh  { background: #f5e9cc; color: #8a5c10; }
.tag-instock  { background: #e8f5e9; color: #2e7d32; }
.tag-outofstock { background: #fce4ec; color: #c62828; }

/* ── Skeleton loaders ── */
.product-skeleton {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 300px;
  overflow: hidden;
  position: relative;
}
.product-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ── Shop page ── */
.shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 32px 0 80px;
}

.shop-sidebar { position: sticky; top: 84px; align-self: start; }

.filter-block { margin-bottom: 24px; }

.filter-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.filter-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background .1s;
  color: var(--ink-deep);
  user-select: none;
}
.filter-opt:hover { background: var(--paper-2); }
.filter-opt.active { background: var(--paper-2); font-weight: 600; color: var(--ink-deep); }
.filter-opt input { accent-color: var(--ink-deep); cursor: pointer; }

.filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--slate);
  font-family: 'IBM Plex Mono', monospace;
}

/* Shop bar */
.shop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 13px;
  width: 300px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--ink-deep); }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  background: transparent;
  color: var(--ink-deep);
}
.search-box input::placeholder { color: var(--slate); }
.search-box svg { color: var(--slate); flex-shrink: 0; }
/* These two components remove the default outline in favour of their own
   :focus-within border treatment, which loses the keyboard-only distinction
   the global :focus-visible rule above relies on — restated at matching
   specificity here so tabbing in still shows a real ring, not just relying
   on a subtle border-colour change. */
.search-box input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.results-count { font-size: 13.5px; color: var(--slate); white-space: nowrap; }
.results-count strong { color: var(--ink-deep); }

.sort-select {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink-deep);
  background: var(--paper);
  cursor: pointer;
  outline: none;
}
.sort-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.page-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: all .12s;
  color: var(--ink-deep);
}
.page-btn:hover { border-color: var(--ink-deep); }
.page-btn.active { background: var(--ink-deep); color: var(--paper); border-color: var(--ink-deep); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Footer ── */
.site-footer {
  background: var(--ink-deep);
  padding: 56px 0 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-brand p {
  color: rgba(247,245,240,0.5);
  font-size: 13.5px;
  line-height: 1.8;
  margin-top: 12px;
}

.footer-col h4 {
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: rgba(247,245,240,0.5);
  font-size: 13.5px;
  margin-bottom: 10px;
  transition: color .12s;
}
.footer-col a:hover { color: var(--paper); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
}
.footer-bottom p { color: rgba(247,245,240,0.35); font-size: 12px; font-family: 'IBM Plex Mono', monospace; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .refresh-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  .section { padding: 48px 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar { position: static; }
  .cat-grid { grid-template-columns: 1fr; }
  .refresh-badges { grid-template-columns: 1fr; }
  .stat-row { gap: 28px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .search-box { width: 100%; }
}
