/* styles.css — Calm Industrial UI, mobile-first, RTL.
   No external CSS. All colors are calm; WhatsApp green is used ONLY
   for WhatsApp buttons. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef1f4;
  --ink: #16283c;
  --muted: #5b6b7d;
  --border: #d8dee6;
  --navy: #132a46;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --wa: #1faa55;
  --wa-dark: #15803d;
  --danger: #b3261e;
  --warning-bg: #fff7e0;
  --warning-ink: #7a5b00;
  --radius: 12px;
  --container: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 1rem;
}

body.modal-open { overflow: hidden; }

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

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

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

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

.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;
  top: -100px;
  inset-inline-start: 1rem;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  background: var(--surface-muted);
  color: var(--ink);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { min-height: 44px; padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--navy); }
.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-whatsapp:hover { background: var(--wa-dark); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  color: #fff;
  font-size: 1.4rem;
  border-radius: 10px;
}
.brand-name { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.brand-sub { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.3; }
.header-actions { display: flex; gap: 0.5rem; }

/* ---------- Hero ---------- */
.hero {
  background: var(--navy);
  color: #fff;
  padding-block: 2rem 2.2rem;
}
.hero-title { margin: 0 0 0.5rem; font-size: 1.5rem; line-height: 1.5; }
.hero-desc { margin: 0 0 1.4rem; color: #d5dde7; }
.sector-label { margin: 0 0 0.6rem; font-weight: 700; }
.chips-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  min-height: 44px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid #ffffff55;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
}
.chip-active { background: #fff; color: var(--navy); border-color: #fff; }

/* ---------- Catalog ---------- */
.catalog-section { padding-block: 1.5rem 2.5rem; }
.toolbar { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1rem; }
.search-box .input { width: 100%; }
.catalog-section .chips-row .chip {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}
.catalog-section .chips-row .chip-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.results-status { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.panels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-img-wrap { background: var(--surface-muted); }
.panel-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.panel-category {
  margin: 0.8rem 1rem 0;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
}
.panel-name { margin: 0.2rem 1rem 0; font-size: 1.15rem; line-height: 1.5; }
.panel-desc { margin: 0.3rem 1rem 1rem; color: var(--muted); flex: 1; }
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}
.panel-actions .btn { flex: 1 1 auto; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #d5dde7;
  padding-block: 2rem;
}
.footer-inner { display: flex; flex-direction: column; gap: 1.2rem; }
.footer-title { margin: 0 0 0.5rem; font-size: 1.15rem; color: #fff; }
.footer-line { margin: 0.2rem 0; }
.footer-line a { color: #fff; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field-label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.input {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
}
textarea.input { min-height: 88px; resize: vertical; }
.field-hint { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--muted); }
.field-error { margin: 0.5rem 0; color: var(--danger); font-weight: 600; }
.form-warning {
  margin: 0.8rem 0;
  padding: 0.7rem 0.9rem;
  background: var(--warning-bg);
  color: var(--warning-ink);
  border-radius: 10px;
  font-weight: 600;
}
.form-intro { margin-top: 0; color: var(--muted); }
.char-counter {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: end;
}
.char-counter-full { color: var(--danger); font-weight: 700; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}
.radio-row input { width: 20px; height: 20px; accent-color: var(--navy); }
.nameplate-preview {
  max-width: 100%;
  max-height: 220px;
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 40, 0.6);
  z-index: 100;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal-dialog {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  margin-block: auto;
  padding: 1.2rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.modal-title { margin: 0; font-size: 1.2rem; line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.modal-actions .btn { flex: 1 1 auto; }

/* ---------- Details view ---------- */
.gallery-main { margin-bottom: 0.6rem; }
.gallery-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  background: var(--surface-muted);
}
.gallery-zoomed .gallery-img { cursor: zoom-out; object-fit: contain; max-height: 70vh; }
.gallery-caption { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.95rem; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.gallery-thumb {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
  min-height: 44px;
}
.gallery-thumb-active { border-color: var(--navy); }
.gallery-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.details-desc { margin: 0 0 1rem; }
.spec-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.spec-table th, .spec-table td {
  text-align: start;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table th { background: var(--surface-muted); }
.details-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.details-actions .btn { flex: 1 1 auto; }

/* ---------- Cart ---------- */
.cart-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.8rem;
  background: var(--surface);
}
.cart-item-name { margin: 0; font-weight: 700; }
.cart-item-summary { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.cart-item-actions { display: flex; gap: 0.5rem; }
.cart-empty { color: var(--muted); }
.sent-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #eef7f5;
}
.sent-text { margin: 0 0 0.8rem; font-weight: 600; }
.limit-notice-text { margin: 0; font-size: 1.05rem; }

/* ---------- QR ---------- */
.qr-box { text-align: center; }
.qr-intro { margin-top: 0; color: var(--muted); }
.qr-src-row { justify-content: center; margin-bottom: 1rem; }
.qr-src-row .chip { border-color: var(--border); background: var(--surface); color: var(--ink); }
.qr-src-row .chip-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.qr-holder {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}
.qr-svg { width: min(280px, 80vw); height: auto; border: 1px solid var(--border); border-radius: 10px; }
.qr-url { direction: ltr; font-size: 0.85rem; color: var(--muted); word-break: break-all; }

@media print {
  body * { visibility: hidden; }
  .qr-box, .qr-box * { visibility: visible; }
  .qr-box { position: absolute; inset: 0; }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .hero-title { font-size: 1.8rem; }
  .panels-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: row; align-items: center; }
  .search-box { flex: 1; }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .cart-item { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .panels-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { font-size: 2rem; }
}

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