/* WC VIN Decoder — Frontend Styles */

/* ---------------------------------------------------------------
   Font Awesome Icons
--------------------------------------------------------------- */
.wc-vin-modal-close {
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.wc-vin-garage-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.wc-vin-garage-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  margin-left: 6px;
  transition: transform 0.2s;
}

.wc-vin-garage-toggle:hover .wc-vin-garage-arrow {
  transform: rotate(180deg);
}

.wc-vin-garage-loading {
  text-align: center;
  color: #999;
  padding: 12px;
}

.wc-vin-garage-loading i {
  margin-right: 6px;
  color: #0073aa;
}

.wc-vin-picker-step .wc-vin-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #999;
}

.wc-vin-picker-step .wc-vin-loading i {
  margin-right: 8px;
  color: #0073aa;
}

.wc-vin-link i {
  margin-right: 6px;
}

.wc-vin-btn i {
  margin-right: 6px;
}

/* Spinner animation */
.fa-spin {
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------
   VIN Form
--------------------------------------------------------------- */
.wc-vin-form-wrap {
  max-width: 560px;
  margin: 0 auto;
  font-family: inherit;
}

.wc-vin-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}

.wc-vin-input-row {
  display: flex;
  gap: 8px;
}

.wc-vin-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 0.2s;
}

.wc-vin-input:focus {
  border-color: #0073aa;
  outline: none;
}
.wc-vin-input.valid {
  border-color: #46b450;
}
.wc-vin-input.error {
  border-color: #dc3232;
}

.wc-vin-result {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f0fff4;
  border-left: 4px solid #46b450;
  border-radius: 4px;
}

.wc-vin-error {
  color: #dc3232;
  font-size: 13px;
  margin-top: 6px;
}
.wc-vin-spinner {
  color: #666;
  font-style: italic;
  margin-top: 10px;
}

/* ---------------------------------------------------------------
   Buttons
--------------------------------------------------------------- */
.wc-vin-btn {
  padding: 10px 18px;
  border-radius: 4px;
  border: 2px solid #0073aa;
  background: transparent;
  color: #0073aa;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.wc-vin-btn:hover {
  background: #f0f8ff;
}

.wc-vin-btn-primary {
  background: #0073aa;
  color: #fff;
}

.wc-vin-btn-primary:hover {
  background: #005d8c;
}

.wc-vin-btn-secondary {
  background: #f8f9fa;
  border-color: #666;
  color: #333;
}

/* ---------------------------------------------------------------
   Modal
--------------------------------------------------------------- */
.wc-vin-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wc-vin-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.wc-vin-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.wc-vin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.wc-vin-modal-title {
  margin: 0;
  font-size: 18px;
}

.wc-vin-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
  line-height: 1;
}

.wc-vin-modal-close:hover {
  color: #333;
}

.wc-vin-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.wc-vin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* Tabs */
.wc-vin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 0;
}

.wc-vin-tab {
  flex: 1;
  padding: 14px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #999;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.wc-vin-tab:hover {
  color: #0073aa;
}

.wc-vin-tab.active {
  color: #0073aa;
  border-bottom-color: #0073aa;
}

/* Item List */
.wc-vin-picker-step {
  padding: 20px 0;
  margin-top: 12px;
  margin-bottom: 12px;
}

.wc-vin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  column-gap: 24px;
}

.wc-vin-list li {
  margin: 0;
  padding: 0;
}

.wc-vin-list-item {
  display: block;
  padding: 8px 0;
  color: #0073aa;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.wc-vin-list-item:hover {
  text-decoration: underline;
}

.wc-vin-loading {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* ---------------------------------------------------------------
   Garage Dropdown
--------------------------------------------------------------- */
.wc-vin-garage-wrap {
  position: relative;
  display: inline-block;
}

.wc-vin-garage-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px !important;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.wc-vin-garage-toggle:hover {
  background: #f5f5f5;
}

.wc-vin-garage-dropdown {
  position: absolute;
  right: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
}

/* Position dropdown based on data-position attribute */
.wc-vin-garage-dropdown[data-position="below"] {
  top: calc(100% + 4px);
}

.wc-vin-garage-dropdown[data-position="above"] {
  bottom: calc(100% + 4px);
}

.wc-vin-garage-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 260px;
  overflow-y: auto;
}

.wc-vin-garage-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
  cursor: pointer;
}
.wc-vin-garage-empty{
  padding: 8px 14px;
}
.wc-vin-garage-item:hover {
  background: #f8f9fa;
}
.wc-vin-garage-item.active {
  background: #e8f4fb;
}

.wc-vin-garage-vehicle-name {
  flex: 1;
  font-size: 13px;
  cursor: pointer;
}

.wc-vin-garage-vehicle-name:hover {
  color: #0073aa;
  text-decoration: underline;
}

.wc-vin-garage-select,
.wc-vin-garage-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px !important;
  border-radius: 3px;
  font-size: 14px;
  opacity: 0.5;
}

.wc-vin-garage-select:hover {
  opacity: 1;
  color: var(--success);
}
.wc-vin-garage-delete:hover {
  opacity: 1;
  color: var(--error);
}

.wc-vin-garage-actions {
  border-top: 1px solid #eee;
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wc-vin-garage-actions .wc-vin-link {
  display: block;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.wc-vin-garage-actions .wc-vin-link:hover {
  text-decoration: underline;
}
.wc-vin-add-vehicle-btn{
  color: var(--primary);
}
.wc-vin-add-vehicle-btn:hover{
  text-decoration: underline;
  cursor: pointer;
}

/* ---------------------------------------------------------------
   Utility
--------------------------------------------------------------- */
.wc-vin-link {
  color: #0073aa;
  text-decoration: none;
}
.wc-vin-link:hover {
  text-decoration: underline;
}

body.wc-vin-modal-open {
  overflow: hidden;
}

/* ---------------------------------------------------------------
   Responsive / Mobile
--------------------------------------------------------------- */
@media (max-width: 768px) {
  .wc-vin-modal-box {
    max-width: calc(100% - 24px);
    max-height: 85vh;
  }

  .wc-vin-list {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 16px;
  }

  .wc-vin-list-item {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .wc-vin-modal-box {
    max-width: calc(100% - 16px);
    max-height: 90vh;
  }

  .wc-vin-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    column-gap: 16px;
  }

  .wc-vin-modal-body {
    padding: 16px;
  }

  .wc-vin-modal-header {
    padding: 14px 16px;
  }

  .wc-vin-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
  }

  .wc-vin-btn {
    width: 100%;
  }

  .wc-vin-tab {
    font-size: 12px;
    padding: 10px 8px;
  }

  .wc-vin-picker-step {
    padding: 16px 0;
    margin-top: 8px;
    margin-bottom: 8px;
  }
}

/* ---------------------------------------------------------------
   Vehicle Category Filter  [revparts_vehicle_category_filter]
--------------------------------------------------------------- */

.wc-vin-cat-filter {
  /* No outer padding — let the Elementor column/widget control spacing */
}

.wc-vin-cat-filter__list,
.wc-vin-cat-filter__children {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wc-vin-cat-filter__item {
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Parent link */
.wc-vin-cat-filter__item > .wc-vin-cat-filter__link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: font-weight 0.1s;
}

.wc-vin-cat-filter__item > .wc-vin-cat-filter__link:hover,
.wc-vin-cat-filter__item.is-active > .wc-vin-cat-filter__link {
  font-weight: 700;
}

/* Child list */
.wc-vin-cat-filter__children {
  margin-top: 6px;
  padding-left: 16px;
}

.wc-vin-cat-filter__child {
  margin-bottom: 6px;
  line-height: 1.4;
}

.wc-vin-cat-filter__child > .wc-vin-cat-filter__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.wc-vin-cat-filter__child > .wc-vin-cat-filter__link:hover,
.wc-vin-cat-filter__child.is-active > .wc-vin-cat-filter__link {
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Unified Search Bar
   Shortcode: [revparts_unified_search]
--------------------------------------------------------------- */
.wc-unified-search {
  width: 100%;
}

.wc-unified-search__form {
  width: 100%;
}

.wc-unified-search__input-wrap {
  display: flex;
  align-items: stretch;
  position: relative;
  width: 100%;
}


.wc-unified-search__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #111;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 16px;
}

.wc-unified-search__input::placeholder {
  color: #9ca3af;
}
.wc-unified-search__btn-wrap{
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.wc-unified-search__btn {
  padding: 10px 14px !important;
  gap: 6px;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
    display: flex;
    align-items: center;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.wc-unified-search__btn:hover {
  background: var(--primary-dark);
}

.wc-unified-search__btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.wc-unified-search__hint {
  margin-top: 6px;
  font-size: 13px;
  color: #0073aa;
}

.wc-unified-search__error {
  margin-top: 6px;
  font-size: 13px;
  color: #dc2626;
}

.wc-unified-search__loading {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}

/* ---------------------------------------------------------------
   Fitment Filter Toggle
--------------------------------------------------------------- */
/* ── Fitment Toggle Switch ─────────────────────────────── */
.wc-vin-fitment-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

/* The <label> that wraps the checkbox + track */
.wc-vin-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.wc-vin-toggle-disabled {
  cursor: not-allowed;
}

/* Hide native checkbox */
.wc-vin-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Track (the pill background) */
.wc-vin-toggle-track {
  position: absolute;
  display: inline-flex;
  align-items: center;

  inset: 0;
  border:1px solid #dde6f0;
  background:white;
  border-radius: 3px;
  transition: background 0.22s ease;
}

.wc-vin-toggle-input:checked + .wc-vin-toggle-track {
  background: var(--primary);
}

.wc-vin-toggle-disabled .wc-vin-toggle-track {
  opacity: 0.4;
}

/* Thumb (the white circle) */
.wc-vin-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.22s ease;
}

.wc-vin-toggle-input:checked + .wc-vin-toggle-track .wc-vin-toggle-thumb {
  transform: translateX(24px);
}

/* Label text area */
.wc-vin-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wc-vin-toggle-text {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.wc-vin-toggle-vehicle {
  font-size: 12px;
  font-weight: 400;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
}

.wc-vin-toggle-notice {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

/* Loading: fade track while page navigates */
.wc-vin-fitment-toggle-wrap.wc-vin-toggle-loading .wc-vin-toggle-track {
  opacity: 0.5;
  pointer-events: none;
}

/* =========================================================
   FITMENT CHECKER RESULT
   ========================================================= */

.wc-vin-fitment-result {
  font-family: inherit;
}

/* Initial prompt state (matches the Elementor form trigger visually) */
.wc-vin-fitment-result__prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
}

/* Loading / error states */
.wc-vin-fitment-result__loading,
.wc-vin-fitment-result__error {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 12px 0;
  color: #6b7280;
}
.wc-vin-fitment-result__error {
  color: #dc2626;
}

/* Result card */
.wc-vin-fitment-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.4;
}

.wc-vin-fitment-card--compatible {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.wc-vin-fitment-card--incompatible {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.wc-vin-fitment-card__icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.wc-vin-fitment-card--compatible .wc-vin-fitment-card__icon {
  color: #16a34a;
}

.wc-vin-fitment-card--incompatible .wc-vin-fitment-card__icon {
  color: #dc2626;
}

.wc-vin-fitment-card__body {
  flex: 1;
  min-width: 0;
}

.wc-vin-fitment-card__vehicle {
  font-weight: 600;
  margin-bottom: 2px;
}

.wc-vin-fitment-card__message {
  font-size: 13px;
  opacity: 0.85;
}

.wc-vin-fitment-card__change {
  align-self: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: underline;
  opacity: 0.75;
  color: inherit;
}

.wc-vin-fitment-card__change:hover {
  opacity: 1;
}
