/*
 * SuperFit design system
 * Tokens, layout, components and narrowly scoped Electro/WooCommerce bridges.
 * Loaded after electro-style; keep page-specific composition outside this file.
 */

:root {
  --sf-navy: #00164a;
  --sf-green: #6eaf00;
  --sf-green-dark: #5d9500;
  --sf-gray: #e9ecef;
  --sf-carbon: #343a40;
  --sf-text: #24313d;
  --sf-muted: #667085;
  --sf-border: #dce2e7;
  --sf-surface: #ffffff;
  --sf-surface-alt: #f7f8f9;

  --sf-space-1: 8px;
  --sf-space-2: 16px;
  --sf-space-3: 24px;
  --sf-space-4: 32px;
  --sf-space-6: 48px;
  --sf-space-9: 72px;

  --sf-container: 1360px;
  --sf-section-width: 1040px;
  --sf-reading-width: 780px;
  --sf-radius: 8px;
  --sf-radius-lg: 12px;

  --bs-primary: var(--sf-green);
  --bs-ec-primary: var(--sf-green);
  --bs-ec-primary-d: var(--sf-green-dark);
}

html,
body,
button,
input,
select,
textarea {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  color: var(--sf-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  background: var(--sf-surface);
}

body :where(h1, h2, h3, h4, h5, h6) {
  color: var(--sf-navy);
  font-weight: 600;
  letter-spacing: -0.02em;
}

body :where(p, li) {
  color: var(--sf-text);
}

body :where(small, .text-muted, .woocommerce-result-count) {
  color: var(--sf-muted);
}

a {
  color: var(--sf-navy);
}

a:hover,
a:focus {
  color: var(--sf-green-dark);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--sf-green);
  outline-offset: 3px;
}

/* Shared widths: wide commerce, contained sections, readable editorial text. */
@media (min-width: 1200px) {
  #masthead .container,
  #content > .container,
  .sf-site-footer .sf-container {
    max-width: var(--sf-container);
  }

  .single-product .woocommerce-tabs,
  .page:not(.home) .entry-content > :where(table, form, .wp-block-group, .wp-block-columns) {
    max-width: var(--sf-section-width);
    margin-left: auto;
    margin-right: auto;
  }

  .single-post .entry-content,
  .blog .entry-content,
  .single-product .woocommerce-Tabs-panel,
  .single-product .woocommerce-Tabs-panel > :where(p, ul, ol, h2, h3, h4) {
    max-width: var(--sf-reading-width);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Header and navigation. */
#masthead.header-v5,
#masthead.header-v5 .stick-this,
#masthead.header-v5 .masthead,
#masthead.header-v5 .header-logo-area {
  color: var(--sf-navy);
  background: var(--sf-surface);
}

#masthead.header-v5 {
  border-bottom: 1px solid var(--sf-border);
  box-shadow: none;
}

#masthead.header-v5 .navbar-search .input-group,
#masthead.header-v5 .site-search .woocommerce-product-search {
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--sf-green);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
  box-shadow: none;
}

#masthead.header-v5 .navbar-search :where(.input-search-field, .input-group-addon, input.form-control.search-field, select.postform, .input-group-btn),
#masthead.header-v5 .site-search :where(input.search-field, .search-categories) {
  color: var(--sf-navy);
  background: var(--sf-surface);
}

#masthead.header-v5 .navbar-search input.form-control.search-field,
#masthead.header-v5 .site-search input.search-field {
  border: 0;
  box-shadow: none;
}

#masthead.header-v5 .navbar-search .input-group-addon,
#masthead.header-v5 .site-search .search-categories {
  border-left: 1px solid var(--sf-border);
}

#masthead.header-v5 .navbar-search :where(input, select)::placeholder,
#masthead.header-v5 .site-search input.search-field::placeholder {
  color: var(--sf-muted);
  opacity: 1;
}

@media (min-width: 768px) {
  #masthead.header-v5 .navbar-search .input-group-btn :where(button, .btn),
  #masthead.header-v5 .site-search :where(button, .search-submit) {
    min-width: 48px;
    color: #fff;
    border: 0;
    background: var(--sf-green);
  }

  #masthead.header-v5 .navbar-search .input-group-btn :where(button, .btn):hover,
  #masthead.header-v5 .site-search :where(button, .search-submit):hover {
    background: var(--sf-green-dark);
  }
}

#masthead.header-v5 .electro-navigation-v5 {
  color: var(--sf-navy);
  border-top: 1px solid var(--sf-border);
  border-bottom: 1px solid var(--sf-border);
  background: var(--sf-gray);
}

#masthead.header-v5 .electro-navigation-v5 :where(.departments-menu-v2, .departments-menu-v2 .dropdown) {
  background: transparent;
}

#masthead.header-v5 .electro-navigation-v5 .departments-menu-v2-title {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding-inline: var(--sf-space-3);
  color: #fff;
  font-weight: 600;
  background: var(--sf-carbon);
}

#masthead.header-v5 .electro-navigation-v5 :where(.secondary-nav-menu, .navbar-nav) > li > a {
  color: var(--sf-navy);
  font-weight: 500;
}

#masthead.header-v5 .electro-navigation-v5 :where(.secondary-nav-menu, .navbar-nav) > li:is(.current-menu-item, .current-menu-ancestor) > a {
  color: var(--sf-green-dark);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--sf-green);
}

#masthead.header-v5 .electro-navigation-v5 :where(.secondary-nav-menu, .navbar-nav) > li > a:hover,
#masthead.header-v5 .departments-menu-v2-title:hover {
  color: var(--sf-green-dark);
}

#masthead.header-v5 .departments-menu-v2 .dropdown-menu {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
  box-shadow: 0 12px 28px rgb(0 22 74 / 10%);
}

#masthead.header-v5 .departments-menu-v2 .dropdown-menu .menu-item > a {
  color: var(--sf-navy);
  border-bottom: 1px solid var(--sf-border);
}

#masthead.header-v5 .departments-menu-v2 .dropdown-menu .menu-item > a:hover {
  color: var(--sf-green-dark);
  background: var(--sf-surface-alt);
}

#masthead.header-v5 :where(.header-icon, .navbar-toggler, .site-header-cart .cart-contents) {
  color: var(--sf-navy);
}

#masthead.header-v5 :where(.badge, .cart-contents .count) {
  color: #fff;
  background: var(--sf-green);
}

/* Buttons and inputs: scoped to commerce and SuperFit components. */
body.woocommerce-page :where(a.button, button.button, input.button, .single_add_to_cart_button),
body .wc-block-components-button,
.sf-home .sf-btn {
  min-height: 42px;
  padding: 11px 18px;
  color: #fff;
  border: 1px solid var(--sf-green);
  border-radius: var(--sf-radius);
  background: var(--sf-green);
  box-shadow: none;
  font-weight: 600;
  line-height: 1.2;
}

body.woocommerce-page :where(a.button, button.button, input.button, .single_add_to_cart_button):hover,
body .wc-block-components-button:hover,
.sf-home .sf-btn:hover {
  color: #fff;
  border-color: var(--sf-green-dark);
  background: var(--sf-green-dark);
}

body.woocommerce-page :where(input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="number"], select, textarea),
body .wc-block-components-text-input input,
body .wc-block-components-combobox .wc-block-components-combobox-control input {
  min-height: 42px;
  color: var(--sf-text);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
  box-shadow: none;
}

body.woocommerce-page :where(input, select, textarea):focus,
body .wc-block-components-text-input input:focus {
  border-color: var(--sf-green);
  box-shadow: 0 0 0 3px rgb(110 175 0 / 16%);
}

body.woocommerce-page .wp-block-button__link.add_to_cart_button {
  min-height: 42px;
  padding: 11px 18px;
  color: #fff;
  border: 1px solid var(--sf-green);
  border-radius: var(--sf-radius);
  background: var(--sf-green);
  box-shadow: none;
  font-weight: 600;
  line-height: 1.2;
}

body.woocommerce-page .wp-block-button__link.add_to_cart_button:hover {
  color: #fff;
  border-color: var(--sf-green-dark);
  background: var(--sf-green-dark);
}

/* Archives, product grid and the SuperFit brand directory. */
body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) #content {
  margin-bottom: var(--sf-space-9);
}

body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) .page-title,
body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) .woocommerce-products-header__title {
  margin-bottom: var(--sf-space-2);
  color: var(--sf-navy);
  font-weight: 600;
}

.superfit-archive-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--sf-space-2);
  margin: 0 0 var(--sf-space-4);
  padding: var(--sf-space-2);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface-alt);
}

.superfit-archive-filter label {
  margin: 0;
  color: var(--sf-navy);
  font-weight: 600;
}

.superfit-archive-filter select {
  width: min(100%, 280px);
}

.superfit-filter-clear {
  color: var(--sf-navy);
  font-weight: 600;
  text-decoration: underline;
}

body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) ul.products > li.product .product-inner {
  overflow: hidden;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-lg);
  background: var(--sf-surface);
  box-shadow: none;
}

body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) ul.products > li.product :where(.woocommerce-loop-product__title, .product-title) {
  color: var(--sf-navy);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) ul.products > li.product .price {
  color: var(--sf-text);
  font-size: 17px;
  font-weight: 600;
}

.superfit-brand-directory {
  width: min(calc(100% - 40px), var(--sf-section-width));
  margin: 0 auto var(--sf-space-9);
  padding-block: var(--sf-space-6);
  color: var(--sf-text);
}

.superfit-brand-directory header {
  max-width: var(--sf-reading-width);
}

.superfit-brand-directory :where(h1, h2) {
  color: var(--sf-navy);
  font-weight: 600;
}

.superfit-eyebrow {
  color: var(--sf-green-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.superfit-brand-directory input {
  width: 100%;
  margin-top: var(--sf-space-3);
  padding: 12px var(--sf-space-2);
  color: var(--sf-text);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
}

.superfit-brand-group {
  padding-block: var(--sf-space-3);
  border-top: 1px solid var(--sf-border);
}

.superfit-brand-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sf-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.superfit-brand-group a {
  display: block;
  padding: 8px 12px;
  color: var(--sf-navy);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
  font-weight: 500;
}

.superfit-brand-group a:hover {
  color: #fff;
  border-color: var(--sf-green);
  background: var(--sf-green);
}

/* Product pages: keep the two existing columns and clarify their hierarchy. */
.single-product.normal.full-width .single-product-wrapper {
  margin-bottom: var(--sf-space-9);
}

.single-product.normal.full-width .product-images-wrapper {
  padding-right: var(--sf-space-4);
}

.single-product.normal.full-width .summary.entry-summary {
  padding-left: var(--sf-space-4);
}

.single-product .summary .product_title {
  margin-bottom: var(--sf-space-2);
  color: var(--sf-navy);
  font-size: clamp(28px, 2.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
}

.single-product .summary :where(.price, .stock) {
  color: var(--sf-text);
  font-weight: 600;
}

.single-product .woocommerce-product-gallery__image img {
  max-height: 460px;
  object-fit: contain;
}

.single-product .woocommerce-tabs {
  margin-top: var(--sf-space-6);
  border-top: 1px solid var(--sf-border);
}

.single-product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sf-space-3);
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--sf-border);
}

.single-product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.single-product .woocommerce-tabs ul.tabs li a {
  position: relative;
  display: block;
  padding: var(--sf-space-2) 0;
  color: var(--sf-muted);
  font-weight: 500;
}

.single-product .woocommerce-tabs ul.tabs li.active a {
  color: var(--sf-navy);
  font-weight: 600;
}

.single-product .woocommerce-tabs ul.tabs li.active a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--sf-green);
}

.single-product .woocommerce-Tabs-panel {
  padding-block: var(--sf-space-4);
}

.single-product .woocommerce-Tabs-panel :where(p, li) {
  color: var(--sf-text);
  font-size: 17px;
  line-height: 1.65;
}

.superfit-nutrition-table {
  width: 100%;
  margin: var(--sf-space-3) 0;
  border-collapse: collapse;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  overflow: hidden;
}

.superfit-nutrition-table :where(th, td) {
  padding: 12px var(--sf-space-2);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--sf-border);
}

.superfit-nutrition-table th {
  width: 42%;
  color: var(--sf-navy);
  background: var(--sf-surface-alt);
  font-weight: 600;
}

.superfit-nutrition-note {
  color: var(--sf-muted);
}

.superfit-faq {
  display: grid;
  gap: var(--sf-space-1);
}

.superfit-faq-item {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  background: var(--sf-surface);
}

.superfit-faq-item summary {
  padding: var(--sf-space-2);
  color: var(--sf-navy);
  cursor: pointer;
  font-weight: 600;
}

.superfit-faq-answer {
  padding: 0 var(--sf-space-2) var(--sf-space-2);
}

.superfit-faq-answer > :last-child {
  margin-bottom: 0;
}

/* WooCommerce blocks use the same quiet surfaces and green primary action. */
body.woocommerce-cart :where(.wp-block-woocommerce-cart, .wp-block-woocommerce-empty-cart-block),
body.woocommerce-checkout .wp-block-woocommerce-checkout {
  margin-bottom: var(--sf-space-9);
}

body :where(.wc-block-cart-items, .wc-block-components-totals-wrapper, .wc-block-checkout__order-summary) {
  border-color: var(--sf-border);
  border-radius: var(--sf-radius);
  box-shadow: none;
}

body :where(.wc-block-components-order-summary-item__quantity, .wc-block-components-notice-banner.is-info) {
  color: var(--sf-navy);
  border-color: var(--sf-border);
  background: var(--sf-surface-alt);
}

/* Footer rendered through Electro hooks, shared by every non-home page. */
#colophon.site-footer.footer-v2 {
  padding: 0;
  background: var(--sf-navy);
}

.sf-site-footer {
  margin-top: var(--sf-space-9);
  color: #d9e2ef;
  background: var(--sf-navy);
}

.sf-site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(140px, 1fr));
  gap: var(--sf-space-4);
  padding-block: var(--sf-space-6);
}

.sf-site-footer :where(p, a) {
  color: #d9e2ef;
}

.sf-site-footer__brand {
  display: inline-block;
  margin-bottom: var(--sf-space-2);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.sf-site-footer__intro p {
  max-width: 420px;
  margin: 0;
}

.sf-site-footer__nav {
  display: grid;
  align-content: start;
  gap: var(--sf-space-1);
}

.sf-site-footer__nav h2 {
  margin: 0 0 var(--sf-space-1);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sf-site-footer .sf-site-footer__nav h2,
.sf-footer :where(h1, h2, h3, h4) {
  color: #fff;
}

.sf-footer :where(p, a) {
  color: #d9e2ef;
}

.sf-site-footer__nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.sf-site-footer__bottom {
  padding-block: var(--sf-space-2);
  color: #b8c4d3;
  border-top: 1px solid rgb(255 255 255 / 16%);
  font-size: 14px;
}

/* Home retains its approved composition while sharing the system language. */
.sf-home {
  --ink: var(--sf-navy);
  color: var(--sf-text);
  font-family: inherit;
}

.sf-home :where(.sf-title, .sf-hero h1, .sf-editorial h2) {
  color: var(--sf-navy);
  font-weight: 600;
}

.sf-home .sf-btn {
  border-radius: var(--sf-radius);
}

.sf-home .sf-btn--light {
  color: var(--sf-navy);
  border-color: var(--sf-border);
  background: #fff;
}

/* Future editorial pages inherit an intentionally narrow reading column. */
body :where(.blog, .single-post) .entry-header {
  margin-bottom: var(--sf-space-4);
}

body :where(.blog, .single-post) .entry-title {
  color: var(--sf-navy);
  font-weight: 600;
}

@media (max-width: 1199px) {
  #masthead .container,
  #content > .container,
  .sf-site-footer .sf-container {
    width: min(calc(100% - 40px), var(--sf-container));
  }

  #masthead.header-v5 .header-logo-area,
  #masthead.header-v5 .electro-navigation-v5 {
    display: none;
  }

  #masthead.header-v5 :where(.handheld-header-wrap, .mobile-header-v2) {
    display: block;
    width: 100%;
    color: var(--sf-navy);
    background: var(--sf-surface);
  }

  #masthead.header-v5 :where(.handheld-header-v2, .mobile-header-v2-inner) {
    width: 100%;
    padding: 10px var(--sf-space-2);
  }

  #masthead.header-v5 .mobile-header-v2 .header-logo img {
    max-width: 150px;
    height: auto;
  }

  #masthead.header-v5 .mobile-header-v2 :where(.navbar-toggler, .handheld-header-links a, .site-header-cart .cart-contents) {
    color: var(--sf-navy);
  }

  #masthead.header-v5 .mobile-header-v2 .site-search :where(button, .search-submit) {
    color: var(--sf-green);
  }

  #masthead.header-v5 .mobile-header-v2 .mobile-handheld-department {
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid var(--sf-border);
    background: var(--sf-gray);
  }

  #masthead.header-v5 .mobile-header-v2 .mobile-handheld-department > .nav {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
  }

  #masthead.header-v5 .mobile-header-v2 .mobile-handheld-department li {
    flex: 0 0 auto;
    max-width: none;
    width: auto;
  }

  #masthead.header-v5 .mobile-header-v2 .mobile-handheld-department a {
    display: block;
    width: max-content;
    padding: 10px 12px;
    color: var(--sf-navy);
    font-weight: 500;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 16px;
  }

  #content > .container,
  .sf-site-footer .sf-container,
  .superfit-brand-directory {
    width: calc(100% - 32px);
  }

  body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) :where(#primary, #sidebar) {
    float: none;
    width: 100%;
    margin-inline: 0;
  }

  body:is(.tax-product_cat, .tax-product_brand, .post-type-archive-product) #sidebar {
    margin-top: var(--sf-space-4);
  }

  .superfit-archive-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .superfit-archive-filter select {
    width: 100%;
  }

  .single-product.normal.full-width :where(.product-images-wrapper, .summary.entry-summary) {
    float: none;
    width: 100%;
    padding-inline: 0;
  }

  .single-product .woocommerce-product-gallery__image img {
    max-height: 340px;
  }

  .single-product .woocommerce-tabs ul.tabs {
    gap: var(--sf-space-2);
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .single-product .woocommerce-tabs ul.tabs li {
    flex: 0 0 auto;
  }

  .single-product .woocommerce-Tabs-panel :where(p, li) {
    font-size: 16px;
  }

  .superfit-nutrition-table th {
    width: 45%;
  }

  .sf-site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--sf-space-3);
    padding-block: var(--sf-space-4);
  }
}
