/* ==========================================================================
   František Jašurek – AUTOCENTRUM
   Statická prezentačná stránka (HTML + CSS + JS), náhrada za Joomla 3
   ========================================================================== */

/* ---------- Písmo (lokálne, bez Google Fonts) ---------- */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Premenné ---------- */
:root {
  --red: #eb4947;
  --red-dark: #d6211e;
  --red-hero: #ff2b26;
  --text: #555;
  --heading: #2b2b2b;
  --muted: #888;
  --light: #f5f5f5;
  --line: #e4e4e4;
  --white: #fff;
  --container: 1170px;
  --gutter: 20px;
  --header-h: 84px;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Základ ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--red-dark);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  color: var(--heading);
  line-height: 1.25;
}
h1 { font-weight: 800; }
h2 { font-weight: 600; }
h3 { font-weight: 400; }

p {
  margin: 0 0 1em;
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 12px;
  color: var(--white);
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

/* ---------- Tlačidlá ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.85);
}
.btn--ghost:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--heading);
}
.btn--outline {
  background: transparent;
  color: var(--red);
}
.btn--outline:hover {
  color: var(--white);
}

/* ---------- Horná lišta ---------- */
.topbar {
  background: var(--light);
  color: #999;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 28px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar .icon {
  color: #999;
}

/* ---------- Hlavička a navigácia ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.logo {
  display: block;
  width: 240px;
  max-width: 62vw;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  cursor: pointer;
}
.nav-toggle:hover {
  color: var(--red);
}
.nav-toggle .icon {
  width: 26px;
  height: 26px;
}
.nav-toggle .icon-close {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}
.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.main-nav > ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-nav li {
  position: relative;
}
.main-nav > ul > li > a,
.main-nav .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #252525;
  cursor: pointer;
  transition: color 0.2s ease;
}
.main-nav > ul > li > a:hover,
.main-nav .dropdown-toggle:hover,
.main-nav > ul > li > a[aria-current="page"],
.main-nav .has-dropdown.is-current > .dropdown-toggle {
  color: var(--red);
}
.dropdown-toggle .icon {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
}
.dropdown-toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-top: 2px solid var(--red);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.dropdown a {
  display: block;
  padding: 9px 20px;
  font-size: 14px;
  color: #252525;
}
.dropdown a:hover {
  background: var(--red);
  color: var(--white);
}
.dropdown a[aria-current="page"] {
  color: var(--red);
}
.dropdown a[aria-current="page"]:hover {
  color: var(--white);
}

@media (hover: hover) and (min-width: 992px) {
  .has-dropdown:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
.has-dropdown.is-open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobilné menu */
@media (max-width: 991px) {
  :root {
    --header-h: 70px;
  }
  .logo {
    width: 190px;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: var(--white);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--line);
    display: none;
  }
  .main-nav.is-open {
    display: block;
  }
  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 16px;
  }
  .main-nav > ul > li > a,
  .main-nav .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 14px var(--gutter);
    font-size: 14px;
    border-bottom: 1px solid var(--line);
  }
  .dropdown {
    position: static;
    width: auto;
    padding: 0;
    box-shadow: none;
    border-top: 0;
    background: var(--light);
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .has-dropdown.is-open > .dropdown {
    display: block;
  }
  .dropdown a {
    padding: 12px calc(var(--gutter) + 16px);
    border-bottom: 1px solid var(--line);
  }

  /* Bez JavaScriptu: menu je stále viditeľné pod logom */
  html:not(.js) .site-header .container {
    flex-wrap: wrap;
  }
  html:not(.js) .nav-toggle {
    display: none;
  }
  html:not(.js) .main-nav {
    display: block;
    position: static;
    flex-basis: 100%;
    box-shadow: none;
  }
  html:not(.js) .dropdown {
    display: block;
  }
}

/* ---------- Hero (úvod) ---------- */
.hero {
  position: relative;
  padding: 90px 0;
  text-align: center;
  color: #fafafa;
  background: #222 url("../images/car-repair-dark.jpg") center / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}
.hero .container {
  position: relative;
}
.hero h1 {
  margin: 0 0 10px;
  color: var(--red-hero);
  font-size: clamp(28px, 4.2vw, 42px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.hero p {
  margin: 0;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 700;
  color: var(--white);
}

/* ---------- Služby – karty na úvodnej stránke ---------- */
.features {
  padding: 70px 0 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}
.feature {
  padding: 20px 15px 30px;
  text-align: center;
}
.feature img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 18px;
  transition: transform 0.3s ease;
}
.feature:hover img {
  transform: translateY(-4px);
}
.feature h3 {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 24px;
}
.feature p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
}
.features-more {
  margin-top: 20px;
  text-align: center;
}

/* ---------- Výzva k akcii ---------- */
.cta {
  position: relative;
  padding: 100px 0;
  text-align: center;
  color: #f5f5f5;
  background: #222 url("../images/car-parts-dark.jpg") center / cover no-repeat;
}
@media (hover: hover) and (min-width: 992px) {
  .cta {
    background-attachment: fixed;
  }
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.cta .container {
  position: relative;
}
.cta h2 {
  margin-bottom: 10px;
  color: var(--white);
  font-size: clamp(28px, 3.6vw, 36px);
}
.cta p {
  margin: 0 0 30px;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 300;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.cta .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Podstránky ---------- */
.page {
  padding: 60px 0 80px;
}
.page-title {
  margin-bottom: 30px;
  font-size: clamp(28px, 3.5vw, 36px);
}

/* Služby */
.service {
  padding: 30px 0 50px;
}
.service + .service {
  border-top: 1px solid var(--line);
  padding-top: 60px;
}
.service-head {
  margin-bottom: 36px;
  text-align: center;
}
.service-head h2 {
  margin-bottom: 4px;
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 400;
}
.service-head p {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
}
.numbered {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: num;
}
.numbered li {
  display: flex;
  align-items: stretch;
  counter-increment: num;
}
.numbered li::before {
  content: counter(num, decimal-leading-zero);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 48px;
  background: var(--red);
  color: var(--white);
  font-size: 14px;
}
.numbered li span {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  line-height: 1.5;
}

/* Kontakt */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.contact-info {
  padding: 40px 0;
}
.contact-info h1 {
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 34px);
}
.contact-block {
  margin-bottom: 22px;
}
.contact-block h2 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
}
.contact-block p {
  margin: 0;
}
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-list .icon {
  color: var(--red);
}
.ids {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 12px;
  margin: 0;
}
.ids dt {
  font-weight: 700;
  color: var(--heading);
}
.ids dd {
  margin: 0;
}
.contact-photo {
  min-height: 420px;
  border-radius: var(--radius);
  background: #333 url("../images/car-repair-dark.jpg") 60% center / cover no-repeat;
  filter: grayscale(1);
}

.map {
  position: relative;
  margin-top: 0;
  background: var(--light);
}
.map iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}
.map-link {
  position: absolute;
  left: 16px;
  bottom: 24px;
  font-size: 14px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
}

/* Textové stránky (Informácie) */
.prose {
  max-width: 860px;
}
.prose h2 {
  margin: 1.8em 0 0.6em;
  font-size: 21px;
  font-weight: 700;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose p.sub {
  padding-left: 28px;
}
.prose p.sub2 {
  padding-left: 56px;
  margin-bottom: 0.6em;
}
.prose ul {
  padding-left: 22px;
}
.lead {
  font-size: 17px;
  color: var(--heading);
}
.prose .downloads,
.downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}
.downloads a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--heading);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.downloads a:hover {
  border-color: var(--red);
  box-shadow: var(--shadow);
}
.downloads .icon {
  width: 22px;
  height: 22px;
  color: var(--red);
}
.downloads small {
  display: block;
  color: var(--muted);
}

/* ---------- Pätička ---------- */
.site-footer {
  background: var(--light);
  padding: 80px 0 60px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.site-footer h2 {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 400;
}
.site-footer p {
  margin: 0 0 6px;
}
.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li {
  border-bottom: 1px solid var(--line);
}
.footer-links li:last-child {
  border-bottom: 0;
}
.footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: #222;
}
.footer-links a:hover {
  color: var(--red);
}
.footer-links .icon {
  width: 9px;
  height: 9px;
}
.hours {
  margin: 0;
}
.hours dt {
  font-weight: 600;
  color: var(--heading);
}
.hours dd {
  margin: 0 0 8px;
}

.copyright {
  padding: 20px 0;
  background: var(--red);
  color: var(--white);
  text-align: center;
  font-size: 14px;
}
.copyright p {
  margin: 0;
}

/* ---------- 404 ---------- */
.notfound {
  padding: 100px 0;
  text-align: center;
}
.notfound h1 {
  font-size: 72px;
  color: var(--red);
  margin-bottom: 0;
}

/* ---------- Animácie pri scrollovaní ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal="1"] {
  --delay: 0.12s;
}
[data-reveal="2"] {
  --delay: 0.24s;
}

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

/* ---------- Responzivita ---------- */
@media (max-width: 991px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .contact-photo {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
  .topbar .container {
    justify-content: center;
  }
  .hero {
    padding: 64px 0;
  }
  .features {
    padding: 40px 0 20px;
  }
  .features-grid,
  .footer-grid,
  .downloads {
    grid-template-columns: 1fr;
  }
  .features-grid {
    gap: 10px;
  }
  .cta {
    padding: 70px 0;
  }
  .page {
    padding: 40px 0 60px;
  }
  .site-footer {
    padding: 50px 0 40px;
  }
  .contact-photo {
    display: none;
  }
  .contact-info {
    padding-bottom: 20px;
  }
  .map iframe {
    height: 340px;
  }
  .map-link {
    position: static;
    display: flex;
    margin: 0;
    border-radius: 0;
  }
  .prose p.sub {
    padding-left: 14px;
  }
  .prose p.sub2 {
    padding-left: 28px;
  }
}

/* ---------- Tlač ---------- */
@media print {
  .topbar,
  .site-header,
  .site-footer,
  .copyright,
  .map,
  .cta,
  .skip-link {
    display: none !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  body {
    color: #000;
  }
}
