/* Extracted from woocommerce/archive-product.php inline styles
   Controls the archive header layout, pills and responsive behaviour
*/

/* Grid container for cards - apply to our results and WooCommerce product lists so default styles are overridden */
.alotyre-results,
.woocommerce ul.products,
.woocommerce .products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  justify-items: center; /* Center cards within grid cells */
  max-width: 1520px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto; /* center the grid container */
  list-style: none; /* remove ul bullets */
  padding: 0; /* remove default ul padding */
}
.alotyre-results {
  padding: 0px 10px;
}
/* Ensure product list items behave as grid children */
.alotyre-results > *,
.woocommerce ul.products > li.product,
.woocommerce .products > li.product {
  width: 100%;
  margin: 0;
}
/* Styles from your archive-product.php */
.alotyre-tyres-wrap {
  /* sticky header with full-width background while keeping inner centered */
  /* top uses a CSS variable so we can offset below any fixed site header */
  position: sticky;
  top: var(--alotyre-top-offset, 0px);
  width: 100%;
  left: 0;
  background: #f8f8fb;
  box-sizing: border-box;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}
.alotyre-tyres-inner {
  /* centered inner container that preserves previous appearance */
  max-width: 1520px;
  margin: 18px auto 28px;
  padding: 16px;
  padding-top: 18px; /* breathing room when sticky */
  border-radius: 12px;
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
}
.alotyre-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}
.alotyre-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
@media (max-width: 800px) {
  .alotyre-controls {
    grid-template-columns: 1fr 1fr;
  }
}
.alotyre-control label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.alotyre-control select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}
.alotyre-btn {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  height: 40px;
  font-family: outfit;
}
.alotyre-btn:hover {
  opacity: 0.95;
}
.alotyre-empty {
  padding: 12px;
  color: #6b7280;
  grid-column: 1/-1;
  text-align: center;
  width: 100%;
}
.alotyre-errors {
  color: #b91c1c;
  margin-top: 10px;
}

/* Consistent pill and Filter button styles */
.alotyre-pill,
#alotyre-open-filters {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 160px !important;
  height: 48px !important;
  padding: 0 20px !important;
  border-radius: 12px !important;
  border: 2px solid #e6e6e6 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
}
.alotyre-pill:hover,
#alotyre-open-filters:hover {
  opacity: 0.95;
}

/* Keep the top mode buttons distinct but size them to match visually */
.alotyre-mode-btn {
  min-width: 160px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ensure the top switch/pills/filters align left->center->right even inside RTL page */
.alotyre-switch-wrap {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.alotyre-mode-pills {
  margin: 0 auto;
}
.alotyre-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.alotyre-mode-toggle-m {
  display: none;
}

/* Mobile layout tweaks: make mode buttons share a single row and hide size pills */
@media (max-width: 600px) {
  /* Hide the inline size pills on small screens to save space */
  .alotyre-pills-size,
  .alotyre-pills-vehicle {
    display: none !important;
  }

  /* Place the two mode buttons side-by-side, each taking 50% */
  .alotyre-mode-toggle-m {
    width: 100%;
  }
  .alotyre-mode-toggle-m .alotyre-mode-btn {
    flex: 0 0 50%;
    max-width: 50%;
    box-sizing: border-box;
    min-width: 0; /* allow shrinking past the desktop min-width */
    margin: 0; /* remove gaps handled by container */
  }

  /* Make the filters button span the full width on its own row */
  #alotyre-open-filters {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .alotyre-switch-wrap-m {
    gap: 8px;
  }

  .alotyre-filter-btns {
    width: 100%;
  }

  .alotyre-tyres-wrap {
    top: 0px !important;
  }
  .alotyre-mode-toggle-m {
    display: flex;
  }
  .alotyre-mode-toggle {
    display: none;
  }
}
