/* ===== Shop / category archive ===== */
body.woocommerce-shop, body.tax-product_cat { background: #14150F !important; }

/* Banner */
.tft-shop-hero {
  position: relative; overflow: hidden; width: 100%;
  padding: 56px min(6vw, 88px) 46px;
  background: #14150F; border-bottom: 1px solid #2E3123;
}
.tft-shop-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url('https://tf-tactical.com/wp-content/uploads/2026/09/tf-contour-original.png') center / cover;
  filter: invert(1) brightness(0.7) contrast(0.85); opacity: 0.08;
}
.tft-shop-hero::after {
  content: ''; position: absolute; top: -40%; right: -6%; width: 26%; height: 190%;
  background: rgba(107,122,75,0.10); transform: rotate(16deg); pointer-events: none;
}
.tft-shop-hero > * { position: relative; z-index: 1; }
.tft-crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #C7C8BE; margin-bottom: 26px; }
.tft-crumbs a { color: #C7C8BE !important; text-decoration: none; }
.tft-crumbs a:hover { color: #6B7A4B !important; }
.tft-crumbs span { opacity: 0.5; }
.tft-crumbs .tft-crumbs__current { opacity: 1; color: #fff; }
.tft-shop-hero__eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #6B7A4B; }
.tft-shop-hero__title {
  margin: 0 0 14px; color: #fff !important; text-transform: uppercase;
  font-family: 'Bahnschrift','Arial Narrow','Segoe UI Condensed',sans-serif; font-weight: 700;
  font-size: clamp(34px, 4.6vw, 54px); line-height: 1.1;
}
.tft-shop-hero__sub { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.6; color: #C7C8BE; }

/* Hide the theme's empty header / stray page title on archives */
body.woocommerce-shop .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header { display: none !important; }

/* Sidebar + grid layout (desktop) - GRID, not flex: banner, #primary and #secondary
   are siblings of one shared container, so flex made all three columns. Grid lets the
   banner span the full top row while sidebar/products share the row underneath. */
@media (min-width: 992px) {
  body.woocommerce-shop #content > .woostify-container,
  body.tax-product_cat #content > .woostify-container {
    display: grid !important;
    grid-template-columns: 290px 1fr;
    column-gap: 40px;
    row-gap: 0;
    align-items: start;
    max-width: 1360px; margin: 0 auto !important; padding: 0 min(4vw, 40px) 90px !important;
  }
  body.woocommerce-shop .tft-shop-hero, body.tax-product_cat .tft-shop-hero {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    margin: 0 calc(-1 * min(4vw, 40px)) 0 !important;
    width: calc(100% + 2 * min(4vw, 40px)) !important;
  }
  body.woocommerce-shop #primary, body.tax-product_cat #primary {
    grid-column: 2 !important; grid-row: 2 !important; min-width: 0; width: auto !important; margin: 44px 0 0 !important; padding: 0 !important;
  }
  body.woocommerce-shop #secondary, body.tax-product_cat #secondary {
    grid-column: 1 !important; grid-row: 2 !important; width: auto !important; margin: 44px 0 0 !important; position: sticky; top: 24px;
  }
  body.woocommerce-shop #toggle-sidebar-mobile-button, body.tax-product_cat #toggle-sidebar-mobile-button { display: none !important; }
}

/* Sidebar panel */
body.woocommerce-shop #secondary, body.tax-product_cat #secondary {
  background: #1E2118; border: 1px solid #2E3123; border-top: 3px solid #6B7A4B; padding: 26px 24px 10px; color: #C7C8BE;
}
#secondary .widget { margin: 0 0 28px !important; padding: 0 0 26px !important; border-bottom: 1px solid #2E3123 !important; background: transparent !important; }
#secondary .widget:last-child { border-bottom: none !important; margin-bottom: 8px !important; }
#secondary .widgettitle, #secondary .widget-title, #secondary h6 {
  margin: 0 0 16px !important; color: #fff !important; font-size: 13px !important; font-weight: 700 !important;
  letter-spacing: 1.5px; text-transform: uppercase;
}
#secondary p { color: #C7C8BE !important; font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
#secondary a { color: #C7C8BE !important; text-decoration: none; }
#secondary a:hover { color: #6B7A4B !important; }
#secondary .textwidget a, #secondary .widget_custom_html a { color: #fff !important; border-bottom: 1px solid #6B7A4B; font-weight: 600; }

#secondary ul.product-categories { list-style: none; margin: 0; padding: 0; }
#secondary ul.product-categories li { margin: 0; padding: 7px 0; font-size: 14px; color: #8f9484; }
#secondary ul.product-categories li a { color: #E8E8E5 !important; }
#secondary ul.product-categories li.current-cat > a, #secondary ul.product-categories li.current-cat-parent > a { color: #6B7A4B !important; font-weight: 700; }
#secondary ul.product-categories ul.children { list-style: none; margin: 6px 0 0 4px; padding: 0 0 0 14px; border-left: 1px solid #3A3F2C; }
#secondary ul.product-categories .count { color: #8f9484; font-size: 12px; margin-left: 4px; }

#secondary .woocommerce-product-search { display: flex; margin: 0; }
#secondary .woocommerce-product-search input.search-field {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; background: #14150F !important; color: #fff !important;
  border: 1px solid #3A3F2C !important; border-radius: 0 !important; box-shadow: none !important;
}
#secondary .woocommerce-product-search input.search-field:focus { border-color: #6B7A4B !important; outline: none; }
#secondary .woocommerce-product-search button, #secondary .woocommerce-product-search input[type=submit] {
  height: 44px; padding: 0 16px; background: #6B7A4B !important; color: #14150F !important; border: none !important; border-radius: 0 !important; font-weight: 700; cursor: pointer;
}

#secondary .price_slider_wrapper .ui-slider { height: 4px; background: #3A3F2C; border: none; border-radius: 0; margin: 8px 8px 22px; position: relative; }
#secondary .ui-slider .ui-slider-range { background: #6B7A4B !important; border-radius: 0; }
#secondary .ui-slider .ui-slider-handle { top: -6px; width: 16px; height: 16px; background: #E8E8E5 !important; border: 2px solid #6B7A4B !important; border-radius: 50% !important; box-shadow: none !important; }
#secondary .price_slider_amount { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#secondary .price_slider_amount .price_label { color: #C7C8BE !important; font-size: 13px; }
#secondary .price_slider_amount .button {
  order: 2; background: #6B7A4B !important; color: #14150F !important; border: none !important; border-radius: 0 !important;
  padding: 10px 18px !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1px; text-transform: uppercase;
}

/* Toolbar: result count left, sorting right, one aligned row */
body.woocommerce-shop .woostify-sorting, body.tax-product_cat .woostify-sorting {
  display: flex !important; justify-content: space-between !important; align-items: center !important; gap: 16px;
  margin: 0 0 28px !important; padding: 0 0 18px !important; border-bottom: 1px solid #2E3123 !important;
}
body.woocommerce-shop .woostify-toolbar-left, body.tax-product_cat .woostify-toolbar-left { display: flex; align-items: center; gap: 14px; margin: 0 !important; padding: 0 !important; }
body.woocommerce-shop .woocommerce-result-count, body.tax-product_cat .woocommerce-result-count {
  margin: 0 !important; padding: 0 !important; border: none !important; background: transparent !important;
  color: #C7C8BE !important; font-size: 14px !important; float: none !important; width: auto !important;
}
body.woocommerce-shop .woocommerce-ordering, body.tax-product_cat .woocommerce-ordering { margin: 0 !important; float: none !important; }
body.woocommerce-shop .woocommerce-ordering select, body.tax-product_cat .woocommerce-ordering select {
  height: 44px !important; min-width: 220px; padding: 0 40px 0 14px !important; background-color: #1E2118 !important; color: #fff !important;
  border: 1px solid #3A3F2C !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important; font-size: 14px !important;
}
body.woocommerce-shop .woocommerce-ordering select:focus, body.tax-product_cat .woocommerce-ordering select:focus { border-color: #6B7A4B !important; }

/* Product grid + cards */
body.woocommerce-shop ul.products, body.tax-product_cat ul.products {
  display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 24px !important;
  padding: 0 !important; margin: 0 !important; list-style: none !important;
}
body.woocommerce-shop ul.products::before, body.woocommerce-shop ul.products::after,
body.tax-product_cat ul.products::before, body.tax-product_cat ul.products::after { display: none !important; }
body.woocommerce-shop ul.products li.product, body.tax-product_cat ul.products li.product {
  display: flex; flex-direction: column; height: 100%; margin: 0 !important; padding: 0 !important; width: auto !important; float: none !important;
  background: #1E2118 !important; border: 1px solid #2E3123 !important; text-align: center;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
body.woocommerce-shop ul.products li.product:hover, body.tax-product_cat ul.products li.product:hover {
  border-color: #6B7A4B !important; transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
ul.products li.product .product-loop-wrapper { display: flex; flex-direction: column; height: 100%; }
ul.products li.product .product-loop-image-wrapper { overflow: hidden; margin: 0 !important; }
ul.products li.product .product-loop-image-wrapper img { transition: transform 400ms ease; margin: 0 !important; }
ul.products li.product:hover .product-loop-image-wrapper img { transform: scale(1.05); }
ul.products li.product .product-loop-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 22px 18px 26px; min-height: 0 !important; }
ul.products li.product .woocommerce-loop-product__title { margin: 0 0 12px !important; padding: 0 !important; font-size: 17px !important; line-height: 1.25 !important; }
ul.products li.product .product-loop-meta, ul.products li.product .animated-meta { align-items: center !important; justify-content: center; text-align: center; margin-top: auto; }
ul.products li.product .price { padding: 0 !important; margin: 0 !important; display: block; font-size: 17px !important; font-weight: 700; white-space: nowrap; }
ul.products li.product .price .tft-from { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: #8f9484; }

/* Pagination */
.woocommerce-pagination ul.page-numbers { display: flex; justify-content: center; gap: 8px; border: none !important; margin-top: 40px; padding: 0; list-style: none; }
.woocommerce-pagination ul.page-numbers li { border: none !important; }
.woocommerce-pagination .page-numbers a, .woocommerce-pagination .page-numbers span {
  display: block; padding: 10px 16px; background: #1E2118 !important; border: 1px solid #2E3123 !important; color: #C7C8BE !important; text-decoration: none;
}
.woocommerce-pagination .page-numbers .current, .woocommerce-pagination .page-numbers a:hover { background: #6B7A4B !important; color: #14150F !important; border-color: #6B7A4B !important; }

@media (max-width: 1199px) and (min-width: 992px) {
  body.woocommerce-shop ul.products, body.tax-product_cat ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 991px) {
  body.woocommerce-shop ul.products, body.tax-product_cat ul.products { grid-template-columns: repeat(2, 1fr) !important; }
  body.woocommerce-shop #content > .woostify-container, body.tax-product_cat #content > .woostify-container { padding: 30px 20px 70px !important; }
  .tft-shop-hero { padding: 40px 20px 32px; }
}
@media (max-width: 560px) {
  body.woocommerce-shop ul.products, body.tax-product_cat ul.products { grid-template-columns: 1fr !important; }
  body.woocommerce-shop .woostify-sorting, body.tax-product_cat .woostify-sorting { flex-wrap: wrap; }
}

/* Fix: text wrapping character-by-character - elements need nowrap + not allowed to shrink to nothing */
body.woocommerce-shop .woocommerce-result-count, body.tax-product_cat .woocommerce-result-count {
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
}
body.woocommerce-shop .woostify-sorting, body.tax-product_cat .woostify-sorting {
  flex-wrap: wrap !important;
}
body.woocommerce-shop .woocommerce-ordering, body.tax-product_cat .woocommerce-ordering {
  flex: 0 0 auto !important;
}
#secondary .woocommerce-product-search button,
#secondary .woocommerce-product-search input[type="submit"] {
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
  width: auto !important;
}
#secondary .price_slider_amount .button {
  white-space: nowrap !important;
  min-width: max-content !important;
  width: auto !important;
  flex-shrink: 0 !important;
}