/* ── Alloy Finder — Premium CSS ─────────────────────────────────────── */

#alloy-finder-app {
  font-family: inherit;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Breadcrumb */
.af-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.af-bc-item {
  color: #8b8fa8;
  font-size: 14px;
}

.af-bc-item--active {
  color: #4a5568;
}

.af-bc-item--current {
  color: #2d3748;
  font-weight: 600;
}

.af-bc-item[style*="cursor"] {
  text-decoration: underline;
}

.af-bc-sep {
  color: #cbd5e0;
  font-size: 16px;
}

/* Step title */
.af-step-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 24px;
}

/* Loading skeletons */
.af-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.af-skeleton {
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: afSkeleton 1.4s ease infinite;
}

@keyframes afSkeleton {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/* Error */
.af-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 15px;
}

/* ── Step 1: Brands ──────────────────────────────────────────────────── */

.af-letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.af-letter-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #4a5568;
  transition: all .15s;
}

.af-letter-btn:hover {
  background: #2d3748;
  color: #fff;
  border-color: #2d3748;
}

.af-letter-heading {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #a0aec0;
  letter-spacing: .08em;
  padding: 16px 0 4px;
}

.af-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.af-brand-card {
  padding: 12px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.af-brand-card:hover {
  border-color: #4299e1;
  background: #ebf8ff;
  color: #2b6cb0;
  box-shadow: 0 4px 12px rgba(66, 153, 225, .15);
  transform: translateY(-2px);
}

/* ── Step 2: Models ──────────────────────────────────────────────────── */

.af-model-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.af-model-item {
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  color: #2d3748;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}

.af-model-item:hover {
  border-color: #4299e1;
  background: #ebf8ff;
  padding-left: 26px;
}

/* ── Step 3: Types ───────────────────────────────────────────────────── */

.af-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 620px;
}

.af-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 15px;
  color: #2d3748;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}

.af-type-item:hover {
  border-color: #4299e1;
  background: #ebf8ff;
}

.af-type-name {
  font-weight: 500;
}

.af-type-year {
  font-size: 12px;
  color: #718096;
  background: #edf2f7;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Step 4: Specs card ──────────────────────────────────────────────── */

.af-specs-card {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #1a202c, #2d3748);
  color: #fff;
  padding: 20px 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  max-width: 480px;
}

.af-specs-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.af-specs-row span {
  font-size: 11px;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.af-specs-row strong {
  font-size: 20px;
  font-weight: 700;
}

.af-loading-premium {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 20px;
}

.af-tire-loader {
  width: 60px;
  height: 60px;
  border: 6px dashed #4299e1;
  border-radius: 50%;
  animation: afTireSpin 2s linear infinite;
}

.af-loading-text {
  font-size: 16px;
  color: #4a5568;
  font-weight: 500;
  animation: afPulseText 1.5s ease-in-out infinite;
}

@keyframes afTireSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes afPulseText {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* ── Step 5: Results ─────────────────────────────────────────────────── */

.af-results-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.af-specs-inline {
  font-size: 13px;
  color: #718096;
  background: #edf2f7;
  padding: 4px 12px;
  border-radius: 20px;
}

.af-alloy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.af-wheel-card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
}

.af-wheel-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  transform: translateY(-3px);
  border-color: #bee3f8;
}

.af-wheel-img-wrap {
  background: #f7fafc;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.af-wheel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.af-wheel-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.af-wheel-brand {
  font-size: 11px;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.af-wheel-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a202c;
}

.af-wheel-color {
  font-size: 12px;
  color: #4a5568;
}

.af-wheel-specs {
  font-size: 12px;
  color: #718096;
  margin-top: 4px;
}

.af-wheel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.af-wheel-price {
  display: flex;
  flex-direction: column;
}

.af-price {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
}

.af-price--b2b {
  color: #2b6cb0;
}

.af-price-note {
  font-size: 10px;
  color: #a0aec0;
}

.af-stock {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.af-stock--in {
  background: #c6f6d5;
  color: #276749;
}

.af-stock--out {
  background: #e2e8f0;
  color: #718096;
}

.af-wheel-add {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  align-items: stretch;
}

.af-qty {
  width: 100%;
  height: 42px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: #2d3748;
  outline: none;
  box-sizing: border-box;
}

.af-qty:focus {
  border-color: #4299e1;
}

.af-btn-cart {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff9b10, #ff8a00);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(255, 138, 0, 0.3);
}

.af-icon-cart {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.af-btn-cart:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.af-btn-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Empty state */
.af-empty {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.af-empty p {
  font-size: 16px;
  margin: 8px 0;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .af-alloy-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .af-brand-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

@media (max-width: 400px) {
  .af-alloy-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card zoom hint ──────────────────────────────────────────────────── */

.af-wheel-img-wrap {
  position: relative;
}

.af-card-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

.af-wheel-card:hover .af-card-zoom-hint {
  opacity: 1;
}

/* ── Wheel Detail Modal ───────────────────────────────────────────────── */

.af-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.af-modal-overlay--visible {
  opacity: 1;
}

.af-modal-overlay--visible .af-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.af-modal-box {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 860px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

.af-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  z-index: 2;
  transition: all 0.15s;
}

.af-modal-close:hover {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

.af-modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

.af-modal-img-side {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 20px 0 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 16px;
}

.af-modal-img-wrap {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.af-modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.12));
  transition: transform 0.3s ease;
}

.af-modal-img:hover {
  transform: scale(1.04);
}

.af-modal-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.af-modal-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

.af-modal-stock--in {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.af-modal-stock--out {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.af-modal-info-side {
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.af-modal-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3b82f6;
}

.af-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin: 0;
}

.af-modal-price-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.af-modal-price {
  font-size: 26px;
  font-weight: 800;
  color: #1e40af;
}

.af-modal-price-note {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.af-modal-specs {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.af-modal-specs-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.af-modal-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.af-modal-spec-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.af-modal-spec-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.af-modal-spec-value {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.af-modal-cart-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: end;
  margin-top: auto;
}

.af-modal-qty-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.af-modal-qty-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.af-modal-qty {
  width: 100%;
  height: 46px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.af-modal-qty:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.af-modal-btn-cart {
  height: 46px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff9b10, #ff8a00);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 4px 12px rgba(255, 138, 0, 0.35);
  letter-spacing: 0.01em;
}

.af-modal-btn-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 138, 0, 0.4);
}

.af-modal-btn-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive modal */
@media (max-width: 680px) {
  .af-modal-layout {
    grid-template-columns: 1fr;
  }

  .af-modal-img-side {
    border-radius: 20px 20px 0 0;
    padding: 24px;
    min-height: 220px;
  }

  .af-modal-img-wrap {
    max-width: 180px;
  }

  .af-modal-info-side {
    padding: 24px;
  }

  .af-modal-title {
    font-size: 18px;
  }

  .af-modal-price {
    font-size: 22px;
  }

  .af-modal-spec-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pagination: Load more */
.af-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  padding-bottom: 20px;
}

.af-load-more-btn {
  padding: 14px 32px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #2d3748;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.af-load-more-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.af-load-more-btn:active:not(:disabled) {
  transform: translateY(0);
}

.af-load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #f1f5f9;
}

.af-spinner-mini {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: afSpinMini 0.8s linear infinite;
}

@keyframes afSpinMini {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .af-load-more-btn {
    width: 100%;
    justify-content: center;
  }
}