.mtf-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 20px;
}
.mtf-services-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 24px !important;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
.mtf-section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  margin: 40px auto 20px;
  color: #232f3e;
}
.mtf-area-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: center !important;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
.mtf-promo-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 24px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  flex-wrap: wrap;
  gap: 12px;
}
.mtf-why-section .mtf-stats {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  max-width: 1100px;
  margin: 0 auto 30px;
}
@media (max-width: 900px) {
  .mtf-cat-grid { grid-template-columns: repeat(2,1fr) !important; }
  .mtf-why-section .mtf-stats { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 600px) {
  .mtf-cat-grid { grid-template-columns: 1fr !important; }
  .mtf-services-grid { grid-template-columns: 1fr !important; }
  .mtf-why-section .mtf-stats { grid-template-columns: 1fr !important; }
}


/* ===== MTF Shop: Uniform Product Grid ===== */
.woocommerce-shop ul.products.columns-4,
body.woocommerce-page ul.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  margin: 0 0 24px !important;
  padding: 0 !important;
  list-style: none !important;
}
.woocommerce-shop ul.products li.product,
body.woocommerce-page ul.products li.product {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
  transition: box-shadow .2s ease, transform .2s ease !important;
  min-height: 360px !important;
}
.woocommerce-shop ul.products li.product:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.13) !important;
  transform: translateY(-2px) !important;
}
.woocommerce-shop ul.products li.product .woocommerce-loop-product__link {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  padding: 12px 12px 0 !important;
  text-decoration: none !important;
}
.woocommerce-shop ul.products li.product img {
  width: 100% !important;
  height: 175px !important;
  object-fit: contain !important;
  background: #f9fafb !important;
  border-radius: 4px !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  margin: 0 0 10px !important;
  flex-shrink: 0 !important;
}
.woocommerce-shop ul.products li.product .ast-woo-product-category {
  font-size: 11px !important;
  color: #6b7280 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  margin: 0 0 4px !important;
}
.woocommerce-shop ul.products li.product .woocommerce-loop-product__title {
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  color: #111827 !important;
  margin: 0 0 8px !important;
  flex: 1 !important;
}
.woocommerce-shop ul.products li.product .price {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #1a3a6b !important;
  margin: 0 !important;
  padding: 0 12px 8px !important;
}
.woocommerce-shop ul.products li.product .button {
  display: block !important;
  width: calc(100% - 24px) !important;
  margin: auto 12px 12px !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* ===== Shop Header: Search + Filter Bar ===== */
.mtf-shop-header { margin-bottom: 20px; }
.mtf-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.mtf-search-bar input[type="text"] {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.mtf-search-bar input[type="text"]:focus { border-color: #1a3a6b; }
.mtf-search-bar button {
  padding: 9px 20px;
  background: #1a3a6b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mtf-search-bar button:hover { background: #122a54; }
.mtf-filter-row {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
}
.mtf-filter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mtf-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
}
a.mtf-pill {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  line-height: 1.4;
}
a.mtf-pill:hover,
a.mtf-pill:focus { border-color: #1a3a6b; color: #1a3a6b; }
a.mtf-pill.mtf-active { background: #1a3a6b; border-color: #1a3a6b; color: #fff !important; }

@media (max-width: 1024px) {
  .woocommerce-shop ul.products.columns-4,
  body.woocommerce-page ul.products.columns-4 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 640px) {
  .woocommerce-shop ul.products.columns-4,
  body.woocommerce-page ul.products.columns-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .mtf-filter-row { padding: 10px 12px; }
  .mtf-search-bar button { padding: 9px 14px; }
}


/* ===== Core Search Block Styling ===== */
.woocommerce-archive-description .wp-block-search,
.page-description .wp-block-search {
  margin-bottom: 14px !important;
}
.woocommerce-archive-description .wp-block-search__inside-wrapper,
.page-description .wp-block-search__inside-wrapper {
  display: flex !important;
  gap: 0 !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}
.woocommerce-archive-description .wp-block-search__input,
.page-description .wp-block-search__input {
  flex: 1 !important;
  padding: 10px 14px !important;
  border: none !important;
  font-size: 14px !important;
  outline: none !important;
  box-shadow: none !important;
}
.woocommerce-archive-description .wp-block-search__button,
.page-description .wp-block-search__button {
  padding: 10px 22px !important;
  background: #1a3a6b !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
.woocommerce-archive-description .wp-block-search__button:hover,
.page-description .wp-block-search__button:hover {
  background: #122a54 !important;
}

/* ===== Active Pill State via Body Classes (no JS needed) ===== */
body.woocommerce-shop .mtf-pill[href="/shop/"],
body.woocommerce-shop .mtf-pill[href$="/shop/"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-car-lifts .mtf-pill[href*="car-lifts"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-tire-changers .mtf-pill[href*="tire-changers"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-wheel-balancers .mtf-pill[href*="wheel-balancers"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-tire-wheel-supply .mtf-pill[href*="tire-wheel-supply"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-shop-equipment .mtf-pill[href*="shop-equipment"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-coats-equipment .mtf-pill[href*="coats-equipment"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-brake-lathes .mtf-pill[href*="brake-lathes"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}
body.term-air-compressors .mtf-pill[href*="air-compressors"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}


/* ===== Category Page Filter Bar ===== */
body.tax-product_cat .term-description p:first-child {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: #6b7280 !important;
}
body.tax-product_cat .term-description p:first-child br { display: none !important; }
body.tax-product_cat .term-description p:first-child a {
  display: inline-block !important;
  padding: 5px 13px !important;
  border-radius: 20px !important;
  border: 1.5px solid #d1d5db !important;
  background: #fff !important;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all .15s !important;
  white-space: nowrap !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
body.tax-product_cat .term-description p:first-child a:hover {
  border-color: #1a3a6b !important; color: #1a3a6b !important;
}
body.term-car-lifts .term-description p:first-child a[href*="car-lifts"],
body.term-tire-changers .term-description p:first-child a[href*="tire-changers"],
body.term-wheel-balancers .term-description p:first-child a[href*="wheel-balancers"],
body.term-tire-wheel-supply .term-description p:first-child a[href*="tire-wheel-supply"],
body.term-shop-equipment .term-description p:first-child a[href*="shop-equipment"],
body.term-coats-equipment .term-description p:first-child a[href*="coats-equipment"],
body.term-brake-lathes .term-description p:first-child a[href*="brake-lathes"],
body.term-air-compressors .term-description p:first-child a[href*="air-compressors"] {
  background: #1a3a6b !important; border-color: #1a3a6b !important; color: #fff !important;
}