/* =========================================
   CATEGORY PAGE – APEX AUTO (FIXED)
========================================= */

.wc-cat-page ul.products::before,
.wc-cat-page ul.products::after {
  display: none !important;
  content: none !important;
}


/* -----------------------------------------
   RESET WC PRODUCT GRID ISSUES
----------------------------------------- */
.wc-cat-page ul.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.wc-cat-page ul.products li.product {
  float: none !important;
  width: auto !important;
  clear: none !important;
  display: block;
}

/* force image wrapper */
.wc-cat-page .woocommerce-loop-product__link {
  display: block;
}

.wc-cat-page .woocommerce-loop-product__link img {
  display: block;
  width: 100%;
  height: auto;
  visibility: visible !important;
  opacity: 1 !important;
}

/* -----------------------------------------
   PAGE WRAPPER
----------------------------------------- */
.wc-cat-page {
  padding: 0 0 60px;
}

/* -----------------------------------------
   BREADCRUMBS
----------------------------------------- */
.wc-breadcrumbs {
  max-width: 1400px;
  margin: 50px auto 0;
  padding: 0 8px;
  font-size: 18px;
  color: #555;
}

.wc-breadcrumbs a {
  color: #111;
  font-weight: 600;
  text-decoration: none;
}

.wc-breadcrumbs a:hover {
  color: #dc2626;
}

/* -----------------------------------------
   HERO SECTION
----------------------------------------- */
.wc-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  margin: 30px auto;
  max-width: 1400px;
  height: 380px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
}

.wc-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.65),
    rgba(0, 0, 0, 0.25)
  );
}

.wc-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 70%;
  margin: 0 auto;
  padding: 32px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: #fff;
}

.wc-hero__badge {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.9);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wc-hero__title {
  font-size: 36px;
  font-weight: 900;
  margin: 0;
}

.wc-hero__desc {
  max-width: 760px;
  line-height: 1.65;
  font-size: 15px;
  color: #e5e7eb;
}

/* -----------------------------------------
   SUBCATEGORIES
----------------------------------------- */
.wc-subcats {
  max-width: 1400px;
  margin: 10px auto 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.wc-subcat {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(220, 38, 38, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  transition: 0.25s ease;
  text-decoration: none;
  color: #111;
}

.wc-subcat:hover {
  transform: translateY(-4px);
  border-color: #dc2626;
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.2);
}

.wc-subcat.active {
  border-color: #dc2626;
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.2);
}

.wc-subcat.active h3 {
  color: #dc2626;
}

.wc-subcat__img img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 12px;
  background: #f5f5f5;
  border: 1px solid #eee;
}

.wc-subcat__meta h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 900;
}

.wc-subcat__meta span {
  color: #666;
  font-size: 13px;
  font-weight: 600;
}

/* -----------------------------------------
   MAIN LAYOUT
----------------------------------------- */
.wc-main {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
}

/* -----------------------------------------
   FILTERS
----------------------------------------- */
.wc-filters {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 20px;
}

.wc-filters h4 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wc-filters h4::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f0b0";
  color: #dc2626;
}

.wc-filter-note {
  font-size: 13px;
  color: #666;
}

.wc-filters .widget {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: 12px;
  box-shadow: none;
}

.wc-filters .widgettitle {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wc-filters .widgettitle::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #dc2626;
  content: "\f02b";
}

.wc-filters .product-categories,
.wc-filters .woocommerce-widget-layered-nav-list {
  list-style: none !important;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wc-filters .cat-item-1 {
  display: none;
}

.wc-filters li {
  list-style: none !important;
  padding: 6px 0 6px 0;
  border: none;
  border-radius: 0;
  transition: 0.2s ease;
  position: relative;
}

.wc-filters li:hover {
  border-color: transparent;
  box-shadow: none;
}

.wc-filters .cat-parent > a {
  position: relative;
  padding-right: 16px;
}

.wc-filters .cat-parent > a::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  color: #888;
  position: absolute;
  right: 0;
}

.wc-filters .children {
  list-style: none !important;
  padding-left: 14px;
  margin: 4px 0 0;
  display: none;
  gap: 2px;
}

.wc-filters .children li {
  padding-left: 8px;
}

.wc-filters a {
  color: #111;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wc-filters a:hover {
  color: #dc2626;
}

.wc-filters .count {
  color: #555;
  font-weight: 800;
  font-size: 11px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
}

.wc-filters .woocommerce-widget-layered-nav-list .count,
.wc-filters .product-categories .count {
  margin-left: 8px;
  min-width: 24px;
  text-align: center;
}

.wc-filters .children a {
  font-size: 14px;
  font-weight: 600;
}

.wc-filters .current-cat > a {
  color: #dc2626;
}

.wc-filters .current-cat .count {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(220, 38, 38, 0.35);
}

.wc-filters .current-cat > .children,
.wc-filters .current-cat-parent > .children,
.wc-filters .cat-parent:hover > .children {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wc-filters .woocommerce-product-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wc-filters .search-field {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  outline: none;
  transition: 0.2s ease;
}

.wc-filters .search-field:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.wc-filters button[type="submit"] {
  align-self: flex-start;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.wc-filters button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.25);
}

/* -----------------------------------------
   PRODUCTS AREA
----------------------------------------- */
.wc-products-area {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  padding: 16px 18px 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.wc-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.wc-topbar .woocommerce-ordering {
  margin: 0;
  position: relative;
}

.wc-topbar .woocommerce-ordering::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
  color: #64748b;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.wc-topbar .woocommerce-ordering .orderby {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 240px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 0 40px 0 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.wc-topbar .woocommerce-ordering .orderby:hover {
  border-color: #9ca3af;
}

.wc-topbar .woocommerce-ordering .orderby:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
  outline: none;
}

@media (max-width: 768px) {
  #apex-products,
  .wc-products-area {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: hidden !important;
  }

  .wc-topbar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }

  .wc-topbar .woocommerce-ordering {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .wc-topbar .woocommerce-ordering .orderby {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* -----------------------------------------
   PAGINATION
----------------------------------------- */
.woocommerce nav.woocommerce-pagination {
  margin: 24px 0 0;
  text-align: center;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers li {
  float: none;
  border: 0;
  margin: 0;
  padding: 0;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers a,
.woocommerce nav.woocommerce-pagination ul.page-numbers span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  padding: 0 12px;
  transition: all .2s ease;
}

.woocommerce nav.woocommerce-pagination ul.page-numbers a:hover {
  border-color: #dc2626;
  color: #dc2626;
  transform: translateY(-1px);
}

.woocommerce nav.woocommerce-pagination ul.page-numbers .current {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
}

.woocommerce nav.woocommerce-pagination ul.page-numbers .prev,
.woocommerce nav.woocommerce-pagination ul.page-numbers .next {
  min-width: 46px;
  font-size: 18px;
  padding: 0 10px;
}

@media (max-width: 768px) {
  .woocommerce nav.woocommerce-pagination {
    margin-top: 18px;
  }

  .woocommerce nav.woocommerce-pagination ul.page-numbers {
    gap: 6px;
  }

  .woocommerce nav.woocommerce-pagination ul.page-numbers a,
  .woocommerce nav.woocommerce-pagination ul.page-numbers span {
    min-width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 13px;
    padding: 0 10px;
  }
}

/* -----------------------------------------
   PRODUCT GRID (FIXED)
----------------------------------------- */
.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.products.columns-4 > * {
  margin: 0 !important;
}

/* -----------------------------------------
   PRODUCT CARD (APEX)
----------------------------------------- */
.apex-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.apex-card:hover {
  border-color: #dc2626;
  box-shadow: 0 20px 55px rgba(0,0,0,.1);
  transform: translateY(-4px);
}

.apex-card .badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  text-transform: uppercase;
  z-index: 2;
}

.apex-card .badge.instock {
  background: #dcfce7;
  color: #166534;
}

.apex-card .badge.outstock {
  background: #fee2e2;
  color: #991b1b;
}

.apex-card .thumb {
  padding: 20px;
}

.apex-card .thumb img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  transition: transform .25s ease;
}

.apex-card:hover .thumb img {
  transform: scale(1.04);
}

.apex-card .body {
  padding: 16px 20px 8px;
  text-align: center;
}

.apex-card .sku {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

.apex-card .name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #111;
  text-decoration: none;
  line-height: 1.35;
  margin-bottom: 10px;
}

.apex-card .name:hover {
  color: #dc2626;
}

.apex-card .price {
  font-size: 18px;
  font-weight: 900;
  color: #dc2626;
}

.apex-card .actions {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease, padding .25s ease;
  padding: 0 20px;
}

.apex-card:hover .actions {
  max-height: 180px;
  padding-bottom: 16px;
}

.apex-card .btn,
.apex-card .button {
  display: block;
  margin: 14px 0 20px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 10px 25px rgba(220,38,38,.35);
  border: none !important;
  width: 100%;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  height: 48px;
}

.apex-card .btn:hover,
.apex-card .button:hover {
  filter: brightness(1.05);
}

.apex-card .btn.disabled,
.apex-card .button.disabled {
  background: #9ca3af;
  box-shadow: none;
  pointer-events: none;
  color: #fff !important;
}

.apex-card:focus-within .actions {
  max-height: 180px;
  padding-bottom: 16px;
}

@media (max-width: 768px) {
  .apex-card .actions {
    max-height: none;
  }
}

/* -----------------------------------------
   SUBCATEGORY GROUPS
----------------------------------------- */
.wc-subcat-products {
  margin-bottom: 60px;
}

.wc-subcat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.wc-subcat-title {
  font-size: 26px;
  font-weight: 900;
  padding-left: 14px;
  border-left: 6px solid #dc2626;
}

.wc-subcat-more {
  font-weight: 800;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
}

.wc-subcat-more:hover {
  background: #dc2626;
  color: #fff;
}

/* -----------------------------------------
   RESPONSIVE
----------------------------------------- */
@media (max-width: 1024px) {
  .wc-hero__content {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .wc-main {
    grid-template-columns: 1fr;
  }

  .wc-hero__title {
    font-size: 28px;
  }
}
@media (max-width: 1200px) {
  .products.columns-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .products.columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .products.columns-4 {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------
   TYPOGRAPHY NORMALIZATION (smaller)
----------------------------------------- */
.woocommerce,
.woocommerce-page {
  font-size: 15px;
}

.woocommerce .button,
.woocommerce-page .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  font-size: 14px !important;
}

.woocommerce .price,
.woocommerce-Price-amount {
  font-size: 0.96em;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
  font-size: 15px;
  line-height: 1.35;
}

.woocommerce div.product .product_title {
  font-size: clamp(24px, 2.2vw, 30px);
}
