/*
 * Independent gaming retailer: targeted presentation for the existing
 * Flatsome / WooCommerce storefront.  Load after the current card, PDP,
 * drawer and quick-view styles.  No text, URLs, prices or commerce state
 * are created by this stylesheet.
 */

/* Archive grid: the captured markup is .smi-shop-archive-products > .products. */
body.woocommerce .smi-shop-archive-products > .products.row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 24px 20px;
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
}
/* Flatsome's clearfix pseudo-elements would otherwise become empty grid cells. */
body.woocommerce .smi-shop-archive-products > .products.row::before,
body.woocommerce .smi-shop-archive-products > .products.row::after {
  display: none;
  content: none;
}
body.woocommerce .smi-shop-archive-products > .products.row > .wgm-native-card.col {
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
}
body.woocommerce .smi-shop-archive-products > .products.row > .wgm-native-card > .col-inner {
  display: flex;
  height: 100%;
}
body.woocommerce .smi-shop-archive-products > .products.row > .wgm-native-card > .col-inner > .wgm-native-card__box {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
}

/* Provider-owned card markup also occurs in related-product sliders. */
body .wgm-native-card .wgm-native-card__box {
  position: relative;
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  box-shadow: none;
  overflow: hidden;
}
body .wgm-native-card .wgm-native-card__media {
  /* The target's legacy .box-image rule forces width:auto !important. */
  width: 100% !important;
  min-width: 0;
  flex-shrink: 0;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  background: #f6f7f8;
}
body .wgm-native-card .wgm-native-card__image {
  object-fit: contain;
}
body .wgm-native-card .wgm-native-card__info {
  flex: 1 0 auto;
  padding: 14px 14px 16px;
  color: #17202a;
}
body .wgm-native-card .wgm-native-card__info .name,
body .wgm-native-card .wgm-native-card__info .name a {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  text-decoration: none;
  white-space: normal;
}
body .wgm-native-card .wgm-native-card__info .name a:hover,
body .wgm-native-card .wgm-native-card__info .name a:focus-visible {
  color: #17202a;
  text-decoration: underline;
}
body .wgm-native-card .wgm-native-card__info .price,
body .wgm-native-card .wgm-native-card__info .price ins,
body .wgm-native-card .wgm-native-card__info .price ins .amount {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}
body .wgm-native-card .wgm-native-card__info .price del,
body .wgm-native-card .wgm-native-card__info .price del .amount {
  color: #68717a;
  font-weight: 400;
}

/* Color only the actual WooCommerce sale marker supplied by the sale product. */
body .wgm-native-card.product.sale,
body.single-product .sf-pdp.product.sale {
  --sf-badge-bg: #b91c25;
  --sf-badge-fg: #fff;
  --wgm-card-badge-background: #b91c25;
  --wgm-card-badge-foreground: #fff;
}
body .wgm-native-card.product.sale .badge-inner.on-sale,
body.single-product .sf-pdp .product.sale .badge-inner.on-sale,
body.single-product .sf-pdp.product.sale .badge-inner.on-sale {
  background: #b91c25 !important;
  border: 0 !important;
  color: #fff !important;
  border-radius: 4px;
}
body .wgm-native-card.product.sale .badge-inner.on-sale .onsale,
body.single-product .sf-pdp .product.sale .badge-inner.on-sale .onsale,
body.single-product .sf-pdp.product.sale .badge-inner.on-sale .onsale {
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

/* Keep the provider's image switching and quick-view/add-to-cart controls. */
body .wgm-native-card .wgm-native-card__arrow:focus-visible,
body .wgm-native-card .wgm-native-card__actions a:focus-visible,
body .wgm-native-card .wgm-native-card__mobile-add:focus-visible,
body .wgm-native-card .wgm-native-card__mobile-purchase a:focus-visible {
  outline: 3px solid #126884;
  outline-offset: 2px;
}

/* Existing PDP provider: typography, fields and buttons only. */
body.single-product .sf-pdp {
  --sf-pdp-action: #17202a;
  --sf-pdp-action-text: #fff;
}
body.single-product .sf-pdp__summary .product_title {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.12;
  text-transform: none;
}
body.single-product .sf-pdp__summary .price,
body.single-product .sf-pdp__summary .price ins,
body.single-product .sf-pdp__summary .price ins .amount {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
  text-decoration: none;
}
body.single-product .sf-pdp__summary .price del,
body.single-product .sf-pdp__summary .price del .amount {
  color: #68717a;
}
body.single-product .sf-pdp__summary form.cart select,
body.single-product .sf-pdp__summary form.cart input.qty,
body.single-product .sf-pdp__summary .sf-pdp__dropdown-trigger,
body.single-product .sf-pdp__summary .sf-pdp__variant-option {
  border-color: #bcc4cb;
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}
/* Flatsome's captured theme CSS marks this specific button background important. */
body.single-product .sf-pdp__summary form.cart button.single_add_to_cart_button.button {
  background: #17202a !important;
  border-color: #17202a;
  color: #fff;
}
body.single-product .sf-pdp__summary form.cart button.single_add_to_cart_button.button:hover,
body.single-product .sf-pdp__summary form.cart button.single_add_to_cart_button.button:focus-visible {
  background: #334657 !important;
  border-color: #334657;
  color: #fff;
}
body.single-product .sf-pdp__accordion summary {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}
body.single-product .sf-pdp__summary :is(button, a, select, input):focus-visible,
body.single-product .sf-pdp__accordion summary:focus-visible {
  outline: 3px solid #126884;
  outline-offset: 2px;
}

/* The real drawers' visibility, focus handling and animation remain untouched. */
.htw-site-header .htw-site-header__panel.htw-site-header__search,
.htw-site-header .htw-site-header__panel.htw-site-header__mini-cart {
  background: #fff;
  border-left: 1px solid #e4e7eb;
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}
.htw-site-header__search .searchform .flex-row {
  border-color: #68717a;
  border-radius: 4px;
}
.htw-site-header__search .searchform input.search-field {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}
.htw-site-header__search .autocomplete-suggestion,
.htw-site-header__mini-cart ul.product_list_widget li a:not(.remove),
.htw-site-header__mini-cart .woocommerce-mini-cart__total {
  color: #17202a;
}
.htw-site-header__mini-cart .woocommerce-mini-cart__buttons a.checkout,
.htw-site-header__mini-cart .return-to-shop a.button {
  background: #17202a !important;
  border-color: #17202a;
  color: #fff;
}
.htw-site-header__search :is(button, a, input):focus-visible,
.htw-site-header__mini-cart :is(button, a, input):focus-visible {
  outline: 3px solid #126884;
  outline-offset: 2px;
}

/* The loaded quick-view provider owns its dialog and native WooCommerce form. */
body .product-quick-view-container {
  background: #fff;
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}
body .product-quick-view-container :is(h1, h2, .product_title, .price) {
  color: #17202a;
  font-family: Arial, Helvetica, sans-serif;
}
body .product-quick-view-container .single_add_to_cart_button.button {
  background: #17202a !important;
  border-color: #17202a;
  color: #fff;
}
body .product-quick-view-container .single_add_to_cart_button.button:hover,
body .product-quick-view-container .single_add_to_cart_button.button:focus-visible {
  background: #334657 !important;
  border-color: #334657;
  color: #fff;
}
body .product-quick-view-container :is(button, a, select, input):focus-visible {
  outline: 3px solid #126884;
  outline-offset: 2px;
}

@media (max-width: 849px) {
  /* The existing Flatsome filter link moves this sidebar into its drawer. */
  body.woocommerce:not(.woocommerce-no-js) .smi-shop-archive-page .row > .col:has(> .col-inner > #shop-sidebar) {
    display: none;
  }
  body.woocommerce .smi-shop-archive-products > .products.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }
  body .wgm-native-card .wgm-native-card__info {
    padding: 12px 10px 14px;
  }
  body .wgm-native-card .wgm-native-card__info .name,
  body .wgm-native-card .wgm-native-card__info .name a,
  body .wgm-native-card .wgm-native-card__info .price,
  body .wgm-native-card .wgm-native-card__info .price ins,
  body .wgm-native-card .wgm-native-card__info .price ins .amount {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .wgm-native-card .wgm-native-card__image,
  body .wgm-native-card .wgm-native-card__arrow {
    transition-duration: .01ms;
  }
}
