.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;
}

/* ==============================
   Shop Page Sidebar Styles
   ============================== */

/* Sidebar container */
#secondary.widget-area,
.ast-woo-sidebar .widget-area {
  padding: 0;
}

/* Each widget block */
#secondary .widget,
.ast-woo-sidebar .widget {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Widget titles */
#secondary .widgettitle,
#secondary .widget-title,
.ast-woo-sidebar .widgettitle,
.ast-woo-sidebar .widget-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e94f37;
  line-height: 1.3;
}

/* Product category list */
.widget_product_categories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget_product_categories ul li {
  border-bottom: 1px solid #f0f0f0;
  margin: 0;
}

.widget_product_categories ul li:last-child {
  border-bottom: none;
}

.widget_product_categories ul li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 4px;
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.widget_product_categories ul li a:hover {
  color: #e94f37;
  padding-left: 8px;
}

/* Category count badge */
.widget_product_categories ul li .count {
  background: #f5f5f5;
  color: #666;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.widget_product_categories ul li a:hover .count {
  background: #fce8e6;
  color: #e94f37;
}

/* Subcategory indentation */
.widget_product_categories ul ul {
  padding-left: 12px;
  border-left: 2px solid #f0f0f0;
  margin: 0 0 4px 8px;
}

.widget_product_categories ul ul li a {
  font-size: 13px;
  color: #555;
  padding: 7px 4px;
}

/* Search widget */
.widget_product_search .woocommerce-product-search {
  display: flex;
  gap: 0;
}

.widget_product_search .search-field {
  flex: 1;
  border: 1px solid #ddd;
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.widget_product_search .search-field:focus {
  border-color: #e94f37;
}

.widget_product_search button[type="submit"] {
  background: #e94f37;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.widget_product_search button[type="submit"]:hover {
  background: #c73e28;
}

/* Price filter widget */
.widget_price_filter .price_slider_wrapper {
  padding: 4px 0;
}

.widget_price_filter .price_slider {
  margin-bottom: 16px;
}

.widget_price_filter .ui-slider-horizontal {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  border: none;
}

.widget_price_filter .ui-slider .ui-slider-range {
  background: #e94f37;
  border-radius: 2px;
}

.widget_price_filter .ui-slider .ui-slider-handle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e94f37;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  top: -6px;
  cursor: grab;
}

.widget_price_filter .price_slider_amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.widget_price_filter .price_label {
  font-size: 13px;
  color: #444;
  flex: 1;
}

.widget_price_filter button.button {
  background: #e94f37;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.widget_price_filter button.button:hover {
  background: #c73e28;
}

/* Responsive: stack sidebar below on mobile */
@media (max-width: 768px) {
  #secondary .widget {
    margin-bottom: 12px;
    padding: 15px;
  }
}

/* Collapse subcategories in sidebar - show only top-level by default */
.widget_product_categories ul.children {
  display: none;
}

/* Show children only for the current/active category */
.widget_product_categories li.current-cat > ul.children,
.widget_product_categories li.current-cat-parent > ul.children {
  display: block;
}

/* Style the expand indicator for categories with children */
.widget_product_categories li.cat-parent > a::after {
  content: " +";
  color: #aaa;
  font-size: 11px;
  font-weight: 400;
}

.widget_product_categories li.current-cat-parent > a::after,
.widget_product_categories li.current-cat > a::after {
  content: " −";
  color: #e94f37;
}