/* ===== Results styles ===== */

/* DOT year badge */
.dot-year {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  font-size: 0.78em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.85;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.status-badge:hover {
  opacity: 1;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
}
.status-badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-fast {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
}
.status-fast::before { background: #28a745; }
.status-delayed {
  background-color: rgba(255, 193, 7, 0.12);
  color: #856404;
}
.status-delayed::before { background: #e6a817; }
.tl-stock-warning {
  font-size: 0.75em;
  color: #b91c1c;
  font-weight: 500;
}

/* Free delivery badge */
.ts-free-delivery-badge {
  display: inline-block;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
}
.ts-free-delivery-sm {
  font-size: 0.6em;
  padding: 2px 6px;
}
/* In modal price block */
.tire-detail-price-block .ts-free-delivery-badge {
  font-size: 0.55em;
  margin-top: 2px;
}

.tire-search-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: flex-start;
}

.field-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 90px;
  box-sizing: border-box;
}

.field-group label {
  font-size: 0.9em;
  margin-bottom: 4px;
}

.field-group select {
  padding: 6px 8px;
  font-size: 0.95em;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}


/* Header + Toolbar */
.tire-results-header h3 {
  margin-bottom: 8px;
}
.ts-header-meta {
  font-size: 0.55em;
  font-weight: 400;
  color: #666;
  vertical-align: middle;
}
.ts-sort-wrap {
  position: relative;
  display: inline;
}
.ts-sort-trigger {
  cursor: pointer;
  color: #0073aa;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.ts-sort-trigger:hover {
  color: #005177;
}
.ts-sort-dropdown {
  position: absolute;
  top: 1.6em;
  left: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px 0;
  min-width: 180px;
  white-space: nowrap;
}
.ts-sort-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.9em;
  color: #333;
}
.ts-sort-option:hover {
  background: #f5f5f5;
}
.ts-sort-option.active {
  font-weight: 600;
  color: #0073aa;
}
/* Delivery group separator */
.ts-delivery-separator {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 6px;
  margin: 4px 0;
}
.ts-delivery-separator::before,
.ts-delivery-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd;
}
.ts-delivery-separator span {
  font-size: 0.82em;
  font-weight: 600;
  color: #888;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tire-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 12px;
  flex-wrap: wrap;
}
.tire-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fast delivery toggle switch */
.tire-fast-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88em;
  color: #555;
  transition: color 0.2s;
}
.tire-fast-toggle:hover { color: #222; }
.tire-fast-toggle input { display: none; }
.fast-toggle-track {
  position: relative;
  width: 38px;
  height: 22px;
  background: #ccc;
  border-radius: 12px;
  transition: background 0.25s;
  flex-shrink: 0;
}
.fast-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s;
}
.tire-fast-toggle input:checked + .fast-toggle-track {
  background: #28a745;
}
.tire-fast-toggle input:checked + .fast-toggle-track .fast-toggle-knob {
  transform: translateX(16px);
}
/* Fast delivery toggle: orange track when unchecked */
#fast-toggle-label input:not(:checked) + .fast-toggle-track {
  background: #f5a623;
}
.fast-toggle-text {
  white-space: nowrap;
  font-weight: 500;
}
/* Low-stock toggle active state (red) */
#low-stock-toggle-label.low-stock-active {
  background: #fde8e8;
  border: 1px solid #e53935;
  border-radius: 6px;
  padding: 4px 10px;
  margin: -4px -10px;
  color: #c62828;
}
#low-stock-toggle-label.low-stock-active .fast-toggle-text {
  color: #c62828;
  font-weight: 600;
}
/* Low-stock card highlight (red) */
.tire-product.low-stock-highlight {
  border-color: #d32f2f;
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(211,47,47,0.35), 0 0 12px rgba(211,47,47,0.15);
  background: #ffebee;
}
/* Slow delivery toggle active state (orange) */
#fast-toggle-label.slow-delivery-active {
  background: #fff3e0;
  border: 1px solid #f5a623;
  border-radius: 6px;
  padding: 4px 10px;
  margin: -4px -10px;
}
#fast-toggle-label.slow-delivery-active .fast-toggle-text {
  color: #e65100;
  font-weight: 600;
}
#fast-toggle-label.slow-delivery-active .fast-toggle-prefix {
  color: #e65100;
}
/* Slow delivery card highlight (orange) */
.tire-product.slow-delivery-highlight {
  border-color: #f5a623;
  box-shadow: 0 0 0 2px rgba(245,166,35,0.3), 0 0 10px rgba(0,0,0,0.05);
  background: #fffaf0;
}

/* Special order popup */
.tire-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tire-popup {
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.tire-popup h3 {
  margin: 0 0 6px;
  font-size: 1.15em;
  color: #111;
}
.tire-popup-delivery {
  font-size: 0.95em;
  color: #333;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #fff8e1;
  border-left: 4px solid #f9a825;
  border-radius: 4px;
}
.tire-popup-disclaimer {
  font-size: 0.85em;
  color: #555;
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #fef3f3;
  border-left: 4px solid #e53935;
  border-radius: 4px;
}
.tire-popup-confirm-wrap {
  border: 2px solid #007cba;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #f0f8ff;
}
.tire-popup-confirm-text {
  font-size: 0.82em;
  color: #333;
  line-height: 1.5;
  margin-bottom: 10px;
}
.tire-popup-confirm-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #007cba;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.92em;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.tire-popup-confirm-btn:hover {
  background: #005f8f;
}
.tire-popup-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.tire-popup-actions a {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.tire-popup-wa {
  background: #25d366;
  color: #fff !important;
}
.tire-popup-wa:hover { opacity: 0.85; }
.tire-popup-contact {
  background: #f0f0f0;
  color: #333 !important;
}
.tire-popup-contact:hover { opacity: 0.75; }
.tire-popup-cancel {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px;
  font-size: 0.82em;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
}
.tire-popup-cancel:hover { color: #555; }

/* Secondary toolbar row (low-stock toggle, supplier filter) */
.tire-secondary-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 6px;
  margin-bottom: 5px;
}
.ts-supplier-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82em;
}
.ts-supplier-label {
  color: #555;
  font-weight: 600;
}
.ts-supplier-cb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: #333;
  font-weight: 500;
}
.ts-supplier-cb input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* Copy quote button (admin) */
.ts-copy-quote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  margin-left: 10px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  letter-spacing: 0.02em;
}
.ts-copy-quote-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
}
.ts-copy-quote-btn:active {
  transform: translateY(0);
  opacity: 0.85;
}
.ts-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: #fff;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  margin-left: 4px;
  box-shadow: 0 2px 8px rgba(17, 153, 142, 0.3);
  letter-spacing: 0.02em;
}
.ts-share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(17, 153, 142, 0.45);
}
.ts-share-btn:active {
  transform: translateY(0);
  opacity: 0.85;
}
.ts-deselect-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: none;
  border-radius: 20px;
  background: #f1f1f1;
  color: #555;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-left: 4px;
}
.ts-deselect-btn:hover {
  background: #e0e0e0;
  color: #333;
}

/* Admin quote checkbox — overlay on the image */
.ts-quote-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 5;
  cursor: pointer;
  line-height: 1;
}
.ts-quote-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #764ba2;
  cursor: pointer;
  border-radius: 4px;
}
.tire-product:has(.ts-quote-cb:checked) {
  outline: 3px solid #764ba2;
  outline-offset: -3px;
  z-index: 1;
}

/* Price filter inputs */
.tire-price-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: #999;
  font-weight: 400;
  white-space: nowrap;
}
.tire-results-toolbar input[type="number"].tire-price-input {
  width: 62px !important;
  padding: 7px 8px !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  font-size: 0.85em !important;
  text-align: center !important;
  background: #fafafa !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: normal !important;
  box-shadow: none !important;
  margin: 0 !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.tire-results-toolbar input[type="number"].tire-price-input:focus {
  border-color: #007cba !important;
  box-shadow: 0 0 0 3px rgba(0,124,186,0.08) !important;
  background: #fff !important;
}
.tire-results-toolbar input[type="number"].tire-price-input::-webkit-inner-spin-button,
.tire-results-toolbar input[type="number"].tire-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.tire-results-toolbar input[type="number"].tire-price-input { -moz-appearance: textfield; }

/* EU label range filters */
.tire-eu-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tire-range-filter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}
.tire-range-label {
  font-size: 0.78em;
  color: #555;
  font-weight: 600;
  white-space: nowrap;
}
.tire-range-track {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.tire-range-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  pointer-events: none;
}
.tire-range-fill {
  position: absolute;
  height: 4px;
  background: #007cba;
  border-radius: 2px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.tire-range-input {
  position: absolute !important;
  width: 100% !important;
  height: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  pointer-events: none;
  -webkit-appearance: none !important;
  appearance: none !important;
  z-index: 2;
}
.tire-range-input::-webkit-slider-runnable-track {
  height: 4px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.tire-range-input::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: #007cba !important;
  border: 2px solid #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
  cursor: pointer;
  pointer-events: auto;
  margin-top: -7px !important;
  position: relative;
  z-index: 3;
}
.tire-range-input::-moz-range-track {
  height: 4px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.tire-range-input::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #007cba !important;
  border: 2px solid #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
  cursor: pointer;
  pointer-events: auto;
}

/* Search field */
.tire-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.tire-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #999;
  pointer-events: none;
  z-index: 1;
}
.tire-results-toolbar input[type="text"].tire-text-filter {
  padding: 7px 24px 7px 30px !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  font-size: 0.85em !important;
  width: 160px !important;
  background: #fafafa !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, width 0.25s;
  outline: none !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: normal !important;
  box-shadow: none !important;
  margin: 0 !important;
}
.tire-results-toolbar input[type="text"].tire-text-filter:focus {
  border-color: #007cba !important;
  box-shadow: 0 0 0 3px rgba(0,124,186,0.08) !important;
  background: #fff !important;
  width: 220px !important;
}
.tire-results-toolbar input[type="text"].tire-text-filter::placeholder {
  color: #bbb;
}
.tire-text-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  display: none;
  z-index: 1;
}
.tire-text-clear:hover { color: #333; }
.tire-text-clear.visible { display: block; }

/* View toggle buttons */
.tire-view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}
.view-btn {
  background: #fafafa;
  border: none;
  border-right: 1px solid #ddd;
  padding: 7px 12px;
  cursor: pointer;
  line-height: 1;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.view-btn:last-child { border-right: none; }
.view-btn:hover { background: #f0f0f0; color: #555; }
.view-btn.active {
  background: #333;
  color: #fff;
}
.view-btn svg { display: block; }

/* Tire product card base */
.tire-product {
  position: relative;
  align-content: center;
  border: 1px solid #e8e8e8;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}
.tire-product:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* GRID VIEW (default) */
#tire-results {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---- LIST ROW (hidden by default, shown in list view) ---- */
.tire-list-row { display: none; }

/* ---- LIST VIEW MODE ---- */
#tire-results.view-list {
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}
#tire-results.view-list .tire-product {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
  overflow: visible;
}
#tire-results.view-list .tire-product:first-child {
  border-top: 1px solid #e8e8e8;
}
/* Hide grid card, show list row */
#tire-results.view-list .tire-product-grid {
  display: none !important;
}
#tire-results.view-list .tire-list-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 72px;
  padding: 10px 0;
  max-width: 100%;
  cursor: pointer;
  box-sizing: border-box;
}

/* List row columns */
.tl-brand {
  flex: 0 0 110px;
  font-size: 0.88em;
  line-height: 1.3;
  padding: 0 6px 0 12px;
}
.tl-brand strong { font-weight: 600; }
.tl-model {
  flex: 0 0 110px;
  min-width: 0;
  font-size: 0.85em;
  line-height: 1.3;
  color: #555;
  padding: 0 6px;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.tl-img {
  flex: 0 0 76px;
  padding: 0 6px;
}
.tl-img img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  cursor: pointer;
}
.tl-img-preview {
  position: fixed;
  width: 260px;
  height: 260px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 100000;
  pointer-events: none;
  padding: 10px;
}
.sp-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: spLbFadeIn 0.2s ease;
}
@keyframes spLbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.sp-lightbox-overlay img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  background: #fff;
}
.tl-specs {
  flex: 0 0 155px;
  display: flex;
  flex-direction: column;
  font-size: 0.82em;
  gap: 3px;
  padding: 0 8px;
}
.tl-size { font-weight: 500; color: #333; }
.tl-eu { color: #888; font-size: 0.82em; letter-spacing: 0.3px; }
.tl-price {
  flex: 0 0 110px;
  text-align: right;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tl-price strong { font-size: 1em; color: #111; }
.tl-total {
  font-size: 0.75em;
  color: #999;
  line-height: 1.3;
}
.tl-delivery {
  flex: 0 0 130px;
  min-width: 130px;
  max-width: 130px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0 6px;
  overflow: hidden;
}
.tl-delivery .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none !important;
  font-size: 0.78em;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  box-shadow: none;
}
.tl-delivery .status-badge:hover {
  box-shadow: none;
}
.tl-buy {
  flex: 0 0 auto;
  padding: 0 8px;
}
.tl-buy-form {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Compact qty + buy — list view only */
.tl-buy-form .quantity {
  display: flex !important;
  align-items: center !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 6px !important;
  overflow: hidden;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
  width: auto !important;
}
.tl-buy-form .quantity a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 34px !important;
  font-size: 15px !important;
  color: #555 !important;
  text-decoration: none !important;
  background: #f7f7f7 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.tl-buy-form .quantity a:hover {
  background: #eaeaea !important;
  color: #111 !important;
}
.tl-buy-form .quantity input[type="number"] {
  width: 36px !important;
  height: 34px !important;
  text-align: center !important;
  border: none !important;
  border-left: 1px solid #e0e0e0 !important;
  border-right: 1px solid #e0e0e0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #333 !important;
  background: #fff !important;
  padding: 0 !important;
  margin: 0 !important;
  -moz-appearance: textfield !important;
  outline: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.tl-buy-form .quantity input::-webkit-outer-spin-button,
.tl-buy-form .quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
.tl-buy-form .add-to-cart-button {
  height: 34px !important;
  width: 38px !important;
  padding: 0 !important;
  margin-left: 8px !important;
  font-size: 0 !important;
  border: none !important;
  border-radius: 6px !important;
  background: #007cba !important;
  color: #fff !important;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tl-buy-form .add-to-cart-button:hover {
  background: #005f8f !important;
}
.add-to-cart-button .btn-text {
  display: none;
}
.add-to-cart-button .btn-cart-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.ts-nr-link {
  color: #007cba;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}
.ts-nr-link:hover {
  color: #005f8f;
}

/* Grid view — polished card */
.tire-product-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.grid-image-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 12px;
}
.grid-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.grid-card-body {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}
.grid-title {
  font-size: 0.95em;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #1a1a1a;
}
.grid-size {
  font-size: 0.8em;
  color: #888;
  text-align: center;
}
.grid-specs {
  display: flex;
  gap: 4px;
  justify-content: center;
  font-size: 0.75em;
  color: #666;
  margin: 2px 0;
}
.grid-specs span {
  background: #f5f5f5;
  border-radius: 3px;
  padding: 2px 5px;
}
.grid-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.grid-price {
  font-size: 1.3em;
  font-weight: 800;
  color: #111;
}
.grid-total-row {
  font-size: 0.78em;
  color: #999;
  text-align: center;
}
.grid-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}
.grid-actions .tl-buy-form {
  gap: 0;
}
.grid-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: none;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.grid-wa-btn:hover {
  transform: scale(1.1);
}
.grid-wa-btn img {
  width: 32px;
  height: 32px;
}
.grid-admin {
  font-size: 0.7em;
  color: #ccc;
  text-align: center;
  margin-top: 2px;
}
/* Grid card click cursor */
.tire-product-grid {
  cursor: pointer;
}

/* Product detail modal */
.tire-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.tire-detail-overlay.active {
  opacity: 1;
}
.tire-detail-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
  position: relative;
}
.tire-detail-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  font-size: 20px;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}
.tire-detail-close:hover {
  background: rgba(0,0,0,0.1);
  color: #333;
}
/* Top row: image left, info right */
.tire-detail-hero {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #f0f0f0;
}
.tire-detail-image {
  flex: 0 0 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  background: #fff;
}
.tire-detail-image img {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
}
.tire-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 28px 28px 0;
  gap: 10px;
}
.tire-detail-title {
  font-size: 1.25em;
  font-weight: 800;
  color: #111;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tire-detail-size {
  font-size: 0.9em;
  color: #888;
  margin: 0;
  font-weight: 500;
}
.tire-detail-specs {
  display: flex;
  gap: 6px;
  margin: 0;
}
.tire-detail-spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 58px;
}
.tire-detail-spec-icon {
  font-size: 0.9em;
  margin-bottom: 1px;
}
.tire-detail-spec-val {
  font-size: 1em;
  font-weight: 700;
  color: #222;
}
.tire-detail-spec-label {
  font-size: 0.62em;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Middle row: price + actions */
.tire-detail-purchase {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: #f8f9fa;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.tire-detail-price-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tire-detail-price {
  font-size: 1.5em;
  font-weight: 800;
  color: #111;
  line-height: 1.1;
}
.tire-detail-total {
  font-size: 0.8em;
  color: #999;
}
.tire-detail-delivery {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tire-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.tire-detail-code {
  font-size: 0.72em;
  color: #ccc;
  padding: 0 28px 4px;
  background: #f8f9fa;
}
/* Bottom: description */
.tire-detail-desc-wrap {
  padding: 0 28px 24px;
  background: #fff;
  border-radius: 0 0 16px 16px;
}
.tire-detail-desc-title {
  font-size: 0.82em;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}
.tire-detail-desc {
  font-size: 0.85em;
  color: #555;
  line-height: 1.7;
  padding: 16px 18px;
  background: #fafbfc;
  border-radius: 10px;
  border-left: 3px solid #007cba;
}
.tire-detail-desc h4 {
  font-size: 0.95em;
  font-weight: 700;
  color: #333;
  margin: 8px 0 3px;
}
.tire-detail-desc h4:first-child {
  margin-top: 0;
}
.tire-detail-desc ul {
  margin: 3px 0 6px 0;
  padding-left: 16px;
}
.tire-detail-desc li {
  margin-bottom: 2px;
}
.tire-detail-desc p {
  margin: 0 0 6px;
}
.tire-detail-desc p:last-child {
  margin-bottom: 0;
}
@media (max-width: 580px) {
  .tire-detail-hero { flex-direction: column; }
  .tire-detail-image { flex: none; padding: 20px; }
  .tire-detail-image img { max-width: 160px; max-height: 160px; }
  .tire-detail-info { padding: 0 20px 16px; align-items: center; text-align: center; }
  .tire-detail-specs { justify-content: center; }
  .tire-detail-purchase { padding: 14px 20px; justify-content: center; }
  .tire-detail-actions { margin-left: 0; }
  .tire-detail-desc-wrap { padding: 0 20px 20px; }
  .tire-detail-code { padding: 0 20px 4px; }
}

.tl-wa {
  flex: 0 0 auto;
  text-align: center;
  padding: 0 4px;
  overflow: visible;
  position: relative;
}

/* Row hover */
#tire-results.view-list .tire-product:hover {
  background: #fafbfc;
  box-shadow: none;
  transform: none;
}

/* Tablet — icon-only WhatsApp, no hover animation */
@media (max-width: 965px) {
  .tl-brand { flex: 0 0 90px; font-size: 0.82em; padding: 0 4px 0 8px; }
  .tl-model { flex: 0 0 80px; font-size: 0.8em; }
  .tl-img { flex: 0 0 60px; }
  .tl-img img { width: 52px; height: 52px; }
  .tl-specs { flex: 0 0 110px; font-size: 0.78em; }
  .tl-price { flex: 0 0 90px; padding: 0 6px; }
  .tl-delivery { flex: 0 0 80px; min-width: 80px; max-width: 80px; }
  .tl-wa .wss-whatsapp-text { display: none !important; }
  .tl-wa .wss-whatsapp-button {
    all: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
  }
  .tl-wa .wss-whatsapp-icon img {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
  }
}

/* Narrow tablet — prevent overflow between 800-768px */
@media (max-width: 800px) and (min-width: 769px) {
  .tl-brand { flex: 0 1 70px; min-width: 0; font-size: 0.78em; padding: 0 3px 0 6px; }
  .tl-model { flex: 0 1 65px; min-width: 0; font-size: 0.76em; }
  .tl-img { flex: 0 0 52px; padding: 0 3px; }
  .tl-img img { width: 44px; height: 44px; }
  .tl-specs { flex: 0 1 90px; min-width: 0; font-size: 0.72em; padding: 0 4px; }
  .tl-price { flex: 0 0 80px; padding: 0 4px; font-size: 0.9em; }
  .tl-delivery { flex: 0 0 70px; min-width: 70px; max-width: 70px; padding: 0 3px; }
  .tl-delivery .status-badge { font-size: 0.7em !important; }
  .tl-buy { padding: 0 3px; }
  .tl-buy-form .add-to-cart-button { width: 36px !important; height: 32px !important; padding: 0 !important; }
  .tl-buy-form .quantity { height: 30px !important; }
  .tl-buy-form .quantity a { width: 26px !important; font-size: 0.82em !important; }
  .tl-buy-form .quantity input[type="number"] { width: 30px !important; font-size: 0.82em !important; }
  .tl-wa { padding: 0 2px; }
  .tl-wa .wss-whatsapp-icon img { width: 24px !important; height: 24px !important; }
}

/* Mobile */
@media (max-width: 768px) {
  .tire-product-grid {
    display: grid !important;
    grid-template-columns: 40% 60% !important;
    gap: 0 !important;
    align-items: center !important;
  }
  .grid-card-body {
    background: #f8f9fa;
    border-radius: 0 12px 12px 0;
    padding: 12px 14px;
  }
  .grid-image-wrap {
    border-radius: 12px 0 0 12px;
  }
  .tire-image, .tire-info, .tire-specs, .tire-action {
    text-align: center !important;
    margin: 0 auto !important;
  }
  .tire-text-filter { width: 100%; }

  /* Mobile list: CSS Grid card */
  #tire-results.view-list .tire-list-row {
    display: grid !important;
    grid-template-columns: 48px 1fr auto;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "img brand  price"
      "img model  delivery"
      "specs specs specs"
      "actions actions actions";
    gap: 0;
    padding: 12px 14px;
    align-items: center;
  }

  /* Image — spans row 1+2 */
  .tl-img {
    grid-area: img;
    padding: 0 10px 0 0;
    align-self: start;
    padding-top: 2px;
  }
  .tl-img img { width: 42px; height: 42px; }

  /* Brand */
  .tl-brand {
    grid-area: brand;
    padding: 0;
    font-size: 0.9em;
    line-height: 1.3;
  }

  /* Model — full text, wraps naturally */
  .tl-model {
    grid-area: model;
    padding: 0;
    font-size: 0.82em;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    line-height: 1.3;
    color: #555;
  }

  /* Price — top right */
  .tl-price {
    grid-area: price;
    text-align: right;
    padding: 0 0 0 8px;
    align-self: center;
  }
  .tl-price strong { font-size: 1em; }
  .tl-total { display: none; }

  /* Delivery — right-aligned under price */
  .tl-delivery {
    grid-area: delivery;
    justify-self: end;
    text-align: right;
    padding: 2px 0 0 8px;
    flex: none;
    min-width: 0;
    max-width: none;
  }
  .tl-delivery .status-badge {
    font-size: 0.73em !important;
    padding: 2px 8px;
  }

  /* Specs row */
  .tl-specs {
    grid-area: specs;
    padding: 6px 0 0 0;
    font-size: 0.75em;
    display: inline;
  }

  /* Actions row: buy + wa */
  .tl-buy {
    grid-area: actions;
    padding: 10px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .tl-buy-form .quantity { height: 34px !important; }
  .tl-buy-form .quantity input[type="number"] {
    width: 34px !important;
    font-size: 0.88em !important;
  }
  .tl-buy-form .quantity a {
    width: 30px !important;
    font-size: 0.88em !important;
  }
  .tl-buy-form .add-to-cart-button {
    width: 36px !important;
    height: 34px !important;
    padding: 0 !important;
  }

  .tl-wa {
    grid-area: actions;
    justify-self: end;
    align-self: end;
    padding: 10px 0 0 0;
  }
  .tl-wa .wss-whatsapp-button {
    all: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
  }
  .tl-wa .wss-whatsapp-text { display: none !important; }
  .tl-wa .wss-whatsapp-icon img {
    width: 28px !important;
    height: 28px !important;
    display: block !important;
  }

  /* Mobile toolbar layout */
  .tire-results-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  /* Row 1: fast delivery toggle — full width */
  .tire-fast-toggle {
    order: 1;
  }
  /* Row 2: EU chips + price — compact horizontal strip */
  .tire-eu-filters {
    order: 2;
    justify-content: flex-start;
    gap: 6px !important;
  }
  /* Row 3: search + view toggle */
  .tire-toolbar-right {
    order: 3;
  }
  /* Collapse range sliders into tappable chips */
  .tire-range-filter {
    min-width: 0 !important;
  }
  .tire-range-filter .tire-range-track {
    display: none;
  }
  .tire-range-label {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.75em !important;
    transition: background 0.15s, border-color 0.15s;
  }
  .tire-range-label:hover, .ts-range-open .tire-range-label {
    background: #e8f4fd;
    border-color: #007cba;
  }
  /* Fullscreen range panel overlay */
  .ts-range-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 100000;
  }
  .ts-range-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 40px);
    max-width: 360px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    padding: 22px 24px 18px;
    z-index: 100001;
  }
  .ts-range-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
  }
  .ts-range-panel-track {
    position: relative;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 16px 6px 24px;
  }
  .ts-range-panel-track .tire-range-fill {
    position: absolute;
    height: 4px;
    background: #007cba;
    border-radius: 2px;
    top: 0;
    pointer-events: none;
    z-index: 1;
  }
  .ts-range-panel-track .tire-range-input {
    position: absolute !important;
    width: 100% !important;
    height: 4px !important;
    top: 0;
    left: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    pointer-events: none;
    -webkit-appearance: none !important;
    appearance: none !important;
    z-index: 2;
  }
  .ts-range-panel-track .tire-range-input::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #007cba !important;
    border: 2px solid #fff !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3) !important;
    cursor: pointer;
    pointer-events: auto;
    margin-top: -9px !important;
    position: relative;
    z-index: 3;
  }
  .ts-range-panel-track .tire-range-input::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #007cba !important;
    border: 2px solid #fff !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.3) !important;
    cursor: pointer;
    pointer-events: auto;
  }
  .ts-range-panel-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
    margin-top: 6px;
  }
  .ts-range-panel-tick {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7em;
    color: #888;
  }
  .ts-range-panel-tick::before {
    content: "";
    width: 1px;
    height: 8px;
    background: #ccc;
    margin-bottom: 3px;
  }
  .ts-range-panel-tick:first-child::before,
  .ts-range-panel-tick:last-child::before {
    height: 12px;
    background: #999;
  }
  .ts-range-panel-tick:first-child,
  .ts-range-panel-tick:last-child {
    font-weight: 600;
    color: #555;
    font-size: 0.75em;
  }
  /* Price inputs smaller */
  .tire-price-filter {
    font-size: 0.75em !important;
  }
  .tire-results-toolbar input[type="number"].tire-price-input {
    width: 50px !important;
    font-size: 0.9em !important;
    padding: 4px 3px !important;
  }

  /* Mobile grid actions: smaller controls */
  .grid-actions {
    gap: 4px !important;
  }
  .grid-actions .tl-buy-form .quantity {
    height: 28px !important;
  }
  .grid-actions .tl-buy-form .quantity a {
    width: 24px !important;
    font-size: 0.8em !important;
  }
  .grid-actions .tl-buy-form .quantity input[type="number"] {
    width: 28px !important;
    font-size: 0.8em !important;
  }
  .grid-actions .add-to-cart-button {
    height: 30px !important;
    width: 34px !important;
    margin-left: 4px !important;
  }
  .grid-wa-btn {
    width: 28px !important;
    height: 28px !important;
  }
  .grid-wa-btn img {
    width: 26px !important;
    height: 26px !important;
  }
}

/* Cart slide-in panel */
#ts-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#ts-cart-backdrop.ts-cp-visible {
  opacity: 1;
  pointer-events: auto;
}
#ts-cart-panel {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translate(100%, -50%);
  width: 340px;
  max-width: 92vw;
  background: #fff;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  z-index: 100001;
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
#ts-cart-panel.ts-cp-visible {
  transform: translate(0, -50%);
}
.ts-cp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.05em;
  color: #111;
}
.ts-cp-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.5em;
  color: #999;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.ts-cp-close:hover { color: #333; }
.ts-cp-product {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 8px;
}
.ts-cp-name {
  font-size: 0.92em;
  color: #222;
  line-height: 1.35;
}
.ts-cp-qty {
  font-size: 0.85em;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}
.ts-cp-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88em;
  color: #555;
  padding: 0 2px;
}
.ts-cp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.ts-cp-btn-primary {
  display: block;
  text-align: center;
  padding: 11px 16px;
  background: #007cba;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.ts-cp-btn-primary:hover { background: #005f8a; }
.ts-cp-btn-secondary {
  display: block;
  text-align: center;
  padding: 9px 16px;
  background: none;
  color: #555;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ts-cp-btn-secondary:hover { border-color: #999; color: #222; }

/* Error toast */
#ts-cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
}
.ts-error-toast {
  background: #dc3545;
  color: #fff;
  padding: 14px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.95em;
  animation: tsSlideUp 0.3s ease-out;
}
@keyframes tsSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Search form / banner styles ===== */

.tire-search-banner-wrapper {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background-image: url("/wp-content/uploads/tire-search-background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 20px;
  box-sizing: border-box;
  position: relative;
}

.tire-search-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px;
  background: #f5f8f7;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.tire-title {
  text-align: center;
  font-size: 1.8em;
  margin: 0px;
}

.tire-radios {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 5px;
  justify-content: center;
}

.tire-radios label {
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tire-search-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.tire-search-primary input,
.tire-search-primary select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95em;
}

.quantity-label {
  font-size: 0.9em;
  margin-left: 4px;
}

#quantity {
  font-size: 0.9em;
  padding: 5px;
}

.tire-search-actions {
  text-align: center;
  margin-top: 12px;
}

.hae-button {
  padding: 10px 20px;
  background-color: #111;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  width: 250px;
}

.tire-advanced-wrapper {
  margin-top: 12px;
  text-align: left;
  margin-left: 2px;
}

.tire-serach-advanced-toggle {
  font-size: 0.95em;
  color: #666;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.tire-search-advanced {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tire-search-advanced input,
.tire-search-advanced select {
  flex: 1 1 160px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95em;
}

.tire-serach-advanced-toggle:hover {
  color: #333;
}

.hidden {
  display: none;
}

.tire-image {
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.tire-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Spinner styles ===== */

.ts-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ts-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes ts-spin {
  to { transform: rotate(360deg); }
}


/* ================================================================== */
/*  CATEGORY TABS (rising behind search area)                         */
/* ================================================================== */

.ts-cat-tabs {
  display: flex;
  gap: 4px;
  padding: 0 4px;
  position: relative;
  z-index: 1;
  justify-content: center;
}

.ts-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px 12px;
  border: 1px solid #d1d5db;
  border-bottom: none;
  background: #e8eaed;
  color: #888;
  font-size: 0.88em;
  font-weight: 600;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
  white-space: nowrap;
}

.ts-cat-tab:hover:not(.active) {
  background: #f0f1f3;
  color: #555;
}

.ts-cat-tab.active {
  background: #fff;
  color: #111;
  border-color: #ccc;
  z-index: 2;
}

.ts-cat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ts-cat-tab:not(.active) .ts-cat-icon {
  opacity: 0.5;
}

/* Ensure search wrapper overlaps the tab bottom border */
.tire-search-banner-wrapper .tire-search-wrapper {
  position: relative;
  z-index: 2;
  border-top: 1px solid #ccc;
  margin-top: -1px;
}


/* ================================================================== */
/*  MOTORCYCLE SEARCH FORM                                            */
/* ================================================================== */

.mc-search-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.mc-pair-toggle-wrap {
  margin-bottom: 8px;
  margin-top: 8px;
}

.mc-pair-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9em;
  font-weight: 500;
  color: #444;
}

.mc-pair-toggle input { display: none; }

.mc-pair-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  transition: background 0.25s;
  flex-shrink: 0;
}

.mc-pair-toggle input:checked + .mc-pair-toggle-track {
  background: #2563eb;
}

.mc-pair-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s;
}

.mc-pair-toggle input:checked + .mc-pair-toggle-track .mc-pair-toggle-knob {
  transform: translateX(18px);
}

.mc-size-label {
  font-size: 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #e5e7eb;
}

.mc-rear-section {
  margin-top: 16px;
  padding-top: 12px;
}


/* ================================================================== */
/*  MOTORCYCLE RESULTS — SINGLE                                       */
/* ================================================================== */

.mc-results-header {
  margin-bottom: 16px;
}

.mc-tire-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.mc-tire-product .tire-product-grid,
.mc-product-grid {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.mc-tire-product .tire-product-grid:hover,
.mc-product-grid:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.mc-specs {
  display: flex;
  gap: 8px;
  font-size: 0.82em;
  color: #666;
  flex-wrap: wrap;
}

.mc-specs .mc-stock {
  color: #16a34a;
  font-weight: 600;
}

.mc-delivery-badge {
  background-color: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.8em;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.mc-delivery-badge::before {
  background: #2563eb;
}

.mc-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mc-buy-btn {
  flex: 1;
}


/* ================================================================== */
/*  MOTORCYCLE RESULTS — DELIVERY INFO BANNER                         */
/* ================================================================== */

.mc-delivery-info {
  background: linear-gradient(135deg, #f0f7ff, #e8f4f8);
  border: 1px solid #d1e5f4;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.mc-delivery-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
  min-width: 260px;
}

.mc-delivery-icon {
  font-size: 1.8em;
  flex-shrink: 0;
}

.mc-delivery-text strong {
  display: block;
  font-size: 1em;
  color: #1e3a5f;
  margin-bottom: 2px;
}

.mc-delivery-fees {
  font-size: 0.85em;
  color: #4a6fa5;
  margin: 0;
}

.mc-delivery-pickup {
  flex: 1;
  min-width: 240px;
}

.mc-delivery-pickup p {
  font-size: 0.82em;
  color: #555;
  margin: 0 0 8px;
  line-height: 1.4;
}

.mc-wa-pickup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.mc-wa-pickup-btn:hover {
  background: #1fba59;
  color: #fff;
}

.mc-wa-pickup-btn img {
  width: 20px;
  height: 20px;
}

.mc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mc-no-results {
  text-align: center;
  color: #888;
  font-size: 1.05em;
  padding: 40px 20px;
}


/* ================================================================== */
/*  MOTORCYCLE RESULTS — PAIR CARDS                                   */
/* ================================================================== */

/* ---- Pair results grid ---- */
.mc-pair-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

/* ---- Pair card ---- */
.mc-pair-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.mc-pair-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

/* Row 1: Header bar */
.mc-pair-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
}
.mc-pair-header-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.mc-pair-brand {
  font-size: 0.95em;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}
.mc-pair-model {
  font-size: 0.85em;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Row 2: Two tires side by side */
.mc-pair-tires {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #f0f0f0;
}
.mc-pair-side {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mc-pair-front {
  border-right: 1px solid #f0f0f0;
}
.mc-pair-label {
  font-size: 0.68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #999;
}
.mc-pair-image {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mc-pair-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.mc-pair-size {
  font-size: 0.85em;
  font-weight: 600;
  color: #333;
}
.mc-pair-price {
  font-size: 1em;
  font-weight: 700;
  color: #111;
}

/* Row 3: Action bar */
.mc-pair-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.mc-pair-pricing {
  min-width: 0;
}
.mc-pair-combined-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mc-pair-total-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  white-space: nowrap;
}
.mc-pair-total-amount {
  font-size: 1.25em;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
}
.mc-pair-delivery-total {
  font-size: 0.78em;
  color: #666;
  margin-top: 1px;
}
.mc-pair-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* Buy both button */
.mc-pair-buy-both-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.mc-pair-buy-both-btn:hover {
  background: #333;
}
.mc-pair-buy-both-btn .btn-cart-icon {
  width: 16px;
  height: 16px;
}
.mc-pair-buy-both-btn .ts-spinner {
  width: 16px;
  height: 16px;
}
.mc-pair-buy-both-btn.loading .btn-text { display: none; }
.mc-pair-buy-both-btn.loading .btn-cart-icon { display: none; }

/* WhatsApp link under buy button */
.mc-pair-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75em;
  color: #25d366;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}
.mc-pair-wa-link:hover {
  color: #1fba59;
}
.mc-pair-wa-link img {
  width: 14px;
  height: 14px;
}


/* ================================================================== */
/*  RESPONSIVE: MC                                                    */
/* ================================================================== */

@media (max-width: 768px) {
  .ts-category-toggle {
    max-width: 100%;
  }
  .ts-cat-btn {
    font-size: 0.82em;
    padding: 8px 12px;
  }

  .mc-pair-results {
    grid-template-columns: 1fr;
  }

  .mc-pair-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .mc-pair-pricing {
    text-align: center;
  }
  .mc-pair-combined-price {
    justify-content: center;
  }
  .mc-pair-delivery-total {
    text-align: center;
  }
  .mc-pair-buttons {
    align-items: center;
  }

  .mc-delivery-info {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .mc-tire-results {
    grid-template-columns: 1fr;
  }
}
