/* ==========================================================================
   Cortex — components
   Primitives defined once and reused. WooCommerce classes are mapped onto
   these rather than each Woo element being styled where it happens to appear.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */

.cx-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cx-s2);
  font-family: var(--cx-mono);
  font-size: var(--cx-t-xs);
  font-weight: 500;
  letter-spacing: var(--cx-track-label);
  text-transform: uppercase;
  line-height: 1;
  padding: 0.875rem 1.75rem;
  min-height: 2.75rem;          /* comfortable touch target */
  border: 1px solid var(--cx-gold);
  border-radius: var(--cx-radius);
  background: var(--cx-gold);
  color: var(--cx-bg);
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cx-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #respond input#submit:hover {
  background: var(--cx-gold-bright);
  border-color: var(--cx-gold-bright);
  color: var(--cx-bg);
  text-decoration: none;
}

.cx-btn--ghost {
  background: transparent;
  color: var(--cx-gold);
}
.cx-btn--ghost:hover { background: var(--cx-gold-wash); color: var(--cx-gold-bright); }

.cx-btn[disabled],
.cx-btn[aria-disabled="true"],
.woocommerce button.button:disabled,
.woocommerce button.button.alt:disabled {
  background: transparent;
  color: var(--cx-text-dim);
  border-color: var(--cx-line);
  cursor: not-allowed;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Card
   One object: same edges, padding and baselines wherever it appears.
   -------------------------------------------------------------------------- */

.cx-card {
  display: flex;
  flex-direction: column;
  background: var(--cx-bg);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease;
}
.cx-card:hover { border-color: var(--cx-line-2, var(--cx-rule-2, #39423d)); background: var(--cx-panel); }

.cx-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--cx-bg-alt);
  overflow: hidden;
}
.cx-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cx-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--cx-s1);
  padding: var(--cx-s4);
  flex: 1;
}
.cx-card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--cx-s3);
  margin-top: auto;
  padding-top: var(--cx-s3);
}

/* --------------------------------------------------------------------------
   Grid
   Explicit column counts at named widths rather than auto-fit, so each
   breakpoint is a decision instead of a side effect.
   -------------------------------------------------------------------------- */

.cx-grid {
  display: grid;
  gap: 1px;
  background: var(--cx-line);
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  overflow: hidden;
  list-style: none;
  margin: 0 0 var(--cx-s7);
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* 390–767 */
}
@media (min-width: 768px)  { .cx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .cx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Cards in a grid lose their own border; the grid supplies the rules. */
.cx-grid > .cx-card,
.cx-grid > li.product {
  border: 0;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */

.cx-head {
  border-bottom: 1px solid var(--cx-line);
  background: var(--cx-bg);
  position: relative;
  z-index: 20;
}
.cx-head-in {
  max-width: var(--cx-wrap);
  margin-inline: auto;
  padding: 0 var(--cx-s5);
  display: flex;
  align-items: center;
  gap: var(--cx-s5);
  min-height: 4.25rem;
}

.cx-brand {
  display: inline-flex;
  align-items: center;
  /* The mark is a dense piece of artwork and the wordmark is tracked out at
   * 0.17em, so the two crowd each other at a tighter gap. */
  gap: var(--cx-s4);
  color: var(--cx-gold);
  text-decoration: none;
  flex: none;
}
.cx-brand:hover { text-decoration: none; }
.cx-mark {
  width: 32px;
  height: auto;
  flex: none;
  display: block;
  border-radius: 2px;
}
.cx-brand-name {
  font-family: var(--cx-sans);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--cx-text);
  white-space: nowrap;
}

.cx-nav { margin-left: auto; }
.cx-nav-list {
  display: flex;
  align-items: center;
  gap: var(--cx-s5);
  list-style: none;      /* no bullets, ever */
  margin: 0;
  padding: 0;
}
.cx-nav-list li { margin: 0; padding: 0; list-style: none; }
.cx-nav-list li::before { content: none; }
.cx-nav-list a {
  display: block;
  font-family: var(--cx-mono);
  font-size: var(--cx-t-xs);
  letter-spacing: var(--cx-track-label);
  text-transform: uppercase;
  color: var(--cx-text-mut);
  text-decoration: none;
  padding: var(--cx-s2) 0;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.cx-nav-list a:hover { color: var(--cx-text); border-bottom-color: var(--cx-gold); text-decoration: none; }
.cx-nav-list .is-current > a,
.cx-nav-list .current-menu-item > a {
  color: var(--cx-text);
  border-bottom-color: var(--cx-gold);
}

.cx-cart {
  display: inline-flex;
  align-items: center;
  gap: var(--cx-s2);
  flex: none;
  font-family: var(--cx-mono);
  font-size: var(--cx-t-xs);
  letter-spacing: var(--cx-track-label);
  text-transform: uppercase;
  color: var(--cx-text-mut);
  text-decoration: none;
  padding: var(--cx-s2) 0;
}
.cx-cart:hover { color: var(--cx-text); text-decoration: none; }
.cx-cart-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border: 1px solid var(--cx-line);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  color: var(--cx-text-dim);
}
.cx-cart-n.has-items { background: var(--cx-gold); border-color: var(--cx-gold); color: var(--cx-bg); }

/* --- burger --------------------------------------------------------------- */

.cx-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  background: none;
  border: 1px solid var(--cx-line);
  border-radius: var(--cx-radius);
  cursor: pointer;
  padding: 0 0.75rem;
  flex: none;
}
.cx-burger span { display: block; height: 1px; background: var(--cx-text); transition: transform 140ms ease, opacity 140ms ease; }
.cx-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.cx-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cx-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.cx-brand:focus-visible,
.cx-cart:focus-visible,
.cx-burger:focus-visible,
.cx-nav-list a:focus-visible { outline: 2px solid var(--cx-gold); outline-offset: 3px; }

@media (max-width: 900px) {
  .cx-burger { display: flex; }
  .cx-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: var(--cx-bg);
    border-bottom: 1px solid var(--cx-line);
    margin: 0;
    display: none;
  }
  .cx-nav.is-open { display: block; }
  .cx-nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: var(--cx-s2) var(--cx-s5) var(--cx-s4); }
  .cx-nav-list a {
    padding: var(--cx-s4) 0;
    border-bottom: 1px solid var(--cx-line-soft);
    min-height: 2.75rem;
  }
  .cx-nav-list a:hover { border-bottom-color: var(--cx-line-soft); }
  .cx-cart { order: 3; }
}
@media (max-width: 430px) {
  .cx-head-in { padding-inline: var(--cx-s4); gap: var(--cx-s3); }
  .cx-brand { gap: var(--cx-s3); }
  .cx-brand-name { font-size: 0.75rem; letter-spacing: 0.14em; }
  .cx-cart-label { display: none; }
}

/* Storefront leftovers that must never reappear. */
.site-header-cart,
.storefront-handheld-footer-bar,
.site-search,
.secondary-navigation { display: none !important; }

/* --- footer policy links --------------------------------------------------- */
.cx-footer-nav { padding: var(--cx-s5) 0 var(--cx-s3); }
.cx-footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cx-s2) var(--cx-s5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cx-footer-menu a {
  font-family: var(--cx-mono);
  font-size: var(--cx-t-xs);
  letter-spacing: var(--cx-track-label);
  text-transform: uppercase;
  color: var(--cx-text-mut);
  text-decoration: none;
}
.cx-footer-menu a:hover,
.cx-footer-menu a:focus-visible { color: var(--cx-gold-bright); }
