/* ═══════════════════════════════════════════════════
 *  WC Vehicle Options – Frontend Styles
 * ═══════════════════════════════════════════════════ */

/* Force proportional figures inside every WCVO surface — overrides any
   tabular-nums setting inherited from the theme, parent classes, or
   other plugins. Customer-facing numbers (prices, fees, km) follow the
   font's natural design instead of being forced into monospace widths. */
[class^="wcvo-"],
[class*=" wcvo-"] {
  font-variant-numeric: normal !important;
}

.wcvo-options-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .wcvo-options-wrap {
    grid-template-columns: 1fr;
  }
}

/* ── Card ── */
.wcvo-option-card {
  background: #f3f3f3;
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-sizing: border-box;
}

/* ── Card header ── */
.wcvo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.wcvo-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wcvo-card-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
}

/* ── Tooltip icon ── */
.wcvo-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.wcvo-tooltip-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #999;
  cursor: help;
  flex-shrink: 0;
  line-height: 1;
  font-style: normal;
  transition: border-color 0.15s, color 0.15s;
}

.wcvo-tooltip-icon:hover {
  border-color: #888;
  color: #666;
}

.wcvo-tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  min-width: 200px;
  max-width: 340px;
  /* Sit above page chrome (sticky headers, oversized product titles, etc.). */
  z-index: 9999;
  pointer-events: none;
}

.wcvo-tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
}

.wcvo-tooltip-wrap:hover .wcvo-tooltip-text {
  display: block;
}

/* ── Fee badge ── */
.wcvo-card-fee {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  line-height: 1.2;
  padding-top: 2px;
}

.wcvo-card-fee .wcvo-fee-value {
  font-weight: 700;
}

.wcvo-card-fee small {
  font-size: 14px;
  font-weight: 400;
  color: #888;
}

/* ── Description text ── */
.wcvo-card-description {
  font-size: 15px;
  color: #555;
  margin: 0 0 16px;
  line-height: 1.55;
}

/* ── Radio list ── */
.wcvo-radio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcvo-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 0;
  font-size: 15px;
  color: #333;
  transition: color 0.15s;
}

.wcvo-radio-label:hover {
  color: #111;
}

.wcvo-radio-label input[type="radio"] {
  display: none;
}

.wcvo-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.wcvo-radio-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.wcvo-radio-label input[type="radio"]:checked ~ .wcvo-radio-dot {
  border-color: #2563eb;
}

.wcvo-radio-label input[type="radio"]:checked ~ .wcvo-radio-dot::after {
  background: #2563eb;
}

/* ── Slider (modern-ui style) ── */
.wcvo-slider-description {
  font-size: 15px;
  color: #555;
  margin: 0 0 16px;
  line-height: 1.55;
}

.wcvo-slider-display {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.wcvo-slider-wrap {
  padding-bottom: 4px;
}

/*
 * High-specificity selectors + !important to override
 * any WooCommerce / WordPress theme input[type="range"] rules.
 */
.wcvo-option-card .wcvo-slider-wrap input[type="range"].wcvo-slider,
input[type="range"].wcvo-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  height: 14px !important;
  border-radius: 999px !important;
  background: #e0e0e0;
  outline: none !important;
  cursor: pointer !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  transition: background 0.1s !important;
}

/* Webkit (Chrome, Safari, Edge) */
.wcvo-option-card .wcvo-slider-wrap input[type="range"].wcvo-slider::-webkit-slider-runnable-track,
input[type="range"].wcvo-slider::-webkit-slider-runnable-track {
  height: 14px !important;
  border-radius: 999px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.wcvo-option-card .wcvo-slider-wrap input[type="range"].wcvo-slider::-webkit-slider-thumb,
input[type="range"].wcvo-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 3px solid #E30614 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer !important;
  margin-top: -6px !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
}

input[type="range"].wcvo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

input[type="range"].wcvo-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

/* Firefox */
.wcvo-option-card .wcvo-slider-wrap input[type="range"].wcvo-slider::-moz-range-thumb,
input[type="range"].wcvo-slider::-moz-range-thumb {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 3px solid #E30614 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer !important;
}

input[type="range"].wcvo-slider::-moz-range-track {
  height: 14px !important;
  border-radius: 999px !important;
  background: transparent !important;
  border: none !important;
}

input[type="range"].wcvo-slider::-moz-range-progress {
  height: 14px !important;
  border-radius: 999px !important;
  background: #E30614 !important;
}

.wcvo-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 14px;
  color: #999;
}

.wcvo-slider-labels span {
  cursor: pointer;
  transition: color 0.15s, font-weight 0.15s;
  user-select: none;
}

.wcvo-slider-labels span:hover {
  color: #333;
}

.wcvo-slider-labels span.active {
  color: #1a1a1a;
  font-weight: 600;
}

/* ── Suffix in price ── */
.wcvo-suffix {
  font-size: 14px;
  color: #888;
  font-weight: 400;
}

/* ── Summary spans (inline, theme-controlled) ── */
.wcvo-summary {
  display: inline;
}

/* ═══════════════════════════════════════════════════
 *  Checkout summary card ([wcvo_checkout_summary])
 * ═══════════════════════════════════════════════════ */
.wcvo-checkout-summary {
  background: #f3f3f3;
  border-radius: 16px;
  padding: 32px 36px;
  margin: 24px 0;
  box-sizing: border-box;
}

.wcvo-checkout-summary__title {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.wcvo-checkout-summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
  row-gap: 20px;
}

@media (max-width: 600px) {
  .wcvo-checkout-summary {
    padding: 24px 20px;
  }
  .wcvo-checkout-summary__title {
    font-size: 24px;
  }
  .wcvo-checkout-summary__grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 16px;
  }
}

.wcvo-checkout-summary__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wcvo-checkout-summary__label {
  font-weight: 600;
  font-size: 15px;
  color: inherit;
}

.wcvo-checkout-summary__value {
  font-size: 16px;
  color: inherit;
  word-break: break-word;
}

.wcvo-checkout-summary__value .woocommerce-Price-amount {
  font-size: inherit;
  color: inherit;
}

/* Translated suffix on monthly fees (e.g. "/kuu") sits flush against the price. */
.wcvo-checkout-summary__value .wcvo-summary__suffix,
.wcvo-summary__suffix {
  margin-left: 0;
}

.wcvo-checkout-summary__image {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════
 *  Vehicle meta ([wcvo_vehicle_meta])
 * ═══════════════════════════════════════════════════ */
.wcvo-vehicle-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.4;
}

/* Shared bubble shape for both status and category — rectangle with
   slight rounding. Inline-flex so they sit on the same baseline as the
   surrounding text. */
.wcvo-vehicle-meta__status,
.wcvo-vehicle-meta__category {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.wcvo-vehicle-meta__status--instock {
  background: #d1fae5;
  color: #065f46;
}

.wcvo-vehicle-meta__status--outofstock {
  background: #fee2e2;
  color: #991b1b;
}

.wcvo-vehicle-meta__status--onbackorder {
  background: #fef3c7;
  color: #92400e;
}

.wcvo-vehicle-meta__status--reserved {
  background: #fed7aa;
  color: #9a3412;
}

.wcvo-vehicle-meta__category {
  background: #f3f4f6;
  color: #374151;
}

.wcvo-vehicle-meta__category a {
  color: inherit;
  text-decoration: none;
}

.wcvo-vehicle-meta__category a:hover {
  color: #E30614;
}

/* ═══════════════════════════════════════════════════
 *  Connection-fee zero-state hint
 * ═══════════════════════════════════════════════════
 *  When the body has `wcvo-connection-fee-zero` (set by PHP on
 *  cart/checkout/order pages and toggled live by JS on product pages),
 *  any element the theme marks with `.lepingutasu` turns red.
 *  Use this to draw the customer's attention to the waiver.        */
body.wcvo-connection-fee-zero .lepingutasu,
body.wcvo-connection-fee-zero .lepingutasu * {
  color: red;
}
