/* AvtoMir production fixes. Does not restyle the site, only repairs layout, a11y and mobile. */

@media (max-width: 767px) {
  [data-cookie-bar],
  .fixed.inset-x-0.bottom-0.z-50 {
    padding: 8px !important;
    z-index: 40 !important;
  }
  [data-cookie-bar] > div,
  .fixed.inset-x-0.bottom-0.z-50 > div {
    padding: 12px 14px !important;
  }
  [data-cookie-bar] p,
  .fixed.inset-x-0.bottom-0.z-50 p {
    font-size: 13px !important;
    line-height: 1.35 !important;
    margin: 0 0 10px !important;
  }
  [data-cookie-bar] button,
  .fixed.inset-x-0.bottom-0.z-50 button {
    min-height: 40px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
  }
  [data-cookie-bar] .actions,
  .fixed.inset-x-0.bottom-0.z-50 .actions,
  .fixed.inset-x-0.bottom-0.z-50 .mt-4.flex {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px !important;
  }
  [data-hero-stage] {
    height: 110svh !important;
  }
  [data-hero-stage] .sticky {
    position: relative !important;
    height: 110svh !important;
  }
  body:has(.fixed.inset-x-0.bottom-0) .fixed.right-4.bottom-4 {
    bottom: 168px !important;
    z-index: 60 !important;
  }
}

.fixed.inset-x-0.bottom-0.z-50 {
  z-index: 40;
}
.fixed.right-4.bottom-4.z-30 {
  z-index: 60;
}
body:has([aria-expanded="true"]) .fixed.inset-x-0.bottom-0,
body:has(dialog[open]) .fixed.inset-x-0.bottom-0,
body:has(.is-modal-open) .fixed.inset-x-0.bottom-0 {
  display: none !important;
}

@media (max-width: 1023px) {
  aside.lg\:col-span-3,
  aside.lg\:col-span-3 > form,
  aside.lg\:col-span-3 > form > *,
  aside.lg\:col-span-3 .grid {
    min-width: 0;
    max-width: 100%;
  }
  aside.lg\:col-span-3 > form .grid.grid-cols-2,
  aside.lg\:col-span-3 .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  aside.lg\:col-span-3 input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

.text-muted {
  color: #c8cdd6 !important;
}

header a[href^="tel:"],
a[href="/catalog/"].btn,
a.btn {
  min-height: 44px;
}
label:has(input[name="consent"]) {
  min-height: 44px;
  align-items: center;
  cursor: pointer;
}
input[type="checkbox"][name="consent"] {
  width: 22px;
  height: 22px;
}
a[href="/privacy/"],
a[href="/consent/"],
a[href="/cookies/"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.av-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.av-search,
.av-sort {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1d24;
  color: #f4f5f7;
  padding: 0 12px;
  font: inherit;
}
.av-search {
  flex: 1 1 180px;
}
.av-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.av-page {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #1a1d24;
  color: #f4f5f7;
}
.av-page.is-active {
  background: #e31e24;
}
.lot-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2e36;
  min-height: 160px;
  width: 100%;
}
.lot-photo-fallback img {
  width: 120px;
  height: auto;
  opacity: 0.85;
}
.av-gallery {
  position: relative;
}
.av-gallery-main {
  width: 100%;
  display: block;
}
.av-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.72);
  color: white;
  cursor: pointer;
}
.av-gallery-nav.prev { left: 8px; }
.av-gallery-nav.next { right: 8px; }
.av-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 8px;
}
.av-thumbs button {
  border: 1px solid transparent;
  padding: 0;
  background: none;
  min-width: 64px;
  min-height: 44px;
  cursor: pointer;
}
.av-thumbs button.is-active { border-color: #e31e24; }
.av-thumbs img { width: 72px; height: 48px; object-fit: cover; display: block; }
.field-error { color: #ffb4b4; font-size: 13px; margin: 4px 0 0; }
input.is-invalid, textarea.is-invalid { outline: 2px solid #e31e24; }
.av-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.av-lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }

img[src$="/brand/used-rw-web.png"] {
  height: 32px;
  width: auto;
  max-width: 196px;
  display: block;
}

/* Ручные лоты: пометка «Продано» */
.av-sold{position:absolute;left:10px;top:10px;z-index:2;background:#e31e24;color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;padding:4px 10px;border-radius:999px;pointer-events:none}
.av-sold-inline{display:inline-block;vertical-align:middle;margin-left:12px;background:#e31e24;color:#fff;font-size:13px;font-weight:700;text-transform:uppercase;padding:4px 10px;border-radius:999px;letter-spacing:.02em}
