* {
  box-sizing: border-box;
}

:root {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --panel-bg: rgba(10, 10, 14, 0.68);
  --panel-border: rgba(255, 255, 255, 0.18);
  --accent: #f3c34f;
  --accent-hover: #ffd669;
  --button-text: #17120a;
  --background-image: url("../images/index-background.png");
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #101014;
  overflow-x: hidden;
}

.background-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.84)),
    var(--background-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.background-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(243, 195, 79, 0.18), transparent 34%),
    rgba(0, 0, 0, 0.12);
}

.home-page {
  width: 100%;
  min-height: 100vh;
  padding: 28px 16px;
  display: grid;
  grid-template-rows: minmax(38vh, 1fr) minmax(320px, 48vh);
  gap: 18px;
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 12vw, 112px);
  letter-spacing: 0.12em;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.hero p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 3vw, 22px);
  line-height: 1.45;
}

.news-panel,
.dealers-panel {
  width: min(960px, 100%);
  margin: 0 auto;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.news-panel {
  min-height: 0;
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h1,
.section-header h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 38px);
}

.section-header span {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.news-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  display: grid;
  gap: 14px;
}

.news-list::-webkit-scrollbar {
  width: 10px;
}

.news-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.news-list::-webkit-scrollbar-thumb {
  background: rgba(243, 195, 79, 0.65);
  border-radius: 999px;
}

.news-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.news-thumb {
  width: 112px;
  height: 82px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-placeholder {
  width: 112px;
  height: 82px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.news-date {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.news-content h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.25;
}

.news-content p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-line;
}

.dealer-button,
.back-button {
  position: fixed;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--button-text);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.dealer-button {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 150px;
}

.back-button {
  left: 18px;
  top: 18px;
}

.dealer-button:hover,
.back-button:hover {
  background: var(--accent-hover);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.86);
}

.image-modal img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: fixed;
  right: 18px;
  top: 16px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--button-text);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}
.modal-nav {
    position: fixed;
    z-index: 80;
    top: 50%;
    z-index: 80;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--button-text);
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.modal-prev {
    left: 22px;
    padding-left: 10px;
}

.modal-next {
    right: 22px;
    padding-right: 3px;
}

.modal-counter {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 80;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
}

.image-modal:not([hidden]) .modal-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 999px;
    background: #f3c34f;
    color: #17120a;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.modal-prev {
    left: 24px;
}

.modal-next {
    right: 24px;
}

.modal-counter {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
}

@media (max-width: 600px) {
    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 38px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}

.dealers-page {
  width: 100%;
  min-height: 100vh;
  padding: 88px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dealers-panel {
  max-width: 1020px;
  padding: 24px;
}

.table-wrap {
  overflow-x: auto;
}

.dealers-table {
    width: auto;
    min-width: 620px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.dealers-table th,
.dealers-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
  vertical-align: top;
}

.dealers-table th {
  color: var(--accent);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dealers-table td {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}

.dealers-table tr:last-child td {
  border-bottom: 0;
}

/* FONTOS JAVÍTÁS:
   Ez rejti el az induláskor még nem aktív kép-nagyító modalt. */
[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .home-page {
    grid-template-rows: minmax(30vh, 0.75fr) minmax(360px, 56vh);
    padding: 76px 12px 14px;
  }

  .dealer-button {
    top: 14px;
    right: 12px;
    transform: none;
    writing-mode: horizontal-tb;
    min-height: 44px;
    padding: 10px 14px;
  }

  .news-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .section-header {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .section-header span {
    text-align: left;
  }

  .news-item {
    grid-template-columns: 86px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .news-thumb,
  .news-placeholder {
    width: 86px;
    height: 72px;
  }

  .news-content h3 {
    font-size: 17px;
  }

  .news-content p {
    font-size: 14px;
  }

  .dealers-page {
    align-items: start;
    padding-top: 82px;
  }

  .dealers-panel {
    padding: 18px;
    border-radius: 22px;
  }
}

@media (max-width: 500px) {
  .dealers-table,
  .dealers-table thead,
  .dealers-table tbody,
  .dealers-table th,
  .dealers-table td,
  .dealers-table tr {
    display: block;
  }

  .dealers-table thead {
    display: none;
  }

  .dealers-table tr {
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
  }

  .dealers-table td {
    border: 0;
    padding: 5px 0;
  }

  .dealers-table td::before {
    display: block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .dealers-table td:nth-child(1)::before { content: "Irányítószám"; }
  .dealers-table td:nth-child(2)::before { content: "Bolt neve"; }
  .dealers-table td:nth-child(3)::before { content: "Pontos cím"; }
}
