/* Автоцентър Скорост: общи стилове за сайта и админ панела.
   Цветовете идват от сервиза: асфалт, пътна маркировка, бетон, син цвят от регистрационен номер. */

:root {
  --asphalt: #22303a;
  --asphalt-2: #2c3d49;
  --concrete: #eceef0;
  --white: #ffffff;
  --ink: #141c22;
  --muted: #56646f;
  --line: #d3d9de;
  --yellow: #ffc400;
  --yellow-dark: #e6ae00;
  --blue: #1747a6;
  --red: #c62828;
  --green: #1c7c4f;
  --amber: #8f5600;
  --font: 'Sofia Sans', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Sofia Sans Condensed', 'Arial Narrow', 'Sofia Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--concrete);
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.05;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.top :focus-visible,
.hero :focus-visible,
.footer :focus-visible,
.side :focus-visible,
.dialog-head :focus-visible {
  outline-color: var(--yellow);
}

.wrap {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus {
  top: 1rem;
}

/* ---------- бутони ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid transparent;
  border-radius: 6px;
  font: 700 1rem/1.2 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.btn-yellow:hover {
  background: var(--yellow-dark);
}

.btn-dark {
  background: var(--asphalt);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--ink);
}

.btn-ghost {
  border-color: #8fa0ad;
  background: transparent;
  color: var(--white);
}

.btn-ghost:hover {
  border-color: var(--white);
}

.btn-light {
  border-color: #9aa7b1;
  background: var(--white);
  color: var(--ink);
}

.btn-light:hover {
  border-color: var(--ink);
}

.btn-big {
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  background: #d9dee2;
  border-color: transparent;
  color: var(--muted);
  cursor: not-allowed;
}

/* ---------- регистрационен номер (лого и свободни часове) ---------- */

.plate {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: 800 1.5rem/1 var(--font-head);
  letter-spacing: 0.06em;
  text-decoration: none;
}

.plate-eu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3em;
  width: 2.5em;
  padding: 0.45em 0 0.35em;
  background: var(--blue);
  color: var(--white);
  font: 700 0.42em/1 var(--font);
  letter-spacing: 0;
}

.plate-eu i {
  width: 1.15em;
  height: 1.15em;
  border: 2px dotted #ffd200;
  border-radius: 50%;
}

.plate-text {
  padding: 0.28em 0.5em 0.2em;
}

/* ---------- горна лента ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--asphalt);
  color: var(--white);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.nav a {
  padding: 0.4rem 0;
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-bottom-color: var(--yellow);
}

/* ---------- начало ---------- */

.hero {
  background: var(--asphalt);
  color: var(--white);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 3rem;
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.hero h1 {
  font-size: clamp(2.75rem, 7.2vw, 5.5rem);
  line-height: 0.95;
  text-wrap: balance;
}

.hero-lead {
  max-width: 34rem;
  margin: 1.25rem 0 1.75rem;
  color: #d5dde3;
  font-size: 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hazard {
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 16px, var(--ink) 16px 32px);
}

.board {
  padding: 1.5rem;
  border: 1px solid #435662;
  border-radius: 10px;
  background: var(--asphalt-2);
}

.board h2 {
  margin-bottom: 1.1rem;
  font-size: 1.6rem;
}

.board-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #d5dde3;
}

.slot-plate {
  flex: none;
  padding: 0;
  font-size: 1.6rem;
  cursor: pointer;
}

.slot-plate:hover .plate-text {
  background: var(--yellow);
}

.board-note {
  margin: 1.1rem 0 0;
  color: #aebac3;
  font-size: 0.95rem;
}

/* ---------- секции ---------- */

.section {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.section-alt {
  background: var(--white);
}

.section-head {
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.section-head p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: none;
}

.empty {
  margin: 0;
  padding: 1.5rem;
  border: 1.5px dashed #aab5bd;
  border-radius: 10px;
  color: var(--muted);
}

/* ---------- ценоразпис на услугите ---------- */

.price-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 6.5rem 6rem auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--line);
}

.price-row:first-child {
  border-top: 0;
}

.price-row h3 {
  font-size: 1.4rem;
}

.price-row p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.price-time {
  color: var(--muted);
  white-space: nowrap;
}

.price-value {
  font: 800 1.7rem/1 var(--font-head);
  text-align: right;
  white-space: nowrap;
}

/* ---------- автомобили ---------- */

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: 1.5rem;
}

.car-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--concrete);
}

.car-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: #dbe1e5;
}

.car-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-photo .art {
  width: 84%;
}

.car-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.car-body h3 {
  font-size: 1.65rem;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.specs li {
  padding: 0.1rem 0.55rem;
  border: 1px solid #b9c2c9;
  border-radius: 4px;
  background: var(--white);
}

.car-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.car-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.price {
  display: block;
  font: 800 1.9rem/1.1 var(--font-head);
  white-space: nowrap;
}

.stock {
  font-size: 0.92rem;
  font-weight: 500;
}

.stock-ok {
  color: var(--green);
}

.stock-low {
  color: var(--amber);
}

.stock-out {
  color: var(--red);
}

/* ---------- части ---------- */

.search {
  flex: 0 1 22rem;
}

.part-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(27rem, 100%), 1fr));
  gap: 1rem;
}

.part-row {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.part-photo {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 5rem;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #e4e8eb;
}

.part-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.part-photo .art {
  width: 78%;
}

.part-row h3 {
  font-size: 1.3rem;
}

.part-desc {
  margin: 0.15rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.part-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.part-buy {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.part-buy .price {
  font-size: 1.55rem;
}

/* ---------- долна част ---------- */

.footer {
  padding-block: 3rem;
  background: var(--asphalt);
  color: #d5dde3;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}

.footer h2 {
  margin-bottom: 0.6rem;
  color: var(--white);
  font-size: 1.5rem;
}

.footer p {
  margin: 0 0 0.6rem;
}

.footer a {
  color: var(--yellow);
}

.hours {
  border-collapse: collapse;
}

.hours th {
  padding: 0 1.25rem 0.15rem 0;
  font-weight: 400;
  text-align: left;
}

/* ---------- форми ---------- */

.field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.field label,
legend {
  font-size: 0.98rem;
  font-weight: 700;
}

.field small {
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #8d9aa5;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

input[type='checkbox'],
input[type='radio'] {
  width: 1.15rem;
  min-height: 0;
  height: 1.15rem;
  accent-color: var(--asphalt);
}

textarea {
  resize: vertical;
}

fieldset {
  min-width: 0;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.4rem;
  padding: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.form-error {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: #fdecea;
  color: var(--red);
  font-weight: 700;
}

.hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

/* ---------- прозорци ---------- */

.dialog {
  width: min(100% - 1.5rem, 34rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}

.dialog-wide {
  width: min(100% - 1.5rem, 42rem);
}

.dialog::backdrop {
  background: rgb(20 28 34 / 0.62);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.9rem 0.9rem 1.25rem;
  background: var(--asphalt);
  color: var(--white);
}

.dialog-head h2 {
  font-size: 1.6rem;
}

.dialog-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--asphalt-2);
}

.dialog-body {
  padding: 1.25rem;
}

.dialog-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.dialog-done {
  padding: 2rem 1.5rem;
  border-top: 14px solid var(--yellow);
}

.dialog-done h2 {
  font-size: 2rem;
}

.done-text {
  margin: 0.75rem 0 1.5rem;
}

.summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}

.total {
  font-weight: 700;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.5rem;
}

.slot {
  position: relative;
}

.slot input {
  position: absolute;
  opacity: 0;
}

.slot span {
  display: block;
  padding: 0.5rem 0;
  border: 1.5px solid #8d9aa5;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.slot input:checked + span {
  border-color: var(--ink);
  background: var(--yellow);
}

.slot input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.slot.is-busy span {
  border-style: dashed;
  border-color: #c3cbd1;
  background: #f1f3f5;
  color: #8d9aa5;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* ---------- малки екрани ---------- */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .top-row {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-block: 0.6rem;
  }

  .top-book {
    margin-left: auto;
  }

  .nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 0.75rem;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (max-width: 720px) {
  .price-row {
    grid-template-columns: auto auto 1fr;
    gap: 0.75rem 1rem;
  }

  .price-main {
    grid-column: 1 / -1;
  }

  .price-value {
    text-align: left;
  }

  .price-row .btn {
    justify-self: end;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .part-row {
    grid-template-columns: 4rem 1fr;
  }

  .part-photo {
    width: 4rem;
  }

  .part-buy {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
