/* Callback controls inherit each page's current brand palette. */
body { --callback-accent: var(--yellow, #ffd700); --callback-dark: var(--green-dark, #003232); }
body.resale-page:not(.renovations-view) { --callback-accent: var(--orange, #ff7300); }
body.renovations-view { --callback-accent: var(--red, #ff0f37); --callback-dark: var(--burgundy, #3a101b); }
body.s365-callback-open { overflow: hidden; }
.s365-callback-trigger { cursor: pointer; font: inherit; }
.s365-callback-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

/* Secondary hero action stays quieter than the apartment-browsing CTA. */
.hero-actions .s365-callback-hero { flex: 0 0 auto; min-height: 44px; margin: 0; padding: 8px 0; border: 0; border-radius: 2px; background: transparent; color: rgba(255,255,255,.82); font-size: 13px; font-weight: 500; line-height: 1.4; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; white-space: nowrap; }
.hero-actions .s365-callback-hero:hover { color: #fff; text-decoration-color: var(--callback-accent); }
.hero-actions .s365-callback-hero:focus-visible { outline-color: var(--callback-accent); }

/* The final nav item appears between Reviews and the existing logo. */
.header-nav .s365-callback-header { flex: 0 0 auto; min-height: 42px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.56); border-radius: 5px; background: rgba(255,255,255,.06); color: inherit; font-size: inherit; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.header-nav .s365-callback-header:hover { border-color: var(--callback-accent); background: rgba(255,255,255,.13); }
@media (min-width: 981px) {
  .site-header.s365-header-callback { padding-left: calc(clamp(22px, 5vw, 76px) + 130px); padding-right: calc(clamp(42px, 6vw, 110px) + clamp(94px, 7vw, 122px) + 26px); }
  .s365-header-callback .header-nav { width: 100%; min-width: 0; align-items: center; justify-content: center; gap: clamp(11px, 1.4vw, 26px); font-size: clamp(12px, 1.18vw, 18px); }
  .s365-header-callback .header-nav a { white-space: nowrap; }
}

/* Keep the callback beside opening hours, directly below the phone number. */
.s365-contact-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: 16px; }
.contact-primary .s365-contact-actions p { margin: 0; font-size: 14px; }
.s365-contact-actions .s365-callback-contacts { flex: 0 0 auto; min-height: 46px; padding: 12px 20px; border: 1px solid var(--yellow-dark, #322d00); border-radius: 5px; background: var(--yellow-dark, #322d00); color: var(--yellow, #ffd700); font-size: 14px; font-weight: 700; line-height: 1.35; }
.s365-contact-actions .s365-callback-contacts:hover { background: #181700; }
.s365-contact-actions .s365-callback-contacts:focus-visible { outline-color: var(--yellow-dark, #322d00); }
.modal-details .s365-callback-apartment { display: block; width: 100%; min-height: 50px; margin-top: 12px; padding: 13px 20px; border: 1px solid var(--callback-dark); border-radius: 5px; background: transparent; color: var(--callback-dark); font-size: 15px; font-weight: 600; }
.modal-details .s365-callback-apartment:hover { background: var(--paper, #f5f7f0); }

.s365-callback { width: min(520px, calc(100% - 28px)); max-height: calc(100svh - 28px); margin: auto; padding: 35px; overflow: auto; border: 0; border-radius: 16px; background: var(--paper, #f5f7f0); color: var(--ink, #082828); box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.s365-callback::backdrop { background: rgba(0,25,25,.7); backdrop-filter: blur(5px); }
.s365-callback h2 { margin: 13px 0 25px; padding-right: 10px; font-size: 32px; line-height: 1.1; font-weight: 500; letter-spacing: -.04em; }
.s365-close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: inherit; font-size: 28px; cursor: pointer; }
.s365-close:hover { background: rgba(0,0,0,.05); }
.s365-close:focus-visible { outline: 2px solid var(--callback-dark); outline-offset: -4px; }
.s365-callback form { display: grid; gap: 16px; }
.s365-field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.s365-field input { width: 100%; min-height: 49px; padding: 14px; border: 1px solid #b7c4bd; border-radius: 6px; background: #fff; color: var(--ink, #082828); font-size: 16px; }
.s365-field input:focus { outline: 2px solid var(--callback-dark); outline-offset: 2px; }
.s365-field input[aria-invalid="true"] { border-color: #b33626; }
.s365-callback-submit { background: var(--callback-accent); color: var(--callback-dark); }
body.renovations-view .s365-callback-submit { color: #fff; }
.s365-callback-submit:focus-visible { outline: 2px solid var(--callback-dark); outline-offset: 3px; }
.s365-callback-submit:disabled { cursor: default; opacity: .65; transform: none; }
.s365-result { padding: 13px; border-radius: 6px; background: #e3eee4; color: #143c26; font-size: 14px; }
.s365-result[hidden] { display: none; }
.s365-result.error { background: #ffe4df; color: #752317; }
.s365-hp { position: absolute; left: -10000px; visibility: hidden; }
@media (max-width: 980px) {
  .site-header.menu-open .header-nav .s365-callback-header { width: 100%; min-height: 46px; margin: 10px 0 4px; padding: 12px 14px; text-align: center; }
}
@media (max-width: 680px) {
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .s365-callback-hero { align-self: flex-start; width: auto; margin-top: -8px; }
  .s365-contact-actions { align-items: flex-start; }
  .s365-contact-actions .s365-callback-contacts { margin-left: auto; }
  .s365-callback { padding: 28px 22px; }
  .s365-callback h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .s365-callback button { transition: none; }
}
