/* Carzoone Bloxy Compare Toggle - Styles */

#carzone-compare-toggle-wrap {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-start;
}

[dir="rtl"] #carzone-compare-toggle-wrap {
  justify-content: flex-end;
}

.carzone-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
}

[dir="rtl"] .carzone-toggle {
  flex-direction: row-reverse;
}

.carzone-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.carzone-toggle .toggle-slider {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background-color: #cbd5e1; /* slate-300 */
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.carzone-toggle .toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s ease;
}

.carzone-toggle input:checked + .toggle-slider {
  background-color: #2563eb; /* blue-600 */
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.carzone-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.carzone-toggle .toggle-text {
  font-weight: 600;
  color: #0f172a; /* slate-900 */
}

/* Slightly reduce size on very small screens */
@media (max-width: 480px) {
  .carzone-toggle {
    font-size: 0.9rem;
  }

  .carzone-toggle .toggle-slider {
    width: 42px;
    height: 24px;
  }

  .carzone-toggle .toggle-slider::before {
    width: 18px;
    height: 18px;
  }

  .carzone-toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
  }
}

.carzone-compare-button {
  display: flex;
  flex-direction: row; /* Text then box, aligned to the right */
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: auto;
  margin-top: 0.75rem;
  margin-left: auto; /* push button row to the right side of the card in LTR */
  padding: 4px 0 4px;
  border: 0;
  background-color: transparent;
  color: #2563eb;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
}

/* RTL: push the row to the right edge inside the card */
[dir="rtl"] .carzone-compare-button {
  margin-left: 0;
  margin-right: 0;
  margin-inline-start: auto;
  margin-inline-end: 0;
  justify-content: flex-start; /* text then box, but row starts from the right */
}

.carzone-compare-label {
  white-space: nowrap;
}

.carzone-compare-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #2563eb;
  background-color: #ffffff;
}

/* Active state: filled blue box with check mark */
.carzone-compare-active .carzone-compare-box {
  background-color: #2563eb;
  border-color: #2563eb;
  position: relative;
}

.carzone-compare-active .carzone-compare-box::after {
  content: "";
  position: absolute;
  inset: 3px 5px 4px 4px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

.carzone-compare-button:hover {
  color: #1d4ed8;
}

.carzone-compare-button:hover .carzone-compare-box {
  border-color: #1d4ed8;
}

/* Hide original Bloxy archive compare icon; we replace it with proxy button */
.woocommerce ul.products li.product .ct-compare-button-archive {
  display: none !important;
}

.woocommerce ul.products li.product {
  position: relative;
}
