/* BomWidgets — VehiclePicker */

/* === Custom properties (defaults) === */
*:has(> .bomwidgets-vehicles) {
  container-type: inline-size;
}

.bomwidgets-vehicles {
  --bwv-color: #3b82f6;
  --bwv-hover-border: #3b82f6;
  --bwv-highlight-bg: #eff6ff;
  --bwv-radius: 12px;
  display: grid;
  margin: 24px 0;
}

/* === Gap === */
.bomwidgets-vehicles--gap-small  { gap: 8px; }
.bomwidgets-vehicles--gap-medium { gap: 16px; }
.bomwidgets-vehicles--gap-large  { gap: 24px; }

/* === Column layouts (grid styles only) === */
.bomwidgets-vehicles[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.bomwidgets-vehicles[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.bomwidgets-vehicles[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }

/* === Card base === */
.bomwidgets-vehicles__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--bwv-radius);
  background: #fff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.bomwidgets-vehicles__card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--bwv-hover-border);
  text-decoration: none;
  color: inherit;
}

/* translateY only on grid variants (icons/images), not scroll/compact */
.bomwidgets-vehicles--icons .bomwidgets-vehicles__card:hover,
.bomwidgets-vehicles--images .bomwidgets-vehicles__card:hover {
  transform: translateY(-2px);
}

/* === Highlight === */
.bomwidgets-vehicles__card--highlight {
  background: var(--bwv-highlight-bg);
  border-color: var(--bwv-hover-border);
  box-shadow: 0 0 0 1px var(--bwv-hover-border);
}

/* === SVG fill via currentColor === */
.bomwidgets-vehicles .bomwidgets-vehicles__svg,
.bomwidgets-vehicles .bomwidgets-vehicles__svg path,
.bomwidgets-vehicles .bomwidgets-vehicles__svg use {
  fill: currentColor;
}

/* === Icons variant === */
.bomwidgets-vehicles--icons .bomwidgets-vehicles__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  color: var(--bwv-color);
}

.bomwidgets-vehicles--icons .bomwidgets-vehicles__svg {
  width: 48px;
  height: 48px;
}

/* Size: small */
.bomwidgets-vehicles--icons[data-size="small"] .bomwidgets-vehicles__icon { width: 48px; height: 48px; }
.bomwidgets-vehicles--icons[data-size="small"] .bomwidgets-vehicles__svg { width: 32px; height: 32px; }

/* Size: large */
.bomwidgets-vehicles--icons[data-size="large"] .bomwidgets-vehicles__icon { width: 80px; height: 80px; }
.bomwidgets-vehicles--icons[data-size="large"] .bomwidgets-vehicles__svg { width: 64px; height: 64px; }

/* === Images variant === */
.bomwidgets-vehicles--images .bomwidgets-vehicles__card {
  padding: 0;
  overflow: hidden;
}

.bomwidgets-vehicles--images .bomwidgets-vehicles__image-wrap {
  position: relative;
  width: 100%;
}

.bomwidgets-vehicles--images .bomwidgets-vehicles__image {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.bomwidgets-vehicles--images .bomwidgets-vehicles__label {
  padding: 12px;
}

/* Icon badge overlay on images */
.bomwidgets-vehicles__icon-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: var(--bwv-color);
}

.bomwidgets-vehicles__badge-svg {
  width: 22px !important;
  height: 22px !important;
}

/* === Compact variant === */
.bomwidgets-vehicles--compact {
  display: flex;
  flex-wrap: wrap;
}

.bomwidgets-vehicles--compact .bomwidgets-vehicles__card {
  flex-direction: row;
  padding: 8px 16px;
  gap: 8px;
  flex: 0 0 auto;
}

.bomwidgets-vehicles--compact .bomwidgets-vehicles__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--bwv-color);
  flex-shrink: 0;
}

.bomwidgets-vehicles--compact .bomwidgets-vehicles__svg {
  width: 22px;
  height: 22px;
}

.bomwidgets-vehicles--compact .bomwidgets-vehicles__label {
  white-space: nowrap;
}

/* Size modifiers for compact */
.bomwidgets-vehicles--compact[data-size="small"] .bomwidgets-vehicles__card { padding: 6px 12px; }
.bomwidgets-vehicles--compact[data-size="small"] .bomwidgets-vehicles__icon { width: 22px; height: 22px; }
.bomwidgets-vehicles--compact[data-size="small"] .bomwidgets-vehicles__svg { width: 16px; height: 16px; }
.bomwidgets-vehicles--compact[data-size="large"] .bomwidgets-vehicles__card { padding: 10px 20px; }
.bomwidgets-vehicles--compact[data-size="large"] .bomwidgets-vehicles__icon { width: 34px; height: 34px; }
.bomwidgets-vehicles--compact[data-size="large"] .bomwidgets-vehicles__svg { width: 28px; height: 28px; }

/* === Scroll variant === */
.bomwidgets-vehicles--scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.bomwidgets-vehicles--scroll::-webkit-scrollbar {
  height: 4px;
}
.bomwidgets-vehicles--scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}
.bomwidgets-vehicles--scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.bomwidgets-vehicles--scroll .bomwidgets-vehicles__card {
  flex: 0 0 auto;
  min-width: 140px;
  scroll-snap-align: start;
}

.bomwidgets-vehicles--scroll .bomwidgets-vehicles__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
  color: var(--bwv-color);
}

.bomwidgets-vehicles--scroll .bomwidgets-vehicles__svg {
  width: 40px;
  height: 40px;
}

/* Size modifiers for scroll */
.bomwidgets-vehicles--scroll[data-size="small"] .bomwidgets-vehicles__card { min-width: 110px; padding: 14px 10px; }
.bomwidgets-vehicles--scroll[data-size="small"] .bomwidgets-vehicles__icon { width: 40px; height: 40px; }
.bomwidgets-vehicles--scroll[data-size="small"] .bomwidgets-vehicles__svg { width: 28px; height: 28px; }
.bomwidgets-vehicles--scroll[data-size="large"] .bomwidgets-vehicles__card { min-width: 180px; padding: 24px 16px; }
.bomwidgets-vehicles--scroll[data-size="large"] .bomwidgets-vehicles__icon { width: 72px; height: 72px; }
.bomwidgets-vehicles--scroll[data-size="large"] .bomwidgets-vehicles__svg { width: 56px; height: 56px; }

/* === Dark theme === */
.bomwidgets-vehicles--dark .bomwidgets-vehicles__card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.bomwidgets-vehicles--dark .bomwidgets-vehicles__card:hover {
  background: #1e3a5f;
  border-color: var(--bwv-hover-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bomwidgets-vehicles--dark .bomwidgets-vehicles__card--highlight {
  background: #1e3a5f;
  border-color: var(--bwv-hover-border);
}

.bomwidgets-vehicles--dark .bomwidgets-vehicles__icon {
  color: #fff;
}

.bomwidgets-vehicles--dark .bomwidgets-vehicles__icon-badge {
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
}

.bomwidgets-vehicles--dark::-webkit-scrollbar-track {
  background: #334155;
}
.bomwidgets-vehicles--dark::-webkit-scrollbar-thumb {
  background: #64748b;
}

/* === Transparent theme (for dark sections) === */
.bomwidgets-vehicles--transparent .bomwidgets-vehicles__card {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.bomwidgets-vehicles--transparent .bomwidgets-vehicles__card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--bwv-hover-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bomwidgets-vehicles--transparent .bomwidgets-vehicles__card--highlight {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--bwv-hover-border);
  box-shadow: 0 0 0 1px var(--bwv-hover-border);
}

.bomwidgets-vehicles--transparent .bomwidgets-vehicles__icon {
  color: #fff;
}

.bomwidgets-vehicles--transparent .bomwidgets-vehicles__icon-badge {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.bomwidgets-vehicles--transparent::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}
.bomwidgets-vehicles--transparent::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

/* === Label === */
.bomwidgets-vehicles__label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.bomwidgets-vehicles[data-size="small"] .bomwidgets-vehicles__label { font-size: 12px; }
.bomwidgets-vehicles[data-size="large"] .bomwidgets-vehicles__label { font-size: 16px; }

/* === Alignment === */
.bomwidgets-vehicles--align-center { justify-content: center; }
.bomwidgets-vehicles--align-right  { justify-content: flex-end; }

/* === Responsive === */
@container (max-width: 768px) {
  .bomwidgets-vehicles[data-columns="3"],
  .bomwidgets-vehicles[data-columns="4"] {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container (max-width: 480px) {
  .bomwidgets-vehicles--icons,
  .bomwidgets-vehicles--images {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .bomwidgets-vehicles--icons .bomwidgets-vehicles__card {
    flex-direction: row;
    padding: 12px 16px;
    gap: 12px;
  }

  .bomwidgets-vehicles--icons .bomwidgets-vehicles__icon {
    margin-bottom: 0;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .bomwidgets-vehicles--icons .bomwidgets-vehicles__svg {
    width: 32px;
    height: 32px;
  }

  .bomwidgets-vehicles--icons .bomwidgets-vehicles__label {
    text-align: left;
  }

  .bomwidgets-vehicles--compact {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
