/* QVisit - стили электронной визитки. Сначала телефон; на компьютере визитка по центру. Только логические свойства (иврит справа налево). */
:root {
  --brand: #0f6b5c;
  --on-brand: #ffffff;
  --card: #ffffff;
  --text: #1a2230;
  --muted: #566170;
  --bg: #ffffff;
  --page: #eef1f0;
  --soft: #f5f7f6;
  --border: #e1e6e4;
  --wa: #0d7337;
  --focus: #1a5fd0;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.55; color: var(--text); background: var(--page); overflow-wrap: anywhere; }
img { max-width: 100%; display: block; }
h1, h2 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.3em; height: 1.3em; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: .95rem; }

.demo-bar { margin: 0; padding: .45em 16px; background: #fff4d6; color: #5c4300; font-size: .875rem; text-align: center; }
.wrap { max-width: 480px; margin-inline: auto; background: var(--bg); min-height: 100vh; }
@media (min-width: 560px) {
  .wrap { margin-block: 24px; min-height: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.08); }
}

/* языки */
.langs { display: flex; justify-content: flex-end; gap: 4px; padding: 10px 12px 0; position: relative; z-index: 2; }
.langs a { color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; padding: .35em .7em; border-radius: 999px; background: rgba(0,0,0,.18); min-height: 32px; display: inline-flex; align-items: center; }
.langs a[aria-current] { background: var(--card); color: var(--text); }
.info + .foot, .info { }
main.info ~ * .langs a, .wrap:has(.info) .langs a { color: var(--brand); background: var(--soft); }
.wrap:has(.info) .langs a[aria-current] { background: var(--brand); color: var(--on-brand); }

/* шапка */
.hero { position: relative; margin-top: -42px; text-align: center; }
.cover { height: 150px; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(0,0,0,.12)), var(--brand); }
[data-theme] .cover { background: var(--cover); }
.hero-in { position: relative; padding: 0 20px 6px; margin-top: -70px; }
.avatar { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; margin-inline: auto; border: 5px solid var(--bg); background: var(--soft); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.avatar-letter { display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: var(--on-brand); background: var(--brand); }
.logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--card); padding: 6px; border: 1px solid var(--border);
  position: absolute; top: 82px; inset-inline-end: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.hero h1 { font-size: 1.6rem; margin-top: 12px; }
.biz { font-weight: 600; color: var(--brand); margin: .2em 0 0; }
.tagline { color: var(--muted); margin: .35em auto 0; max-width: 34ch; }
.license { color: var(--muted); font-size: .875rem; margin: .4em 0 0; }

/* главные кнопки */
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 18px 12px 6px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-height: 76px; padding: 12px 4px 10px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--soft); color: var(--text); font: inherit; font-size: clamp(.7rem, 3vw, .8rem); font-weight: 600; overflow-wrap: normal; word-break: normal; hyphens: manual;
  line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.act .icon { width: 1.6em; height: 1.6em; color: var(--brand); }
.act-save { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.act-save .icon { color: var(--on-brand); }
.act:hover { filter: brightness(.97); }

.promo { display: flex; gap: 10px; align-items: flex-start; margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--card)); }
.promo .icon { color: var(--brand); margin-top: .1em; }

/* блоки */
.block { padding: 18px 16px 4px; }
.block h2 { font-size: 1.15rem; margin-bottom: .6em; }
.social { list-style: none; margin: 0 0 12px; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.social a { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: var(--soft); color: var(--brand); }
.social a:hover { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.social .icon { width: 1.5em; height: 1.5em; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.links a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 600; }
.links a .icon { color: var(--brand); }
.links a span { flex: 1; }
.links .go { color: var(--muted) !important; transform: rotate(-90deg); width: 1.1em; height: 1.1em; }
[dir="rtl"] .links .go { transform: rotate(90deg); }
.addr, .hours { display: flex; gap: 10px; align-items: flex-start; }
.addr .icon, .hours .icon { color: var(--brand); margin-top: .15em; }
.maps { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .55em 1.1em; border-radius: 999px;
  border: 2px solid var(--brand); background: var(--card); color: var(--brand); font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.maps .btn { flex: 1 1 140px; }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery.n1 { grid-template-columns: 1fr; }
.gallery.n2, .gallery.n4 { grid-template-columns: repeat(2, 1fr); }
.gallery.n3 li:first-child, .gallery.n6 li:first-child { grid-column: span 2; grid-row: span 2; }
.gallery.n5 li:first-child { grid-column: span 2; }
.gallery.n1 .ph img, .gallery.n5 li:first-child .ph img { aspect-ratio: 4 / 3; }
.gallery.n5 li:first-child .ph img { aspect-ratio: auto; }
.ph { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--soft); }
.ph img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }

.svc { border: 1px solid var(--border); border-radius: var(--radius); }
.svc summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; cursor: pointer; list-style: none; min-height: 52px; }
.svc summary::-webkit-details-marker { display: none; }
.svc summary h2 { margin: 0; font-size: 1.05rem; }
.svc .chev { color: var(--muted); transition: transform .2s; }
.svc[open] .chev { transform: rotate(180deg); }
.svc ul { list-style: none; margin: 0; padding: 0 14px 10px; }
.svc li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.svc li b { white-space: nowrap; }

.qr-block { text-align: center; }
.qr { width: 168px; height: 168px; margin: 4px auto 12px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.qr { position: relative; }
.qr svg { width: 100%; height: 100%; display: block; }
/* логотип в центре QR: круг 40% ширины = 12,6% площади кода (надёжно читается до ~44% ширины, проверено сканером) */
.qr-logo { position: absolute; inset: 0; margin: auto; width: 40%; height: 40%; border-radius: 50%; background: #fff; display: grid; place-items: center; padding: 2%; }
.qr-logo img { width: 100%; height: 100%; object-fit: contain; }
.qr-block .btn { margin-bottom: 8px; }

/* подвал */
.foot { padding: 22px 16px 26px; margin-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: .9rem; color: var(--muted); }
.foot a { color: var(--muted); }
.made a { font-weight: 600; color: var(--brand); }

/* окна */
dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(10, 14, 20, .82); }
.lb { background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lb[open] { display: grid; place-items: center; }
.lb img { max-width: 94vw; max-height: 78vh; border-radius: 12px; }
.lb-cap { color: #fff; text-align: center; margin: 10px 16px 0; }
.lb-btn { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.lb-close { top: 14px; inset-inline-end: 14px; }
.lb-prev { top: 50%; inset-inline-start: 10px; }
.lb-next { top: 50%; inset-inline-end: 10px; }
.qrd { border-radius: 24px; padding: 24px; text-align: center; width: min(92vw, 420px); background: var(--bg); color: var(--text); }
.qr-lg { width: min(78vw, 340px); height: min(78vw, 340px); border: 0; }
.toast { position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: 90vw; padding: .6em 1.1em; border-radius: 999px;
  background: #1a2230; color: #fff; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* страница конфиденциальности */
main.info { padding: 56px 18px 8px; }
.info h1 { font-size: 1.5rem; margin-bottom: .6em; }
.info h2 { font-size: 1.3rem; margin: 1.2em 0 .6em; }
.info ul { padding-inline-start: 1.2em; margin: 0 0 1em; }
.info li { margin-bottom: .5em; }
.back { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; }
.wrap:has(.info) .langs { position: absolute; inset-inline-end: 0; }
.wrap:has(.info) { position: relative; }

/* премиум-темы: цвет не выбирается */
[data-theme="black"] {
  --page: #000000; --bg: #0d0d0f; --soft: #18181b; --card: #18181b; --border: #2e2e33;
  --text: #f4f4f5; --muted: #a8a8b0; --brand: #ececef; --on-brand: #0d0d0f; --wa: #3ddc84; --focus: #8ab4ff;
  --cover: radial-gradient(120% 140% at 80% 0%, #3a3a40 0%, #141417 55%, #0d0d0f 100%);
}
[data-theme="gold"] {
  --page: #17120a; --bg: linear-gradient(180deg, #e9cf86 0%, #d4af5a 45%, #c39a43 100%); --soft: rgba(255,248,225,.55); --card: #fbf1d4;
  --border: rgba(48,34,6,.22); --text: #21180a; --muted: #4d3c17; --brand: #2a1f0b; --on-brand: #f3d98f; --wa: #145c2f;
  --cover: radial-gradient(120% 140% at 80% 0%, #6b5220 0%, #2a1f0b 60%, #1a1307 100%);
}
[data-theme="gold"] .wrap { background: var(--bg); }
[data-theme="gold"] .avatar { border-color: #e9cf86; }
[data-theme] .demo-bar { background: #2a2a2e; color: #f4f4f5; }
[data-theme="gold"] .qrd { background: #fbf1d4; }

/* переключатель оформления на демо */
.themes { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; background: rgba(255,255,255,.94); border-top: 1px solid #e1e6e4; color: #1a2230; font-size: .875rem; font-weight: 600; }
.themes span { width: 100%; text-align: center; }
.themes button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #c9cfcd; cursor: pointer; padding: 0; }
.themes button[aria-pressed="true"] { box-shadow: 0 0 0 3px #1a2230; }
.themes .c-green { background: #0f6b5c; } .themes .c-teal { background: #0e7490; } .themes .c-blue { background: #1d4ed8; }
.themes .c-purple { background: #6d28d9; } .themes .c-pink { background: #be185d; } .themes .c-red { background: #b42318; }
.themes .c-orange { background: #c2410c; } .themes .c-brown { background: #8a4b14; }
@media (min-width: 560px) { .themes span { width: auto; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .acts, .langs, .qr-block .btn, .foot, .demo-bar { display: none; } body { background: #fff; } }
