/* ============================================================
   ERGÖK — application layer
   Extends css/styles.css (design system / tokens).
   Rule: NO selector defined here may also exist in styles.css,
   so the two files can never fight over the cascade.
   ============================================================ */

/* ---------- Page shell: keeps the footer at the bottom on short pages ---------- */
body {
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.15rem;
  background: var(--accent-ink);
  color: var(--btn-on-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Layout helpers ---------- */
.narrow { max-width: 780px; }
.muted { color: var(--muted); }

.prose {
  max-width: 72ch;
  line-height: 1.8;
  color: var(--text);
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15rem; }
.prose h2 { margin: 2.25rem 0 0.85rem; }
.prose h3 {
  margin: 1.75rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.prose ul,
.prose ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a {
  color: var(--accent-dark);
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 174, 239, 0.35);
}
.prose a:hover { border-bottom-color: var(--accent); }
html[data-theme="dark"] .prose a { color: var(--accent); }
.prose strong { color: var(--text); }

/* ---------- Alerts / flash messages ---------- */
.alert {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--accent);
  border-left-width: 3px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.alert.is-error {
  border-color: #d92d20;
  background: #fef3f2;
  color: #7a271a;
}

html[data-theme="dark"] .alert.is-error {
  border-color: #f97066;
  background: #2d1513;
  color: #fda29b;
}

.alert-flash { margin-top: 1.75rem; }

/* ---------- Empty states ---------- */
.empty-state {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.empty-state svg {
  width: 2.25rem;
  height: 2.25rem;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.4;
  opacity: 0.8;
}

.empty-state strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.empty-state p { margin: 0; max-width: 46ch; line-height: 1.65; }

/* ---------- Forms (shared field skin) ---------- */
.stack-form { display: grid; gap: 1.05rem; }

.stack-form > label,
.field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.stack-form select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 55%, calc(100% - 0.75rem) 55%;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

.stack-form textarea { min-height: 8rem; resize: vertical; }

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.16);
}

.stack-form input:user-invalid,
.stack-form textarea:user-invalid {
  border-color: #d92d20;
}

.stack-form input[type="file"] {
  padding: 0.6rem 0.7rem;
  cursor: pointer;
}

.stack-form .check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.93rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  line-height: 1.55;
  cursor: pointer;
}

.stack-form .check input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.stack-form .check a { color: var(--accent-dark); font-weight: 600; }
html[data-theme="dark"] .stack-form .check a { color: var(--accent); }

/* `.contact-form span` in styles.css also matches this asterisk, so the
   required marker needs the extra class to keep its colour. */
.stack-form .req { color: #d92d20; }
html[data-theme="dark"] .stack-form .req { color: #f97066; }

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

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.55;
}

/* ---------- Quote wizard ---------- */
.quote-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 1.85rem 1.75rem 2rem;
}

.quote-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0 0 1.85rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.step-btn {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.step-btn .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.step-btn .step-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.35;
}

.step-btn:hover .step-num { border-color: var(--accent-ink); color: var(--accent-ink); }

.step-btn.is-active { color: var(--text); }
.step-btn.is-active .step-num {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--btn-on-accent);
}

.step-btn.is-done .step-num {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.quote-step {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.05rem;
}

.quote-step[hidden] { display: none !important; }

.quote-step > legend {
  padding: 0;
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.radio-group {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 1.1rem 1.15rem;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.radio-group > legend {
  padding: 0 0.4rem;
  margin-left: -0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact-info-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-info-list li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.contact-info-list svg {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.3rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-info-list .label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.1rem;
}

.map-open {
  display: inline-block;
  margin: 0.9rem 1.3rem 1.2rem;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-open:hover { color: var(--accent); }
html[data-theme="dark"] .map-open { color: var(--accent); }

/* ---------- References ---------- */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
}

.ref-grid .ref-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.ref-grid .ref-card:hover {
  border-color: rgba(0, 174, 239, 0.4);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.ref-card img {
  flex: 0 0 auto;
  width: 72px;
  height: 48px;
  object-fit: contain;
}

.ref-card .ref-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
}

html[data-theme="dark"] .ref-card .ref-mark { color: var(--accent); }

.ref-card strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.ref-card span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ---------- Catalog ---------- */
.catalog-box { display: grid; gap: 1.5rem; }

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

.catalog-frame-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.catalog-frame {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
}

/* ---------- Footer ---------- */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem 2rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-col-title {
  margin: 0 0 1rem;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}

.footer-brand-col { max-width: 34ch; }
.footer-brand { margin-bottom: 1.1rem; }

.footer-contact {
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.footer-contact a { color: var(--footer-text); }
.footer-contact a:hover { color: var(--accent); }

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
}
.footer-social a {
  color: var(--footer-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.footer-social a:hover { color: var(--accent); }

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.footer-links,
.footer-legal {
  display: grid;
  gap: 0.6rem;
}

.footer-legal a {
  color: var(--footer-text);
  font-size: 0.85rem;
  transition: color 0.2s var(--ease);
}

.footer-legal a:hover { color: var(--accent); }

.footer-newsletter { margin-top: 1.6rem; }

.footer-news-title {
  margin: 0 0 0.6rem;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}

.footer-news-row { display: flex; gap: 0.5rem; max-width: 340px; }

.footer-news-row input {
  flex: 1;
  min-width: 0;
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
}

.footer-news-row input::placeholder { color: rgba(255, 255, 255, 0.45); }

.footer-news-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.2);
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
}

.footer-note p { margin: 0; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top: 3px solid var(--accent);
  padding: 1.15rem 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
}

/* `hidden` must always win over the layout display below */
.cookie-banner[hidden],
.cookie-manage[hidden] { display: none !important; }

.cookie-banner-inner,
.cookie-manage {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
}

.cookie-banner-inner {
  display: flex;
  gap: 1.25rem 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.cookie-banner-inner strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cookie-banner-inner p {
  margin: 0;
  max-width: 68ch;
  font-size: 0.88rem;
  line-height: 1.6;
}

.cookie-banner-inner p a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0, 174, 239, 0.4);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-banner .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.cookie-banner .btn-outline:hover,
.cookie-banner .btn-outline:focus-visible {
  background: #fff;
  color: #101820;
  border-color: #fff;
}

.cookie-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cookie-manage label {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.88rem;
  cursor: pointer;
}

.cookie-manage input { accent-color: var(--accent); cursor: pointer; }

/* ---------- Responsive — single breakpoint system shared with styles.css ---------- */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand-col { grid-column: 1 / -1; max-width: none; }
  .quote-steps { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.75rem; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .quote-shell { padding: 1.35rem 1.15rem 1.5rem; }
  .quote-steps { grid-template-columns: 1fr 1fr; }
  .step-btn .step-name { font-size: 0.68rem; }
  .cookie-banner-inner,
  .cookie-manage { width: min(var(--container), calc(100% - 2rem)); }
  .cookie-actions .btn { flex: 1 1 auto; }
  .catalog-frame { height: 65vh; }
  .footer-note { justify-content: flex-start; }
}

/* ---------- Hamburger → X ---------- */
.nav-toggle span:nth-child(2) { opacity: 1; transition: opacity 0.2s var(--ease); }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Product detail extras ---------- */
.product-detail-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.specs-title {
  margin: 1.85rem 0 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

html[data-theme="dark"] .specs-title { color: var(--accent); }

/* The consent/checkbox rows must not inherit the card form's micro-label style. */
.stack-form .check span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

/* ---------- Notice panel (404, quote success) ---------- */
.notice-panel {
  max-width: 640px;
  margin-inline: auto;
  padding: 3.25rem 2rem 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.notice-panel h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.notice-code {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
}

.notice-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .notice-icon svg { stroke: var(--accent); }

.notice-text {
  margin: 0.95rem auto 0;
  max-width: 48ch;
  color: var(--muted);
  line-height: 1.7;
}

.notice-ref {
  margin: 1.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.notice-ref strong {
  margin-left: 0.5rem;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
}

html[data-theme="dark"] .notice-ref strong { color: var(--accent); }

.notice-panel .section-actions { justify-content: center; }

@media (max-width: 640px) {
  .notice-panel { padding: 2.25rem 1.25rem 2rem; }
}

/* ---------- Mobile-only quote CTA inside the nav panel ---------- */
/* The header's quote button is hidden below 980px, so the mobile menu
   carries the primary call to action instead of dropping it entirely. */
.nav-quote { display: none; }

@media (max-width: 980px) {
  /* `.nav a` sets a muted colour, so the button state has to be restated
     at equal-or-higher specificity or the CTA reads as a plain link. */
  .nav a.nav-quote {
    display: flex;
    margin: 0.85rem 1.5rem 0.35rem;
    border-bottom: 0;
    color: var(--btn-on-accent);
  }

  .nav a.nav-quote:hover,
  .nav a.nav-quote:focus-visible {
    color: var(--btn-on-accent);
    background: var(--accent-dark);
    border-color: var(--accent-dark);
  }
}
