/* Sticky compare bar */
.mb-compare-bar {
    position: sticky;           /* or switch to fixed; bottom:0; if preferred */
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.mb-compare-hidden {
    display: none;
}

.mb-compare-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#mb-compare-items {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mb-compare-pill {
    border-radius: 999px;
    border: 1px solid #ccc;
    padding: 2px 8px;
    font-size: 12px;
}

.mb-compare-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mb-compare-button,
.mb-compare-clear {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
}

.mb-compare-button[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* "Add to Compare" inline on cards */
.mb-belt-compare {
    margin-top: 4px;
    font-size: 13px;
}

.mb-belt-compare input[type="checkbox"] {
    margin-right: 4px;
}

/* Comparison table layout */
.mb-belt-comparison {
    margin-top: 16px;
}

.mb-belt-comparison__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
}

.mb-print-button {
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.mb-uom-toggle label {
    margin-right: 10px;
    font-size: 14px;
    cursor: pointer;
}

.mb-belt-comparison__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mb-belt-comparison__table th,
.mb-belt-comparison__table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;
}

.mb-belt-comparison__table th {
    background: #f6f6f6;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mb-belt-comparison__thumb img {
    max-width: 70px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Optional zebra striping */
.mb-belt-comparison__table tbody tr:nth-child(odd) {
    background: #fafafa;
}

/* Simple print tweak */
@media print {
    .mb-compare-bar,
    .mb-belt-comparison__toolbar {
        display: none !important;
    }
}
/* View Spec link under thumbnail */
.mb-belt-comparison__view-spec {
  margin-top: 6px;
  text-align: center;
}
.mb-belt-comparison__view-spec a {
  font-size: 13px;
  text-decoration: underline;
}

/* Sortable column headers */
.mb-belt-comparison__table th.mb-sortable {
  cursor: pointer;
  user-select: none;
}
.mb-belt-comparison__table th.mb-sortable.mb-sort-asc::after {
  content: " ▲";
  font-size: 12px;
}
.mb-belt-comparison__table th.mb-sortable.mb-sort-desc::after {
  content: " ▼";
  font-size: 12px;
}
/* Compare bar pills with remove "X" */
.mb-compare-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}

.mb-compare-pill-remove {
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.mb-compare-pill-remove:hover {
  opacity: 0.7;
}

/* Remove link under part number on comparison table */
.mb-part-cell .mb-compare-remove-row {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* Optional warning style */
.mb-compare-warning {
  margin: 12px 0;
  font-weight: 600;
}

/* ==========================
   PRINT STYLES (Comparison)
   ========================== */
@media print {

  /* Page margins */
  @page {
    margin: 0.6in 0.5in;
  }

  /* Hide WP admin bar */
  #wpadminbar { display: none !important; }

  /* Hide site header/nav + Elementor header wrappers (common selectors) */
  header,
  .elementor-location-header,
  .site-header,
  .ast-header-break-point,
  .ast-primary-header-bar,
  .main-header-bar,
  .elementor-nav-menu,
  nav {
    display: none !important;
  }

  /* Hide footer (and common Elementor footer wrapper) */
  footer,
  .elementor-location-footer,
  .site-footer,
  .footer,
  .ast-footer-wrap,
  .elementor-footer {
    display: none !important;
  }

  /* Hide anything you explicitly mark as "no print" */
  .no-print { display: none !important; }

  /* Hide the UI controls on the comparison page */
  .mb-belt-comparison__toolbar,
  .mb-print-button {
    display: none !important;
  }

  /* Show our print header */
  .mb-print-header {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    margin: 0 0 14px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #ddd;
  }

  .mb-print-header__left img,
  .mb-print-header__left .custom-logo {
    max-height: 70px;
    width: auto;
    height: auto;
    display: block;
  }

  .mb-print-header__right {
    text-align: right;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
  }

  /* Tighten up comparison table for print */
  .mb-belt-comparison__table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px;
  }

  .mb-belt-comparison__table th,
  .mb-belt-comparison__table td {
    padding: 6px 6px !important;
    border: 1px solid #ddd !important;
    vertical-align: top;
  }

  /* Avoid cutting a row mid-print */
  .mb-belt-comparison__table tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Ensure images print nicely */
  .mb-belt-comparison__thumb img {
    max-width: 120px;
    height: auto;
  }
}
/* ==========================
   Print header: screen vs print
   ========================== */

/* Hide by default (normal screen view) */
.mb-print-header {
  display: none;
}

/* ==========================
   Screen: prevent accidental scroll boxes
   ========================== */

/* Ensure the comparison area can grow naturally */
.mb-belt-comparison,
.mb-belt-comparison * {
  max-height: none;
}

/* If any parent wrapper is forcing a scroll box, this neutralizes it */
.mb-belt-comparison {
  overflow: visible;
}

/* Table should not be trapped in a fixed-height container */
.mb-belt-comparison__table {
  height: auto;
}

/* Elementor containers sometimes get overflow rules */
.elementor-element .mb-belt-comparison {
  overflow: visible !important;
}

#belt-compare-grid {
  height: auto !important;
  overflow: visible !important;
}