/* =========================================================
   ✅ ВЕРСИЯ: FULL UPGRADED + DARK DETECTOR (NO WA PREFILL)
   - WhatsApp без предзаполненного текста
   - Кнопка появляется после небольшого скролла (не мешает сразу)
   ========================================================= */

.elp-contact-scope{
  --primary:#0d3b66;
  --accent:#2a8bc9;
  --gold:#c2a06b;
  --text:#ffffff;

  --shadowSoft:rgba(0,0,0,.24);
  --shadowHard:rgba(0,0,0,.44);

  --title:rgba(255,255,255,.98);
  --p:rgba(255,255,255,.92);
  --p2:rgba(255,255,255,.86);

  --glassA:rgba(0,0,0,.32);
  --glassB:rgba(0,0,0,.26);
  --glassC:rgba(0,0,0,.22);
  --glassD:rgba(0,0,0,.18);

  --btn-pad-y:14px;
  --btn-pad-x:24px;
  --btn-font:14px;
  --btn-gap:10px;
  --btn-radius:56px;

  --corner-gap:16px;
}
.elp-contact-scope *{box-sizing:border-box}

/* ================= FLOATING BUTTON ================= */
.elp-contact-scope .floating-price-button{
  position:fixed !important;
  bottom: calc(var(--corner-gap) + env(safe-area-inset-bottom, 0px)) !important;
  right:  calc(var(--corner-gap) + env(safe-area-inset-right, 0px)) !important;
  z-index:10000 !important;
  opacity:0;
  transform:translateY(28px) scale(.82);
  transition:all .85s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.elp-contact-scope .floating-price-button.visible{
  opacity:1 !important;
  transform:translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.elp-contact-scope .floating-button{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:var(--btn-gap);
  padding:var(--btn-pad-y) var(--btn-pad-x);
  border-radius:var(--btn-radius);

  border:1px solid rgba(255,255,255,.20);
  color:var(--text);

  font-family:system-ui,-apple-system,"SF Pro Display",Segoe UI,Roboto,Arial,sans-serif;
  font-weight:900;
  font-size:var(--btn-font);
  text-transform:uppercase;
  letter-spacing:1.35px;

  text-shadow:0 1px 3px rgba(0,0,0,.35);
  box-shadow:0 12px 28px var(--shadowSoft), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -2px 0 rgba(0,0,0,.20);

  cursor:pointer;
  transition:transform .28s cubic-bezier(.34,1.56,.64,1), filter .18s ease, box-shadow .18s ease;
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;

  background:linear-gradient(145deg, rgba(255,255,255,1), rgba(255,255,255,0.98));
  border-color: rgba(13,59,102,0.25);
  color: #0d3b66;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  box-shadow: 0 12px 28px rgba(15,23,42,0.18), inset 0 2px 0 rgba(255,255,255,1), inset 0 -2px 0 rgba(13,59,102,0.08);
}
.elp-contact-scope .floating-button svg{
  flex:0 0 auto;
  fill: #0d3b66;
  color: #0d3b66;
}
body.dark-mode .elp-contact-scope .floating-button svg,
html.dark-mode .elp-contact-scope .floating-button svg {
  fill: rgba(255,255,255,.95);
  color: rgba(255,255,255,.95);
}

.elp-contact-scope.elp-is-dark .floating-button,
html[data-theme="dark"] .elp-contact-scope .floating-button,
html.dark .elp-contact-scope .floating-button,
body.dark .elp-contact-scope .floating-button,
body.dark-mode .elp-contact-scope .floating-button,
body.theme-dark .elp-contact-scope .floating-button{
  background:linear-gradient(145deg, rgba(10,12,18,.94), rgba(18,24,36,.92));
  border-color:rgba(255,255,255,.14);
  color: rgba(255,255,255,.95) !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  box-shadow:0 12px 28px var(--shadowHard), inset 0 1px 0 rgba(255,255,255,.10), inset 0 -2px 0 rgba(0,0,0,.30);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
              filter 0.3s ease, 
              box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease !important;
}
body.dark-mode .elp-contact-scope .floating-button:hover,
html.dark-mode .elp-contact-scope .floating-button:hover {
  transform: translateY(-4px) rotateX(6deg) scale(1.02) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 
              inset 0 1px 0 rgba(255,255,255,.15), 
              inset 0 -2px 0 rgba(0,0,0,.35),
              0 0 24px rgba(77,171,247,0.2) !important;
  filter: brightness(1.12);
  background: linear-gradient(145deg, rgba(15,18,25,.96), rgba(25,32,48,.94)) !important;
  border-color: rgba(77,171,247,0.3);
}
body.dark-mode .elp-contact-scope .floating-button:active,
html.dark-mode .elp-contact-scope .floating-button:active {
  transform: translateY(1px) scale(.99) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.4) !important;
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))){
  .elp-contact-scope .floating-button{backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);}
}

.elp-contact-scope .floating-button:hover{
  transform:translateY(-4px) rotateX(6deg) scale(1.02);
  box-shadow:0 18px 42px rgba(15,23,42,0.28);
  filter:brightness(1.05);
  background:linear-gradient(145deg, rgba(255,255,255,1), rgba(255,255,255,0.98));
  border-color: rgba(13,59,102,0.35);
}
.elp-contact-scope .floating-button:active{
  transform:translateY(1px) scale(.99);
  box-shadow:0 10px 24px rgba(0,0,0,.26);
}

.elp-contact-scope .button-border{
  position:absolute;
  inset:-4px;
  border-radius:64px;
  background:linear-gradient(45deg,var(--gold),#f4e4bc,var(--gold));
  background-size:400% 400%;
  opacity:.42;
  animation:elpShimmer 6.5s infinite linear;
  pointer-events:none;
  z-index:-1;
}
.elp-contact-scope.elp-is-dark .button-border,
html[data-theme="dark"] .elp-contact-scope .button-border,
html.dark .elp-contact-scope .button-border,
body.dark .elp-contact-scope .button-border,
body.dark-mode .elp-contact-scope .button-border,
body.theme-dark .elp-contact-scope .button-border{
  opacity:.26;
}

/* ================= MODAL OVERLAY ================= */
.elp-contact-scope .modal-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  z-index:10001;
  background:radial-gradient(1200px 700px at 50% 10%, rgba(42,139,201,.22), rgba(0,0,0,.78));
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
             visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1),
             backdrop-filter 0.4s ease;
}
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))){
  .elp-contact-scope .modal-overlay{backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);}
}
.elp-contact-scope .modal-overlay.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.elp-contact-scope .modal-content{
  position:relative;
  width:min(760px, 100%);
  max-height:min(86vh, 860px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius:34px;
  scrollbar-width: thin;
  scrollbar-color: rgba(13,59,102,0.3) transparent;
  border:1px solid rgba(255,255,255,.16);
  background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
  box-shadow:0 45px 90px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.20);
  transform:translateY(30px) scale(.94);
  opacity:0;
  transition:transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
             opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
             box-shadow 0.5s ease;
}

/* Стилизация скроллбаров для светлой темы */
.elp-contact-scope .modal-content::-webkit-scrollbar {
  width: 8px;
}
.elp-contact-scope .modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.elp-contact-scope .modal-content::-webkit-scrollbar-thumb {
  background: rgba(13,59,102,0.3);
  border-radius: 4px;
}
.elp-contact-scope .modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(13,59,102,0.5);
}

/* Стилизация скроллбаров для темной темы */
body.dark-mode .elp-contact-scope .modal-content,
html.dark-mode .elp-contact-scope .modal-content {
  scrollbar-color: rgba(77,171,247,0.4) transparent;
}
body.dark-mode .elp-contact-scope .modal-content::-webkit-scrollbar-thumb,
html.dark-mode .elp-contact-scope .modal-content::-webkit-scrollbar-thumb {
  background: rgba(77,171,247,0.4);
}
body.dark-mode .elp-contact-scope .modal-content::-webkit-scrollbar-thumb:hover,
html.dark-mode .elp-contact-scope .modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(77,171,247,0.6);
}

/* Улучшение читаемости текста в модальном окне для темной темы */
body.dark-mode .elp-contact-scope .modal-title,
html.dark-mode .elp-contact-scope .modal-title {
  color: rgba(255,255,255,.98) !important;
  text-shadow: 0 2px 8px rgba(0,0,0,.6) !important;
}

body.dark-mode .elp-contact-scope .modal-subtitle,
html.dark-mode .elp-contact-scope .modal-subtitle {
  color: rgba(255,255,255,.92) !important;
  text-shadow: 0 1px 6px rgba(0,0,0,.5) !important;
}

body.dark-mode .elp-contact-scope .modal-subtitle strong,
html.dark-mode .elp-contact-scope .modal-subtitle strong {
  color: rgba(255,255,255,1) !important;
  font-weight: 700;
}

body.dark-mode .elp-contact-scope .modal-note,
html.dark-mode .elp-contact-scope .modal-note {
  color: rgba(255,255,255,.95) !important;
  background: rgba(0,0,0,.35) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.5) !important;
}

body.dark-mode .elp-contact-scope .contact-title,
html.dark-mode .elp-contact-scope .contact-title {
  color: rgba(255,255,255,.98) !important;
  text-shadow: 0 1px 6px rgba(0,0,0,.4) !important;
}

body.dark-mode .elp-contact-scope .contact-sub,
html.dark-mode .elp-contact-scope .contact-sub {
  color: rgba(255,255,255,.88) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}

body.dark-mode .elp-contact-scope .contact-pill,
html.dark-mode .elp-contact-scope .contact-pill {
  color: rgba(255,255,255,.95) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}

body.dark-mode .elp-contact-scope .hint,
html.dark-mode .elp-contact-scope .hint {
  color: rgba(255,255,255,.85) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,.4) !important;
}
.elp-contact-scope .modal-overlay.is-open .modal-content{
  transform:translateY(0) scale(1);
  opacity:1;
}

/* Плавное закрытие модального окна */
.elp-contact-scope .modal-overlay.closing .modal-content{
  transform:translateY(30px) scale(.94);
  opacity:0;
  transition:transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
             opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.elp-contact-scope .modal-overlay.closing{
  opacity:0;
  transition:opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
             visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.elp-contact-scope .modal-content::before{
  content:"";
  position:absolute;
  inset:-1px;
  pointer-events:none;
  background:
    radial-gradient(900px 220px at 20% 0%, rgba(244,228,188,.18), transparent 65%),
    radial-gradient(700px 220px at 80% 0%, rgba(42,139,201,.18), transparent 65%);
  border-radius:34px;
}

.elp-contact-scope .modal-pad{padding:18px 20px 22px}

/* Верхний блок темнее (как нижний) */
.elp-contact-scope .modal-headwrap{
  margin:4px 0 10px;
  padding:16px 16px 14px;
  border-radius:26px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(180deg, var(--glassA), var(--glassC));
  box-shadow:0 18px 40px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.10);
}
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))){
  .elp-contact-scope .modal-headwrap{backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);}
}

.elp-contact-scope .modal-title{
  margin:0;
  font-size:26px;
  line-height:1.15;
  letter-spacing:.2px;
  color:var(--title);
  text-shadow:0 2px 12px rgba(0,0,0,.48);
}
.elp-contact-scope .modal-subtitle{
  margin:10px 0 0;
  color:var(--p);
  font-size:15px;
  line-height:1.55;
  text-shadow:0 1px 10px rgba(0,0,0,.40);
}

.elp-contact-scope .modal-close{
  position:sticky;
  top:14px;
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.32);
  color:rgba(255,255,255,.95);
  cursor:pointer;
  z-index:5;
  box-shadow:0 10px 20px rgba(0,0,0,.25);
  transition:transform .2s ease, filter .2s ease, background .2s ease;
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))){
  .elp-contact-scope .modal-close{backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);}
}
.elp-contact-scope .modal-close:hover{transform:translateY(-1px); filter:brightness(1.08); background:rgba(0,0,0,.38);}
.elp-contact-scope .modal-close:active{transform:translateY(1px) scale(.98);}

.elp-contact-scope .modal-note{
  margin-top:12px;
  padding:12px 12px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:rgba(255,255,255,.90);
  font-size:13.5px;
  line-height:1.52;
  text-shadow:0 1px 10px rgba(0,0,0,.34);
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))){
  .elp-contact-scope .modal-note{backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);}
}

/* ================= CONTACT GRID ================= */
.elp-contact-scope .modal-contact-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
@media (max-width:620px){
  .elp-contact-scope .modal-contact-grid{grid-template-columns:1fr}
}

.elp-contact-scope .contact-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.14);
  background:var(--glassD);
  color:rgba(255,255,255,.94);
  text-decoration:none;
  overflow:hidden;
  transition:transform .22s ease, filter .22s ease, border-color .22s ease;
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))){
  .elp-contact-scope .contact-card{backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);}
}
.elp-contact-scope .contact-card:hover{transform:translateY(-2px); filter:brightness(1.07); border-color:rgba(244,228,188,.35);}
.elp-contact-scope .contact-card:active{transform:translateY(1px) scale(.995);}

.elp-contact-scope .contact-ico{
  width:46px;height:46px;
  border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(145deg, rgba(13,59,102,.55), rgba(27,108,168,.38));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
  flex:0 0 auto;
}
.elp-contact-scope .contact-ico svg{width:24px;height:24px}
.elp-contact-scope .contact-meta{min-width:0}
.elp-contact-scope .contact-title{font-weight:900; letter-spacing:.3px; font-size:14px; margin:0; color:rgba(255,255,255,.98); text-shadow:0 1px 6px rgba(0,0,0,.22);}
.elp-contact-scope .contact-sub{margin:6px 0 0; font-size:13px; color:rgba(255,255,255,.80); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 6px rgba(0,0,0,.18);}
.elp-contact-scope .contact-pill{
  margin-left:auto;
  font-size:12px;
  font-weight:800;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:var(--glassC);
  color:rgba(255,255,255,.92);
  text-shadow:0 1px 6px rgba(0,0,0,.18);
  flex:0 0 auto;
}

.elp-contact-scope .hint{
  margin-top:10px;
  padding:10px 12px;
  border-radius:16px;
  border:1px dashed rgba(255,255,255,.18);
  background:rgba(0,0,0,.18);
  color:rgba(255,255,255,.78);
  font-size:13px;
  line-height:1.45;
}

@media (max-width:768px){
  .elp-contact-scope{
    --btn-pad-y:14px;
    --btn-pad-x:22px;
    --btn-font:14px;
    --corner-gap:12px;
  }
  .elp-contact-scope .modal-title{font-size:23px}
  .elp-contact-scope .modal-headwrap{padding:14px 14px 12px; border-radius:24px;}
}
@media (min-width:1024px){
  .elp-contact-scope{
    --btn-pad-y:12px;
    --btn-pad-x:18px;
    --btn-font:13px;
    --btn-gap:8px;
    --corner-gap:10px;
  }
  .elp-contact-scope .floating-button svg{width:22px;height:22px}
  .elp-contact-scope .button-border{inset:-5px}
}

@media (prefers-reduced-motion: reduce){
  .elp-contact-scope .button-border{animation:none}
  .elp-contact-scope .floating-price-button,
  .elp-contact-scope .floating-button,
  .elp-contact-scope .modal-overlay,
  .elp-contact-scope .modal-content{
    transition:none !important;
  }
}
@media print{ .elp-contact-scope{display:none !important;} }
@keyframes elpShimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
