/* =========================================================
   G Garage AutoDetailing — styles
   Design system: premium dark + action red (ui-ux-pro-max)
   Fonts: Unbounded (headings) + Manrope (body) — both Cyrillic
   ========================================================= */

:root {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --border: #262b33;
  --text: #f2f4f7;
  --muted: #a3acb9;
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-text: #f87171;
  --on-accent: #ffffff;
  --success: #22c55e;
  --error: #f87171;

  --font-head: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1120px;
  --header-h: 68px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 200ms;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.accent { color: var(--accent-text); }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 700 16px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: #3a414c; background: rgba(255,255,255,.07); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: #3a414c; }
.icon-btn-sm { width: 40px; height: 40px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(11, 13, 16, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  font: 700 18px/1 var(--font-head);
  color: var(--on-accent);
  background: var(--accent);
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}
.logo-text {
  display: flex; flex-direction: column;
  font: 700 15px/1.1 var(--font-head);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.logo-text small {
  font: 600 11px/1.2 var(--font-body);
  letter-spacing: .18em;
  color: var(--muted);
}

.main-nav { display: none; gap: 32px; }
.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 0;
  transition: color var(--dur) var(--ease);
}
.main-nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; }

@media (min-width: 860px) {
  .main-nav { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 72px;
}
.hex-bg {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='97' viewBox='0 0 112 97'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.5'%3E%3Cpath d='M28 2h28l14 24.25-14 24.25H28L14 26.25z'/%3E%3Cpath d='M84 50.5h28M70 26.25h14l14 24.25-14 24.25M56 50.5l14 24.25H84M28 50.5 14 74.75 28 97M0 26.25h14M0 74.75h14'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 112px 97px;
  opacity: .07;
  mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; right: -10%; top: -20%;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(220,38,38,.18), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: 48px; align-items: center;
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(34px, 7.5vw, 60px);
  letter-spacing: -.01em;
  margin-bottom: 20px;
  text-wrap: balance;
}
.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photos {
  position: relative;
  height: 300px;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
}
.hp {
  position: absolute;
  width: 190px; height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.hp-1 { left: 0; top: 0; transform: rotate(-4deg); }
.hp-2 { right: 0; top: 24px; transform: rotate(3deg); }
.hp-3 { left: 50%; bottom: 0; transform: translateX(-50%) rotate(-1deg); z-index: 2; }

@media (min-width: 900px) {
  .hero { padding: 96px 0 104px; }
  .hero-inner { grid-template-columns: 1.15fr 1fr; }
  .hero-photos { height: 380px; }
  .hp { width: 206px; height: 206px; }
}

/* ---------- Steps ---------- */
.steps {
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
}
.steps-list { display: grid; gap: 20px; }
.steps-list li { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,.4);
  color: var(--accent-text);
  font: 700 15px/1 var(--font-head);
}
.steps-list h3 { font-size: 17px; font-weight: 700; margin-bottom: 2px; font-family: var(--font-body); }
.steps-list p { color: var(--muted); font-size: 15px; }

@media (min-width: 760px) {
  .steps-list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { margin-bottom: 36px; }
.section-head h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 40px);
}
.section-sub { color: var(--muted); margin-top: 12px; max-width: 36em; }

@media (min-width: 900px) {
  .section { padding: 112px 0; }
}

/* ---------- Albums ---------- */
/* Снимките са малки (206px) — кориците са ограничени, за да не се размазват */
.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px 20px;
  max-width: 820px;
}
@media (min-width: 600px) { .albums { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.album {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
}
/* „Купчина“ снимки зад корицата — показва, че е албум */
.album::before, .album::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: transform 250ms var(--ease);
}
.album::before { transform: translate(8px, -8px); opacity: .55; }
.album::after  { transform: translate(4px, -4px); background: var(--surface); }
.album-cover {
  position: relative; z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.1);
  transition: transform 250ms var(--ease);
}
.album:hover .album-cover { transform: translate(-3px, 3px); }
.album:hover::before { transform: translate(12px, -12px); }
.album:hover::after  { transform: translate(6px, -6px); }

.album-count {
  position: absolute; z-index: 2;
  right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11,13,16,.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font: 700 14px/1 var(--font-body);
}
.album-count svg { width: 16px; height: 16px; }

/* ---------- Album viewer ---------- */
.viewer {
  width: 100%; max-width: 100%;
  height: 100%; max-height: 100%;
  margin: 0; padding: 0;
  border: 0;
  background: rgba(5,6,8,.96);
  color: var(--text);
  overscroll-behavior: contain;
}
.viewer[open] {
  display: flex; flex-direction: column;
  animation: viewerIn 200ms var(--ease);
}
.viewer::backdrop { background: rgba(0,0,0,.6); }
@keyframes viewerIn { from { opacity: 0; } to { opacity: 1; } }

.viewer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.viewer-counter { font-weight: 700; font-size: 15px; color: var(--muted); padding-left: 4px; }
.viewer-close { background: var(--surface); }

.viewer-stage {
  flex: 1; min-height: 0;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
  touch-action: pan-y;
  user-select: none;
}
.viewer-stage img {
  width: min(100%, 560px, 62vh);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity 150ms var(--ease);
}
.viewer-stage img.is-swapping { opacity: 0; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(20,23,28,.85);
  z-index: 1;
}
.viewer-nav svg { width: 24px; height: 24px; }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
.viewer-nav[hidden] { display: none; }
/* На телефон: смяна със свайп или от миниатюрите */
@media (max-width: 640px) {
  .viewer-nav { display: none; }
}

.viewer-thumbs {
  display: flex; justify-content: center; gap: 8px;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  overflow-x: auto;
}
.viewer-thumbs button {
  flex: none;
  width: 56px; height: 56px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: none;
  overflow: hidden;
  cursor: pointer;
  opacity: .5;
  transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.viewer-thumbs button:hover { opacity: .85; }
.viewer-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--accent-text); }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }
body.viewer-open { overflow: hidden; }

/* ---------- Services ---------- */
.services { display: grid; gap: 14px; }
@media (min-width: 760px) { .services { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (min-width: 1040px) { .services { grid-template-columns: repeat(3, 1fr); } }

.service {
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease);
}
.service:hover { border-color: #3a414c; }
.service h3 {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}
.service p { color: var(--muted); font-size: 15.5px; }
.service .price {
  font: 700 26px/1 var(--font-head);
  color: var(--text);
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.service .price span {
  font: 600 14px/1 var(--font-body);
  color: var(--muted);
  margin-right: 4px;
}
.service-featured { border-color: rgba(220,38,38,.55); background: linear-gradient(180deg, rgba(220,38,38,.08), var(--bg) 60%); }
.service-featured:hover { border-color: var(--accent); }
.badge {
  display: inline-block;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-accent) !important;
  background: var(--accent);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- Form + contacts ---------- */
.contact-grid { display: grid; gap: 32px; }
@media (min-width: 960px) {
  .contact-grid { grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 28px 20px;
}
@media (min-width: 600px) { .form-card { padding: 40px; } }
.form-card .section-head { margin-bottom: 28px; }

.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label, .field .label { font-weight: 600; font-size: 15px; }
.optional { color: var(--muted); font-weight: 500; }

.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font: 500 16px/1.4 var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: #6b7380; }
.field input:hover, .field textarea:hover { border-color: #3a414c; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px rgba(248,113,113,.18);
}
.field.has-error input { border-color: var(--error); }
.error { color: var(--error); font-size: 14px; min-height: 0; }
.error:empty { display: none; }

.file-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.upload {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border: 1.5px dashed #3a414c;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.upload[hidden] { display: none; }
.upload svg { width: 28px; height: 28px; color: var(--accent-text); }
.upload:hover, .upload.is-drag { border-color: var(--accent-text); background: rgba(248,113,113,.05); }
.file-input:focus-visible + .preview, .upload:has(+ .file-input:focus-visible) {
  outline: 2px solid var(--accent-text); outline-offset: 3px;
}
.upload-text { display: grid; gap: 2px; }
.upload-text strong { font-weight: 700; }
.upload-text small { color: var(--muted); font-size: 14px; }

.preview {
  display: flex; align-items: center; gap: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.preview[hidden] { display: none; }
.preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.preview-name { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-note { font-size: 13px; color: var(--muted); text-align: center; }

#submit-btn .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
#submit-btn.is-loading { pointer-events: none; opacity: .85; }
#submit-btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.contacts h2 {
  font-family: var(--font-head);
  font-size: 24px;
  margin-bottom: 20px;
}
.contact-list { display: grid; gap: 6px; }
.contact-list li {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: 0; }
.c-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-text);
}
.contact-list div { display: grid; gap: 2px; min-width: 0; }
.c-label { font-size: 13px; color: var(--muted); }
.contact-list a {
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  text-underline-offset: 3px;
}
.contact-list a:hover { text-decoration: underline; color: var(--accent-text); }
.contact-list div > span:not(.c-label) { font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { text-decoration: none; font-weight: 600; color: var(--text); }

/* ---------- Thank-you page ---------- */
.thanks {
  min-height: calc(100vh - var(--header-h));
  display: grid; place-items: center;
  text-align: center;
  padding: 48px 20px;
  position: relative;
  overflow: hidden;
}
.thanks-card { position: relative; z-index: 1; max-width: 480px; }
.thanks-icon {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: var(--success);
}
.thanks-icon svg { width: 34px; height: 34px; stroke-width: 2.5; }
.thanks h1 { font-family: var(--font-head); font-size: clamp(26px, 6vw, 36px); margin-bottom: 14px; }
.thanks p { color: var(--muted); margin-bottom: 28px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .reveal { opacity: 1; transform: none; }
}
