/* ============================================================
   Contact page — public "צור קשר".
   Uses the shared cyan/glass tokens from design.css. RTL-safe
   (logical properties). The .fld / .otp-* rules are ported from
   page-cart.css because that stylesheet is not loaded on this page.
   ============================================================ */

/* Push the hero clear of the fixed top nav. */
.contact-page main,
.contact-hero { position: relative; }

.contact-hero {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  padding-top: 130px;
  padding-bottom: 8px;
}
.contact-hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  margin-top: 18px;
}
.contact-lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 16px;
}
.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(44, 193, 255, 0.05);
  color: var(--tl-cyan);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.contact-mail:hover {
  border-color: var(--border-cyan);
  background: rgba(44, 193, 255, 0.1);
  transform: translateY(-1px);
}
.contact-mail svg { flex-shrink: 0; }

/* ── Layout wrapper */
.contact-wrap {
  max-width: 760px;
  margin-inline: auto;
  padding-top: 28px;
  padding-bottom: 80px;
}

/* ── Card */
.contact-card { padding: 36px; }
@media (max-width: 600px) { .contact-card { padding: 22px; } }
@media (max-width: 480px) { .contact-card { padding: 18px; } }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 4px;
}
.contact-card .banner { margin-bottom: 18px; }

/* ── Floating-label fields (ported from page-cart.css) */
.contact-card .fld { position: relative; }
.contact-card .field-full { grid-column: 1 / -1; }
.contact-card .fld > input,
.contact-card .fld > textarea {
  width: 100%;
  padding: 22px 16px 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, background .2s;
  direction: rtl;
}
.contact-card .fld.ltr > input { direction: ltr; text-align: right; }
.contact-card .fld > input:focus,
.contact-card .fld > textarea:focus {
  border-color: var(--border-cyan);
  background: rgba(44, 193, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(44, 193, 255, 0.13);
}
.contact-card .fld[hidden] { display: none; }
/* Floating label — ONLY when a <label> directly follows its <input>/<textarea>.
   Static labels (.otp-label before a <select>, the .contact-check label after a
   link) are NOT field-followers, so they stay in normal flow. Scoping this to
   `input + label` / `textarea + label` is what fixes the topic + FAQ-gate text
   overlapping their neighbours (the old `.fld > label` caught every label). */
.contact-card .fld > input + label,
.contact-card .fld > textarea + label {
  position: absolute;
  inset-inline-start: 16px;
  top: 17px;
  font-size: 14px;
  color: var(--text-mute);
  pointer-events: none;
  transition: all .2s cubic-bezier(.2, .6, .3, 1);
  /* transform-origin has no logical keyword — anchor at the start edge per dir.
     RTL (default) = right; LTR override below. */
  transform-origin: right center;
}
[dir="ltr"] .contact-card .fld > input + label,
[dir="ltr"] .contact-card .fld > textarea + label { transform-origin: left center; }
.contact-card .fld > input:focus + label,
.contact-card .fld > input:not(:placeholder-shown) + label,
.contact-card .fld > textarea:focus + label,
.contact-card .fld > textarea:not(:placeholder-shown) + label,
.contact-card .fld.has-val > input + label,
.contact-card .fld.has-val > textarea + label,
.contact-card .fld.ltr > input + label {
  top: 6px;
  font-size: 11px;
  color: var(--tl-cyan);
  transform: scale(.95);
  letter-spacing: .5px;
}

/* Textarea sits a little taller; keep label clearance. */
.contact-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

/* ── Themed <select> wrapper label (matches OTP label styling). */
.contact-card .otp-label {
  display: block;
  font-size: 11px;
  color: var(--tl-cyan);
  letter-spacing: .5px;
  font-weight: 700;
  padding: 0 2px 8px;
}
.contact-card .tl-select .input,
.contact-card select.input { width: 100%; }

/* ============= OTP-style segmented phone input (ported) ============= */
.contact-card .otp-fld {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .25s ease, background .25s ease;
}
.contact-card .otp-fld:focus-within {
  border-color: var(--border-cyan);
  background: rgba(44, 193, 255, 0.04);
}
.contact-card .otp-fld .otp-label { padding: 0 2px; }
.contact-card .otp-cells {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
}
.contact-card .otp-fld .otp-cell {
  width: 34px;
  height: 42px;
  flex-shrink: 0;
  text-align: center;
  background: rgba(7, 11, 24, 0.55);
  border: 1px solid rgba(127, 217, 255, 0.18);
  border-radius: 9px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  outline: none;
  padding: 0;
  transition:
    border-color .25s ease,
    background .25s ease,
    box-shadow .25s ease,
    transform .15s cubic-bezier(.2, .7, .3, 1.4);
  caret-color: var(--tl-cyan);
}
.contact-card .otp-fld .otp-cell:focus {
  border-color: var(--tl-cyan);
  background: rgba(44, 193, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(44, 193, 255, 0.2), 0 0 18px rgba(44, 193, 255, 0.3);
  transform: translateY(-1px);
}
.contact-card .otp-fld .otp-cell.filled {
  background: rgba(44, 193, 255, 0.08);
  border-color: rgba(127, 217, 255, 0.4);
  color: var(--tl-cyan);
}
.contact-card .otp-fld .otp-cell.invalid {
  border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.04);
}
.contact-card .otp-sep {
  color: var(--text-mute);
  font-weight: 700;
  user-select: none;
  padding: 0 2px;
}
.contact-card .otp-fld .otp-valid-mark {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  color: var(--ok);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.contact-card .otp-fld.valid .otp-valid-mark { opacity: 1; }
.contact-card .otp-fld.valid  { border-color: rgba(41, 211, 145, 0.4); }
.contact-card .otp-fld.invalid { border-color: rgba(255, 77, 109, 0.5); }
.contact-card .otp-fld .otp-valid-mark svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .contact-card .otp-fld .otp-cell { width: 28px; height: 38px; font-size: 14px; }
}
@media (max-width: 480px) {
  .contact-card .otp-fld { padding-inline: 12px; }
  .contact-card .otp-cells { gap: 5px; flex-wrap: wrap; justify-content: flex-start; }
  .contact-card .otp-fld .otp-cell { width: 27px; height: 38px; font-size: 13px; border-radius: 7px; }
  .contact-card .otp-sep { padding: 0 1px; }
}
@media (max-width: 360px) {
  .contact-card .otp-fld { padding-inline: 10px; }
  .contact-card .otp-cells { gap: 4px; }
  .contact-card .otp-fld .otp-cell { width: 25px; height: 36px; font-size: 12px; }
}

/* ── FAQ gate */
.contact-faqgate {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: rgba(44, 193, 255, 0.03);
}
.contact-faqgate[hidden] { display: none; }
.contact-faqgate__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tl-cyan);
  font-weight: 700;
  font-size: 14px;
  align-self: flex-start;
}
.contact-faqgate__link:hover { text-decoration: underline; }
.contact-faqgate__link svg { flex-shrink: 0; }

/* Themed checkbox row (mirrors the checkout .check-row). */
.contact-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}
.contact-check input { position: absolute; opacity: 0; pointer-events: none; }
.contact-check .cb {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  transition: background .2s ease, border-color .2s ease;
}
.contact-check .cb svg {
  width: 14px;
  height: 14px;
  color: #04102b;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s ease, transform .2s cubic-bezier(.2, .7, .3, 1.6);
}
.contact-check.checked .cb {
  background: var(--grad-blue);
  border-color: transparent;
}
.contact-check.checked .cb svg { opacity: 1; transform: scale(1); }
.contact-check .text { padding-top: 1px; }

/* ── Honeypot — kept in the DOM, removed from view + a11y tree. */
.contact-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============= WhatsApp preference + iOS-style switches ============= */
.cl-wa {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(37, 211, 102, 0.05);
}

/* Switch row: [track] [body]. The checkbox is sr-only; the track is its
   immediate sibling so the visual is pure-CSS (:checked) — JS only reveals
   the dependent sub-sections. RTL-correct via inset-inline-start. */
.cl-switch {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
.cl-switch > input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cl-switch__track {
  flex: none;
  position: relative;
  width: 46px; height: 28px;
  margin-top: 1px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-strong);
  transition: background .25s ease, border-color .25s ease, box-shadow .2s ease;
}
.cl-switch__thumb {
  position: absolute;
  top: 50%;
  inset-inline-start: 3px;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: inset-inline-start .25s cubic-bezier(.2, .7, .3, 1.5);
}
.cl-switch > input:checked + .cl-switch__track { background: var(--grad-blue); border-color: transparent; }
.cl-switch > input:checked + .cl-switch__track .cl-switch__thumb { inset-inline-start: 22px; }
.cl-switch > input:focus-visible + .cl-switch__track { box-shadow: 0 0 0 3px rgba(44, 193, 255, 0.35); }
/* WhatsApp-green accent for the opt-in toggle. */
.cl-switch--wa > input:checked + .cl-switch__track { background: linear-gradient(135deg, #25d366, #128c7e); }
.cl-switch--wa > input:focus-visible + .cl-switch__track { box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.35); }

.cl-switch__body { display: flex; flex-direction: column; gap: 3px; }
.cl-switch__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
}
.cl-switch__sub { font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.cl-switch--sm .cl-switch__title { font-size: 14px; }
.cl-wa__ic { flex: none; color: #25d366; }

/* Convenience-hours sub-section: divider + indented from/to range. */
.cl-wa__hours {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  border-top: 1px dashed transparent;
  transition: max-height .35s cubic-bezier(.16, 1, .3, 1), opacity .3s ease, padding-top .35s ease, border-top-color .3s ease;
}
.cl-wa__hours.is-open {
  max-height: 360px;
  opacity: 1;
  padding-top: 16px;
  border-top-color: var(--border-strong);
}
.cl-hours {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding-inline-start: 60px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}
.cl-hours.is-open {
  max-height: 240px;
  opacity: 1;
}
.cl-hours__f { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 130px; }
.cl-hours__lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mute);
  letter-spacing: .3px;
  padding-inline-start: 2px;
}
.cl-hours__dash { padding-bottom: 12px; color: var(--text-mute); font-weight: 700; }
@media (max-width: 480px) {
  .cl-hours { padding-inline-start: 0; }
  .cl-hours__dash { display: none; }
}

/* ============= Interactive submit button ============= */
.contact-submit {
  position: relative;
  margin-top: 28px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 17px 28px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #021227;
  cursor: pointer;
  background: linear-gradient(120deg, #2cc1ff 0%, #0d7cd9 48%, #2cc1ff 100%);
  background-size: 220% 100%;
  background-position: 0% 0;
  box-shadow: 0 14px 30px -12px rgba(44, 193, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s cubic-bezier(.2, .7, .3, 1.35), box-shadow .25s ease, background-position .5s ease;
}
.contact-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform .6s ease;
}
.contact-submit:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 22px 44px -12px rgba(44, 193, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.contact-submit:hover::before { transform: translateX(130%); }
.contact-submit:active { transform: translateY(0) scale(.985); box-shadow: 0 8px 18px -10px rgba(44, 193, 255, 0.7); }
.contact-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 193, 255, 0.45), 0 14px 30px -12px rgba(44, 193, 255, 0.65);
}
.contact-submit__ic { flex: none; transition: transform .25s cubic-bezier(.2, .7, .3, 1.4); }
.contact-submit:hover .contact-submit__ic { transform: translate(-3px, -3px) rotate(-8deg); }
@media (prefers-reduced-motion: reduce) {
  .contact-submit,
  .contact-submit::before,
  .contact-submit__ic,
  .cl-switch__track,
  .cl-switch__thumb,
  .cl-wa__hours,
  .cl-hours { transition: none; }
  .contact-submit:hover { transform: none; }
  .contact-submit:hover::before { transform: translateX(-130%); }
}

/* ── Success state */
.contact-success {
  text-align: center;
  padding: 48px 32px;
  max-width: 560px;
  margin-inline: auto;
}
.contact-success__ic {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(41, 211, 145, 0.1);
  border: 1px solid rgba(41, 211, 145, 0.4);
  color: var(--ok);
  margin-bottom: 22px;
  animation: logoGlow 2.4s ease-in-out infinite;
}
.contact-success__ic svg { width: 34px; height: 34px; }
.contact-success h2 { font-size: 26px; font-weight: 800; }
.contact-success p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  margin-top: 12px;
}
.contact-success__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
@media (max-width: 480px) {
  .contact-success__actions .btn { width: 100%; }
}
