/* ============================================
   MOBILE CAR CARD STYLES
   Стили для карточек автомобилей (мобильная версия)
   ============================================ */

/* === Car Card Container === */
.car-card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast);
}

.car-card--sold {
  border: 2px solid var(--color-primary-light);
}

.car-card--sold .car-slider {
  opacity: 0.6;
}

/* === Badge Section === */
.car-badges {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.car-badge {
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary-text);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-2xl);
  width: var(--card-badge-width);
  height: var(--card-badge-height);
}

/* === Car Title === */
.car-title-section {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 1px;
}

.car-engine-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.car-title {
  font-family: var(--font-family);
  font-style: normal;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-2xl);
  color: var(--color-text);
  text-transform: uppercase;
}

/* === Car Spec Text === */
.car-spec-text {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-tertiary);
}

/* === Specifications Grid === */
.car-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: var(--spacing-lg);
  gap: var(--spacing-md) 18px;
}

.car-spec-item {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  line-height: var(--line-height-tight);
}

/* === Publication Date === */
.car-date {
  font-family: var(--font-family);
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: right;
  margin-bottom: 1px;
}

/* === Separator Line === */
.car-separator {
  height: 1px;
  width: 100%;
  background: var(--color-border-gray);
  margin-bottom: 14px;
}

[data-theme="dark"] .car-separator,
html.dark .car-separator {
  background: var(--color-border-gray);
}

/* === Price Section === */
.car-location {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-secondary);
  margin-bottom: 0.5px;
}

/* === Header Section (Results + Sort) === */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
  margin-top: calc(var(--spacing-sm) * 2);
  margin-bottom: calc(var(--spacing-sm) * 2);
}

.results-count {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: var(--font-size-base);
  color: var(--color-text);
  line-height: 1;
}

/* === Sort Button === */
.sort-dropdown-wrapper {
  position: relative;
}

.sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 165px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 10px;
  background-color: #DEDEDE;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.sort-button:hover {
  border-color: rgba(0, 0, 0, 0.1);
}

.sort-button:active {
  transform: scale(0.98);
}

.sort-button-text {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: var(--font-size-base);
  color: white;
  line-height: 1;
}

.sort-button-left {
  flex: 1;
  text-align: left;
  display: flex;
  align-items: center;
}

.sort-button-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.sort-dropdown-arrow {
  position: static;
  right: auto;
  top: auto;
  transform: none;
  width: 7px;
  height: 12px;
  color: inherit;
  opacity: 1;
}

.sort-dropdown-menu {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 20px -5px rgba(0,0,0,0.12);
  z-index: 100;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sort-dropdown-wrapper.is-open {
}

.sort-dropdown-wrapper.is-open .sort-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sort-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 400;
  color: #334155;
}

.sort-option:hover {
  background: #f8fafc;
}

.sort-option.is-selected {
  background: #fffbeb;
  color: #0f172a;
  box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.05);
}

.sort-option-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.sort-option.is-selected .sort-option-check {
  border-color: #EAB308;
  background: #EAB308;
  box-shadow: inset 0 0 0 2.5px #fff;
}

.sort-icon {
  height: var(--filter-icon-size);
  width: auto;
}

[data-theme="dark"] .sort-button,
html.dark .sort-button {
  border-color: rgba(255, 255, 255, 0.08);
  background-color: #283341;
}

html.dark .sort-button:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .sort-button-text,
html.dark .sort-button-text {
  color: white;
}

html.dark .sort-dropdown-menu {
  background: #283341;
  box-shadow: 0 8px 24px -5px rgba(0,0,0,0.3);
}

html.dark .sort-option {
  color: #7f91a4;
}

html.dark .sort-option:hover {
  background: rgba(255,255,255,0.05);
}

html.dark .sort-option.is-selected {
  background: #16202A;
  color: #fff;
}

html.dark .sort-option-check {
  border-color: #4a5568;
}

html.dark .sort-option.is-selected .sort-option-check {
  border-color: #EAB308;
  background: #EAB308;
  box-shadow: inset 0 0 0 2.5px #283341;
}

/* === Dark Mode Adjustments === */
[data-theme="dark"] .car-title,
html.dark .car-title {
  color: var(--color-text);
}

/* Engine Icons for Dark Mode */
.engine-icon-dark {
  display: none;
}

[data-theme="dark"] .engine-icon-light,
html.dark .engine-icon-light {
  display: none;
}

[data-theme="dark"] .engine-icon-dark,
html.dark .engine-icon-dark {
  display: block;
}

/* ============================================
   MOBILE CARD LIST (mc-*)
   ============================================ */

.mc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 16px;
}

.mc-card {
    display: block;
    position: relative;
    padding: 16px 16px 10px;
    border-top: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.5);
}
.mc-card:first-child { border-top: 1px solid #e5e7eb; }
html.dark .mc-card {
    border-top-color: rgba(255,255,255,.08);
    background: #242F3D;
}

.mc-head { padding: 0; margin-bottom: 12px; }
.mc-head-text { flex: 1; min-width: 0; }
.mc-title-row { display: flex; align-items: center; gap: 5px; margin-bottom: 0; }
.mc-title-row .mc-fuel { width: 18px; height: 18px; }
.mc-fuel { width: 16px; height: 16px; flex-shrink: 0; }
.mc-title {
    font-family: var(--font-family);
    font-weight: 400; font-size: 18px !important;
    color: #0f172a; line-height: 1.3;
}
html.dark .mc-title { color: #f1f5f9; }

.mc-spec-name {
    font-family: var(--font-family);
    font-size: 13px !important; font-weight: 400;
    color: #6b7280; margin-top: 2px; margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
html.dark .mc-spec-name { color: #94a3b8; }

.mc-badge {
    font-family: var(--font-family);
    font-size: 9px !important; font-weight: 700;
    text-transform: uppercase; padding: 2px 6px;
    border-radius: 4px; margin-left: auto; flex-shrink: 0; color: #fff;
}
.mc-badge--green { background: #22c55e; }
.mc-badge--red   { background: #ef4444; }

.mc-price-row { display: flex; align-items: baseline; gap: 8px; }
.mc-price {
    font-family: var(--font-family);
    font-size: 24px !important; font-weight: 700;
    color: #0f172a; line-height: 1.2;
}
html.dark .mc-price { color: #fff; }

.mc-price-note {
    font-family: var(--font-family);
    font-size: 12px !important; font-weight: 400; color: #94a3b8;
}

.mc-photos {
    display: flex; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: none;
    margin-left: -16px; margin-right: -16px;
    padding-left: 16px; padding-right: 16px;
    scrollbar-width: none;
}
.mc-photos::-webkit-scrollbar { display: none; }
.mc-photos--sold { opacity: .55; }

.mc-sold-bar {
    display: flex; align-items: center; justify-content: center;
    padding: 4px 10px; margin-top: 12px;
    font-family: var(--font-family);
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: #B22234; background: #fff;
    border-radius: 12px; width: fit-content;
}
html.dark .mc-sold-bar { color: #fff; background: #B22234; border: none; border-radius: 6px; }

.mc-spec-name--sold { opacity: 0.5; }
.mc-card--sold .mc-fuel { opacity: 0.5; }
.mc-card--sold .mc-title { opacity: 0.5; }
html.dark .mc-card--sold { background: rgba(49,52,62,0.5); }

.mc-photo {
    flex: 0 0 70%; aspect-ratio: 4/3;
    object-fit: cover; border-radius: 0;
    background: #f1f5f9; width: 70%; height: auto; min-height: 0;
}
.mc-photo:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.mc-photo:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
html.dark .mc-photo { background: #1e293b; }

.mc-photo--lazy { background: #e2e8f0; }
html.dark .mc-photo--lazy { background: #1e293b; }

.mc-photo-empty {
    flex: 0 0 100%; aspect-ratio: 4/3;
    display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; border-radius: 8px;
}
html.dark .mc-photo-empty { background: #1e293b; }

.mc-foot { padding: 6px 0 0; }
.mc-foot--sold { opacity: 0.5; }
.mc-foot-inner { display: flex; align-items: flex-start; }
.mc-specs-wrap { flex: 1; min-width: 0; }
.mc-specs-line {
    font-family: var(--font-family);
    font-size: 15px !important; font-weight: 400;
    color: #fff; line-height: 1.45 !important;
    flex: 1; min-width: 0;
}
.mc-specs-param { white-space: nowrap; }
.mc-specs-comma { white-space: nowrap; }
.mc-specs {
    font-family: var(--font-family);
    font-size: 13px !important; font-weight: 400;
    color: #3A3A3A; line-height: 1.4 !important;
    display: flex; flex-wrap: wrap;
}
.mc-specs-line2 { margin-top: 1px; }
.mc-specs-item { white-space: nowrap; }
.mc-specs-dot { white-space: nowrap; }
html.dark .mc-specs { color: #94a3b8; }

.mc-date-row { text-align: right; padding: 8px 0 0; font-size: 12px; line-height: 1.2; }
.mc-date {
    font-family: var(--font-family);
    font-size: 12px !important; font-weight: 400;
    color: #94a3b8; white-space: nowrap; line-height: 1.2;
}
