.callme-callback{
  position:fixed;
  right:var(--callme-fab-offset-right, 24px);
  bottom:var(--callme-fab-offset-bottom, 24px);
  z-index:99999;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,Arial,sans-serif;
  display:flex;
  flex-direction:column;
  align-items:flex-end;

  /* Brand */
  --callme-color:#004594;
  --callme-color-hover:#003370;

  /* Palette */
  --callme-text:#111827;
  --callme-muted:#6B7280;
  --callme-border: rgba(17,24,39,.10);

  /* Surfaces */
  --callme-surface:#ffffff;
  --callme-surface-2:#F7F8FA;
  --callme-control-bg: var(--callme-surface-2);
  --callme-control-bg-hover:#EEF0F3;
  --callme-control-bg-focus:#ffffff;

  /* Shadows/radius */
  --callme-panel-shadow: 0 24px 55px rgba(15, 23, 42, .16), 0 10px 18px rgba(15, 23, 42, .10);
  --callme-fab-shadow: 0 14px 30px rgba(0,0,0,.18), 0 6px 12px rgba(0,0,0,.12);
  --callme-radius: 24px;
  --callme-field-radius: 16px;
  --callme-field-height: 56px;
  --callme-gap: 16px;
  --callme-fab-size: 56px;
  --callme-fab-gap: 16px;

  /* Overlay */
  --callme-overlay: rgba(0,0,0,0.4);
}

.callme-callback[data-theme="dark"]{
  --callme-surface:#0f172a;
  --callme-surface-2:#111c2f;
  --callme-text:#f1f5f9;
  --callme-muted:#94a3b8;
  --callme-border: rgba(148,163,184,.18);
  --callme-control-bg:#111c2f;
  --callme-control-bg-hover:#16233c;
  --callme-control-bg-focus:#0f172a;
  --callme-panel-shadow: 0 35px 80px rgba(0, 0, 0, 0.55);
}

.callme-callback *{box-sizing:border-box;}

/* Floating button */
.callme-callback__fab{
  width:var(--callme-fab-size);
  height:var(--callme-fab-size);
  border-radius:999px;
  border:0;
  background:var(--callme-color);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: var(--callme-fab-shadow);
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .2s ease;
  position:relative;
  isolation:isolate;
  z-index: 40;
}
.callme-callback__fab:hover{transform: scale(1.05);}
.callme-callback__fab:active{transform:scale(0.95);}

/* Idle pulse animation */
.callme-callback__fab::before,
.callme-callback__fab::after{
  content:"";
  position:absolute;
  inset:-10px;
  border-radius:inherit;
  background: color-mix(in srgb, var(--callme-color), transparent 85%);
  opacity:0;
  z-index:-1;
  pointer-events:none;
  transform: scale(0.72);
  animation: callmeFabPulse 3.8s ease-out infinite;
}
.callme-callback__fab::after{
  inset:-18px;
  background: color-mix(in srgb, var(--callme-color), transparent 90%);
  animation-delay: 1.4s;
}
@keyframes callmeFabPulse{
  0%   { opacity: 0; transform: scale(0.72); }
  18%  { opacity: .55; }
  60%  { opacity: 0; transform: scale(1.20); }
  100% { opacity: 0; transform: scale(1.20); }
}
/* Disable pulse when interacting/open */
.callme-callback.is-open .callme-callback__fab::before,
.callme-callback.is-open .callme-callback__fab::after,
.callme-callback__fab:hover::before,
.callme-callback__fab:hover::after,
.callme-callback__fab:active::before,
.callme-callback__fab:active::after,
.callme-callback__fab:focus::before,
.callme-callback__fab:focus::after,
.callme-callback__fab:focus-visible::before,
.callme-callback__fab:focus-visible::after{
  animation: none;
  opacity: 0;
}
@media (prefers-reduced-motion: reduce){
  .callme-callback__fab,
  .callme-callback__panel,
  .callme-callback__backdrop{
    transition: none !important;
  }
  .callme-callback__fab::before,
  .callme-callback__fab::after{
    animation: none !important;
    opacity: 0 !important;
  }
}

.callme-callback__fabIcon{display:inline-flex;align-items:center;justify-content:center;line-height:1;}
.callme-callback__fabIcon svg{width:24px;height:24px;display:block;}
.callme-callback__fabIcon img{width:24px;height:24px;display:block;object-fit:contain;}
.callme-callback__fabIcon--close{display:none;font-size:28px;margin-top:-2px;}
.callme-callback.is-open .callme-callback__fabIcon--phone{display:none;}
.callme-callback.is-open .callme-callback__fabIcon--close{display:inline-flex;}

/* Messengers in form footer only */
.callme-callback__formMessengers{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin-top:var(--callme-gap);
}
.callme-callback__formMessengers .callme-callback__messenger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--callme-color);
  color:#fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background .2s ease, transform .2s ease;
  text-decoration:none;
}
.callme-callback__formMessengers .callme-callback__messenger:hover{
  background:var(--callme-color-hover, color-mix(in srgb, var(--callme-color) 85%, #000));
  color:#fff;
  transform:scale(1.05);
}
.callme-callback__formMessengers .callme-callback__messengerIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
}
.callme-callback__formMessengers .callme-callback__messengerIcon svg{width:22px;height:22px;display:block;color:inherit;}
.callme-callback__formMessengers .callme-callback__messengerIcon img{width:22px;height:22px;object-fit:contain;}

/* Backdrop */
.callme-callback__backdrop{
  position:fixed;
  inset:0;
  background: var(--callme-overlay);
  backdrop-filter: blur(4px);
  opacity:0;
  transition: opacity .30s ease-in-out;
  z-index: 10;
  pointer-events:none; /* don't block clicks while closed */
}
.callme-callback.is-open .callme-callback__backdrop{
  opacity:1;
  pointer-events:auto;
}

/* Panel base */
.callme-callback__panel{
  position:fixed;
  background:var(--callme-surface);
  color:var(--callme-text);
  box-shadow: var(--callme-panel-shadow);
  border: 1px solid var(--callme-border);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  opacity:0;
  transition: opacity .30s ease-in-out, transform .30s ease-in-out, border-radius .30s ease-in-out;
  z-index: 20;
  pointer-events:none; /* don't block clicks while closed */
}
.callme-callback.is-open .callme-callback__panel{
  opacity:1;
  pointer-events:auto;
}

/* Modal layout: anchored above FAB (right bottom) */
.callme-callback[data-layout="modal"] .callme-callback__panel{
  position:absolute;
  right:0;
  left:auto;
  top:auto;
  bottom: calc(var(--callme-fab-size) + var(--callme-fab-gap));
  width: min(420px, calc(100vw - 32px));
  /* Make modal taller on desktop; scroll only when viewport is really small */
  max-height: calc(100vh - (24px + var(--callme-fab-size) + var(--callme-fab-gap) + 24px));
  transform: translateY(12px) scale(.98);
  border-radius: var(--callme-radius);
}
.callme-callback[data-layout="modal"].is-open .callme-callback__panel{
  transform: translateY(0) scale(1);
}
@media (max-width: 420px){
  .callme-callback[data-layout="modal"] .callme-callback__panel{
    position:fixed;
    left:16px;
    right:16px;
    bottom: calc(16px + var(--callme-fab-size) + 12px);
    width:auto;
    transform: translateY(12px);
    border-radius: 22px;
  }
  .callme-callback[data-layout="modal"].is-open .callme-callback__panel{
    transform: translateY(0);
  }
}

/* Drawer layout: right-side window like example */
.callme-callback[data-layout="drawer"] .callme-callback__panel{
  top:0;
  right:0;
  bottom:0;
  /* Match modal width on desktop, full width on small screens */
  width: min(420px, 100vw);
  transform: translateX(20%);
  border-radius: 0;
}
@media (min-width: 550px){
  .callme-callback[data-layout="drawer"] .callme-callback__panel{
    border-radius: 2rem 0 0 2rem;
  }
}
.callme-callback[data-layout="drawer"].is-open .callme-callback__panel{
  transform: none;
}

.callme-callback__panelInner{
  padding: 28px 22px;
  width:100%;
}
@media (min-width: 550px){
  .callme-callback__panelInner{
    padding: 40px 34px;
  }
}
.callme-callback[data-layout="drawer"] .callme-callback__panelInner{
  height:100%;
  overflow:auto;
}
.callme-callback[data-layout="modal"] .callme-callback__panelInner{
  max-height: 100%;
  overflow:auto;
}

/* Header */
.callme-callback__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 24px;
}
.callme-callback[data-layout="drawer"] .callme-callback__header{
  position:sticky;
  top:0;
  z-index:30;
  background:var(--callme-surface);
  backdrop-filter: blur(10px);
  padding-top:6px;
  margin-top:-6px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--callme-border);
}
.callme-callback__title{
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin:0;
}
@media (min-width: 768px){
  .callme-callback__title{font-size: 28px;}
}
.callme-callback__x{
  position:relative;
  border:0;
  background:transparent;
  color:var(--callme-muted);
  width: 28px;
  height: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  line-height:1;
  cursor:pointer;
  transition: color .2s;
}
.callme-callback__x:hover{color:var(--callme-text);}

/* Form */
.callme-callback__form{
  display:flex;
  flex-direction:column;
  gap: var(--callme-gap) !important; /* defensive: keep consistent spacing */
}
.callme-callback__field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 !important; /* prevent theme styles from adding margins */
  padding:0 !important;
}
.callme-callback__field--city{position:relative;}
.callme-callback__label{
  font-size: 12px;
  line-height:1.3;
  letter-spacing:-0.02em;
  color: var(--callme-muted);
  margin:0;
}

/* Controls: pill inputs like example */
.callme-callback__input,
.callme-callback__select,
.callme-callback__fakeSelect{
  width:100%;
  height: var(--callme-field-height);
  border-radius: var(--callme-field-radius) !important; /* defensive: override theme vars like --form_border_radius */
  border: 1px solid var(--callme-border);
  background: var(--callme-control-bg);
  color: var(--callme-text);
  padding: 0 16px;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.02em;
  outline:none;
  transition: all .2s ease-in-out;
  display:flex;
  align-items:center;
  margin:0; /* defensive against global CSS */
}
.callme-callback__input::placeholder{color:var(--callme-muted);}
.callme-callback__input:hover:not(:focus),
.callme-callback__select:hover:not(:focus),
.callme-callback__fakeSelect:hover:not(:focus){
  background-color: var(--callme-control-bg-hover);
}
.callme-callback__input:focus,
.callme-callback__select:focus,
.callme-callback__fakeSelect:focus{
  background-color: var(--callme-control-bg-focus);
  border-color: var(--callme-color);
  box-shadow: 0 0 0 4px rgba(0, 69, 148, 0.10);
}

.callme-callback__select{
  -webkit-appearance:none;
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--callme-muted) 50%),
    linear-gradient(135deg, var(--callme-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right: 40px;
}
.callme-callback__fakeSelect{
  display:flex;
  align-items:center;
  justify-content:space-between;
  text-align:left;
  cursor:pointer;
}
.callme-callback__chevron{display:none;}

/* Submit */
.callme-callback__actions{display:flex;}
/* Honeypot: скрыто от пользователей */
.callme-callback__hp{
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.callme-callback__captcha{
  margin-top: var(--callme-gap);
  min-height: 70px;
}
.callme-callback__submit{
  width:100%;
  height: var(--callme-field-height);
  border:0;
  border-radius: var(--callme-field-radius);
  background: var(--callme-color);
  color:#fff;
  padding: 0 24px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  cursor:pointer;
  transition: background-color .2s ease-in-out, transform .1s ease-in-out;
  margin:0;
}
.callme-callback__submit:hover{background:var(--callme-color-hover);}
.callme-callback__submit:active{transform: translateY(1px);}
.callme-callback__submit:disabled{opacity:.7;cursor:not-allowed;}

/* Consent checkbox like example */
.callme-callback__consent{
  margin-top: 8px;
  display:inline-flex;
  min-height: 24px;
  user-select:none;
}
.callme-callback__consent + .callme-callback__consent{
  margin-top: 4px;
}
.callme-callback__consentCheckbox{
  display:none;
}
.callme-callback__consentText{
  position:relative;
  padding-left: 32px;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.02em;
  color: var(--callme-muted);
  cursor:pointer;
  transition: color .2s ease-in-out;
}
@media (min-width: 768px){
  .callme-callback__consentText{font-size:14px; line-height:1.43;}
}
.callme-callback__consentText a{color:inherit;}
.callme-callback__consentText::before{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  margin:auto 0;
  width: 20px;
  height: 20px;
  display:block;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 13 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3.46948L5.18818 7.65766L11.8458 1.00007' stroke='white' stroke-width='2' stroke-linecap='round' /%3E%3C/svg%3E");
  background-position: 50% 60%;
  background-repeat:no-repeat;
  background-size: 10px 8px;
  border:2px solid var(--callme-muted);
  border-radius: 6px;
  content:"";
  transition: all .2s ease-in-out;
}
.callme-callback__consent:hover .callme-callback__consentText a{color: var(--callme-color);}
.callme-callback__consent:hover .callme-callback__consentText::before{border-color: var(--callme-text);}
.callme-callback__consentCheckbox:checked + .callme-callback__consentText::before{
  background-color: var(--callme-color);
  border-color: var(--callme-color);
}
.callme-callback__consentCheckbox:checked + .callme-callback__consentText a{color: var(--callme-color);}

/* Footer content */
.callme-callback__after{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--callme-control-bg);
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.callme-callback__afterText{
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--callme-muted);
}
.callme-callback__afterPhoneLink{
  margin-top: 2px;
  display:inline-block;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--callme-text);
  text-decoration:none;
}
@media (min-width: 768px){
  .callme-callback__afterPhoneLink{font-size: 28px;}
}
.callme-callback__afterPhoneLink:hover{color: var(--callme-color);}

/* Status message */
.callme-callback__msg{
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--callme-text);
  background: transparent;
  word-break: break-word;
}
.callme-callback__msg:empty{
  display:none;
}
.callme-callback__msg--error{
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}
.callme-callback[data-theme="dark"] .callme-callback__msg--error{
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.26);
  color: #fecaca;
}
.callme-callback__msg--success{
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}
.callme-callback[data-theme="dark"] .callme-callback__msg--success{
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.26);
  color: #bbf7d0;
}

/* City dropdown: popover */
.callme-callback__dropdown{
  position:absolute;
  left:0;
  right:0;
  top: calc(100% + 10px);
  z-index: 50;
  border-radius: 16px;
  border: 1px solid var(--callme-border);
  background: var(--callme-surface);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 12px;
}
.callme-callback__cityList{
  margin-top: 10px;
  max-height: 220px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.callme-callback__cityItem{
  width:100%;
  border:0;
  background: var(--callme-control-bg);
  color: var(--callme-text);
  border-radius: 12px;
  padding: 12px 16px;
  cursor:pointer;
  text-align:left;
  transition: background-color .2s ease-in-out;
}
.callme-callback__cityItem:hover{background-color: var(--callme-control-bg-hover);}
.callme-callback__cityUseTyped{
  margin-top: 10px;
  width:100%;
  border:2px dashed var(--callme-muted);
  background: transparent;
  color: var(--callme-text);
  border-radius: 12px;
  padding: 12px 16px;
  cursor:pointer;
  text-align:left;
  opacity: 0.7;
  transition: opacity .2s;
}
.callme-callback__cityUseTyped:hover{opacity:1;}
