/* ─── eSIM365 Calculator Widget ─────────────────────────────────────── */
.calculate-pack * { box-sizing: border-box; margin: 0; padding: 0; }
.calculate-pack {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  color: #1c0f33;
}

.ec-wrap { max-width: 580px; margin: 0 auto; }
/* Header */
.ec-header { text-align: center; margin-bottom: 24px; }
.ec-badge-country {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(89,49,150,0.08); border: 1px solid rgba(89,49,150,0.2);
  border-radius: 100px; padding: 5px 14px;
  font-size: 11px; color: #593196; letter-spacing: 0.09em;
  text-transform: uppercase; margin-bottom: 12px;
}
.ec-dot-live {
  width: 6px; height: 6px; background: #593196; border-radius: 50%;
  display: inline-block; animation: ec-blink 2s ease-in-out infinite;
}
.ec-flag {
  width: 20px; height: auto; border-radius: 2px;
  display: inline-block; vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.ec-title { font-size: clamp(20px,4vw,26px); font-weight: 900; color: #1c0f33; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 8px; }
.ec-subtitle { font-size: 13px; color: #7c6d96; }

/* Card wrapper */
.ec-card-wrap {
  background: #fff;
  border: 1.5px solid rgba(89,49,150,0.1);
  border-radius: 24px;
  padding: 28px 26px;
  box-shadow: 0 8px 40px rgba(89,49,150,0.1), 0 1px 3px rgba(89,49,150,0.05);
  position: relative;
}

/* Progress dots */
.ec-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 26px; }
.ec-dot { height: 6px; border-radius: 3px; background: #ede8f7; transition: all 0.35s cubic-bezier(.4,0,.2,1); }
.ec-dot.active { background: #593196; }

/* Step animation */
.ec-step { animation: ec-fadeup 0.22s ease; }
.ec-step.no-anim,
.ec-step.no-anim .ec-results { animation: none; }

/* Question */
.ec-q-title { font-size: 18px; font-weight: 800; color: #1c0f33; margin-bottom: 6px; letter-spacing: -0.02em; }
.ec-q-sub   { font-size: 13px; color: #7c6d96; margin-bottom: 20px; line-height: 1.5; }

/* Duration */
.ec-dur-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.ec-dur-btn {
  flex: 1 1 calc(20% - 7px); min-width: 52px;
  padding: 16px 6px; background: #faf7ff;
  border: 1.5px solid rgba(89,49,150,0.18);
  border-radius: 14px; cursor: pointer; text-align: center;
  transition: all 0.18s; color: #1c0f33;
}
.ec-dur-btn:hover { border-color: #593196; background: rgba(89,49,150,0.07); }
.ec-dur-btn.sel {
  background: #593196; border-color: #593196; color: #fff;
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(89,49,150,0.3);
}
.ec-dur-num { display: block; font-size: 17px; font-weight: 800; }
.ec-dur-sub { display: block; font-size: 10px; color: #7c6d96; margin-top: 3px; }
.ec-dur-btn.sel .ec-dur-sub { color: rgba(255,255,255,0.7); }

/* Apps */
.ec-apps-list { display: flex; flex-direction: column; gap: 10px; }
.ec-app-btn {
  background: #faf7ff; border: 1.5px solid rgba(89,49,150,0.15);
  border-radius: 16px; padding: 13px 15px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: all 0.18s; text-align: left; width: 100%; color: #1c0f33;
}
.ec-app-btn:hover { border-color: #593196; background: rgba(89,49,150,0.06); }
.ec-app-btn.sel { background: rgba(89,49,150,0.07); border-color: #593196; border-width: 2px; transform: translateX(3px); }
.ec-app-icon { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; background: #ede8f7; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ec-app-btn.sel .ec-app-icon { background: rgba(89,49,150,0.15); }
.ec-app-info { flex: 1; }
.ec-app-label { display: block; font-size: 14px; font-weight: 700; color: #4a3a66; }
.ec-app-btn.sel .ec-app-label { color: #1c0f33; }
.ec-app-desc { display: block; font-size: 11px; color: #7c6d96; margin-top: 2px; }
.ec-app-mb { font-size: 10px; color: #7c6d96; background: #ede8f7; border-radius: 6px; padding: 3px 7px; flex-shrink: 0; white-space: nowrap; }
.ec-check { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: #ede8f7; border: 1.5px solid rgba(89,49,150,0.2); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 900; transition: all 0.18s; }
.ec-app-btn.sel .ec-check { background: #593196; border-color: #593196; }

/* Hours */
.ec-hours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ec-hr-btn {
  padding: 16px 14px; background: #faf7ff;
  border: 1.5px solid rgba(89,49,150,0.18);
  border-radius: 14px; cursor: pointer; text-align: center;
  transition: all 0.18s; color: #1c0f33;
}
.ec-hr-btn:hover { border-color: #593196; background: rgba(89,49,150,0.07); }
.ec-hr-btn.sel {
  background: #593196; border-color: #593196;
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(89,49,150,0.3);
}
.ec-hr-label { display: block; font-size: 15px; font-weight: 700; }
.ec-hr-btn.sel .ec-hr-label { color: #fff; }
.ec-hr-sub { display: block; font-size: 11px; color: #7c6d96; margin-top: 4px; line-height: 1.4; }
.ec-hr-btn.sel .ec-hr-sub { color: rgba(255,255,255,0.65); }

/* Nav */
.ec-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }

/* Buttons */
.ec-btn-primary {
  background: #593196; border: none; border-radius: 12px;
  padding: 13px 28px; font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer; letter-spacing: -0.01em;
  box-shadow: 0 4px 14px rgba(89,49,150,0.3);
  transition: all 0.18s; font-family: inherit;
}
.ec-btn-primary:hover { color: #fff; background: #4a2880; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(89,49,150,0.38); }
.ec-btn-primary:disabled { background: #d0c7e8; box-shadow: none; cursor: not-allowed; transform: none; }
.ec-btn-ghost {
  background: #fff; border: 1.5px solid rgba(89,49,150,0.25);
  border-radius: 10px; padding: 9px 16px;
  font-size: 13px; font-weight: 700; color: #593196;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.ec-btn-ghost:hover { background: rgba(89,49,150,0.07); }

/* Back button in results */
.ec-btn-back-result {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 0 0 14px 0;
  font-size: 13px; font-weight: 600; color: #7c6d96;
  cursor: pointer; font-family: inherit; transition: color 0.15s;
}
.ec-btn-back-result:hover { color: #593196; }

/* ─── RESULTS ──────────────────────────────────────────────────────────────── */
.ec-results { }
.ec-summary {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  background: rgba(89,49,150,0.07); border: 1.5px solid rgba(89,49,150,0.18);
  border-radius: 16px; padding: 16px 18px; margin-bottom: 16px;
}
.ec-summary-gb { font-size: 26px; font-weight: 900; color: #593196; letter-spacing: -0.03em; }
.ec-summary-detail { font-size: 12px; color: #7c6d96; margin-top: 2px; }
.ec-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ec-tag { background: #fff; border: 1px solid rgba(89,49,150,0.2); border-radius: 100px; padding: 4px 11px; font-size: 11px; color: #593196; }

/* Tariff cards */
.ec-best { margin-bottom: 10px; }
.ec-card {
  background: #fff; border: 1.5px solid rgba(89,49,150,0.12);
  border-radius: 18px; padding: 16px 18px;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(89,49,150,0.06);
  user-select: none;
}
.ec-card:hover { border-color: rgba(89,49,150,0.3); box-shadow: 0 6px 18px rgba(89,49,150,0.1); transform: translateY(-1px); }
.ec-card.sel { background: rgba(89,49,150,0.06); border-color: rgba(89,49,150,0.45); border-width: 2px; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(89,49,150,0.15); }

.ec-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ec-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ec-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; }
.ec-badge-best   { background: #593196; color: #fff; }
.badge-single    { background: rgba(89,49,150,0.1);  color: #593196; border: 1px solid rgba(89,49,150,0.22); }
.badge-easy      { background: rgba(124,79,192,0.1); color: #7c4fc0; border: 1px solid rgba(124,79,192,0.22); }
.badge-smart     { background: rgba(168,85,247,0.1); color: #a855f7; border: 1px solid rgba(168,85,247,0.22); }
.ec-badge-daily  { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }

.ec-check-circle {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: #ede8f7; border: 1.5px solid rgba(89,49,150,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 900; transition: all 0.18s;
}
.ec-card.sel .ec-check-circle { background: #593196; border-color: #593196; }

.ec-card-main { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.ec-vol { font-size: 30px; font-weight: 900; color: #1c0f33; letter-spacing: -0.03em; line-height: 1; }
.ec-vol-sub { font-size: 11px; color: #7c6d96; margin-top: 3px; }
.ec-price { font-size: 24px; font-weight: 900; color: #1c0f33; letter-spacing: -0.02em; text-align: right; transition: color 0.18s; }
.ec-price.accent { color: #593196; }
.ec-ppd { font-size: 11px; color: #7c6d96; text-align: right; margin-top: 2px; }

.ec-specs { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 11px; border-top: 1px solid rgba(89,49,150,0.07); }
.ec-spec { background: #ede8f7; border-radius: 8px; padding: 4px 10px; font-size: 11px; color: #4a3a66; }

.ec-util { margin-top: 12px; }
.ec-util-top { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 10px; color: #7c6d96; }
.ec-util-track { height: 4px; background: rgba(89,49,150,0.1); border-radius: 2px; overflow: hidden; }
.ec-util-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.ec-util-note { font-size: 10px; color: #7c6d96; margin-top: 4px; }

/* Toggle */
.ec-toggle {
  width: 100%; background: rgba(89,49,150,0.03);
  border: 1px solid rgba(89,49,150,0.14);
  border-radius: 13px; padding: 12px 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: #593196;
  transition: all 0.2s; margin-bottom: 0; font-family: inherit;
}
.ec-toggle:hover { background: rgba(89,49,150,0.07); }
.ec-toggle.open { background: rgba(89,49,150,0.07); margin-bottom: 10px; }
.ec-arrow { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(89,49,150,0.1); font-size: 10px; transition: transform 0.3s; }
.ec-toggle.open .ec-arrow { transform: rotate(180deg); }

.ec-collapse { overflow: hidden; max-height: 0; transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1); }
.ec-collapse.open { max-height: 2000px; }
.ec-collapse-inner { display: flex; flex-direction: column; gap: 10px; }

/* Empty */
.ec-empty { background: #faf7ff; border: 1.5px solid rgba(89,49,150,0.15); border-radius: 16px; padding: 30px 20px; text-align: center; }
.ec-empty-icon { font-size: 30px; margin-bottom: 10px; }
.ec-empty-title { font-size: 15px; font-weight: 700; color: #1c0f33; margin-bottom: 6px; }
.ec-empty-text { font-size: 13px; color: #7c6d96; }

/* CTA */
.ec-cta {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(89,49,150,0.07), rgba(124,79,192,0.04));
  border: 1.5px solid rgba(89,49,150,0.2);
  border-radius: 18px; padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}
.ec-cta-label { font-size: 11px; color: #7c6d96; margin-bottom: 3px; }
.ec-cta-name  { font-size: 15px; font-weight: 800; color: #1c0f33; }
.ec-cta-sub   { font-size: 11px; color: #7c6d96; margin-top: 2px; }
.ec-cta-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.ec-disclaimer { text-align: center; font-size: 11px; color: #7c6d96; margin-top: 14px; line-height: 1.5; }

/* Animations */
@keyframes ec-blink  { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes ec-fadeup { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* Responsive */
@media (max-width: 420px) {
  .ec-card-wrap { padding: 20px 16px; }
  .ec-dur-btn { flex: 1 1 calc(33% - 6px); }
  .ec-hours-grid { grid-template-columns: 1fr; }
  .ec-cta { flex-direction: column; }
  .ec-cta-actions { width: 100%; }
  .ec-btn-primary, .ec-btn-ghost { flex: 1; text-align: center; }
}

/* ─── MODAL OVERLAY ──────────────────────────────────────────────────────────── */
.ec-modal-overlay {
  display: none; /* скрыт по умолчанию */
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,5,30,0.55);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ec-modal-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: all;
}
.ec-modal {
  background: #f5f0fd;
  border-radius: 28px;
  width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(89,49,150,0.25);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34,1.36,0.64,1);
  position: relative; padding: 36px 28px 28px;
}
.ec-modal-overlay.open .ec-modal { transform: translateY(0) scale(1); }
.ec-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #ede8f7; border: none; cursor: pointer;
  font-size: 16px; color: #7c6d96;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ec-modal-close:hover { background: rgba(89,49,150,0.15); color: #593196; }
.ec-modal::-webkit-scrollbar { width: 4px; }
.ec-modal::-webkit-scrollbar-thumb { background: rgba(89,49,150,0.2); border-radius: 2px; }

/* ─── TARIFF DETAILS BUTTON ─────────────────────────────────────────────────── */
.ec-details-btn {
  margin-left: auto; background: none; border: 1px solid rgba(89,49,150,0.2);
  border-radius: 8px; padding: 3px 10px; font-size: 11px; color: #7c6d96;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
  white-space: nowrap;
}
.ec-details-btn:hover { background: rgba(89,49,150,0.07); color: #593196; border-color: rgba(89,49,150,0.4); }

/* ─── TARIFF DETAILS POPUP ──────────────────────────────────────────────────── */
.ec-details-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(15,5,30,0.45); backdrop-filter: blur(4px);
  border-radius: inherit;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ec-details-box {
  background: #fff; border-radius: 18px; width: 100%; max-width: 380px;
  padding: 24px 20px 20px; position: relative;
  box-shadow: 0 12px 40px rgba(89,49,150,0.2);
  animation: ec-fadeup 0.2s ease;
}
.ec-details-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #ede8f7; border: none; cursor: pointer;
  font-size: 13px; color: #7c6d96;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ec-details-close:hover { background: rgba(89,49,150,0.15); color: #593196; }
.ec-details-title { font-size: 15px; font-weight: 700; color: #1c0f33; margin-bottom: 16px; }
.ec-details-rows { display: flex; flex-direction: column; gap: 8px; }
.ec-details-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 13px; }
.ec-details-key { color: #7c6d96; flex-shrink: 0; }
.ec-details-val { color: #1c0f33; font-weight: 600; text-align: right; word-break: break-all; }

/* ─── DAYS STEPPER ──────────────────────────────────────────────────────────── */
.ec-days-stepper {
  display: flex; align-items: center; gap: 10px;
  background: rgba(89,49,150,0.05); border: 1px solid rgba(89,49,150,0.15);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 16px;
}
.ec-days-label { font-size: 13px; color: #7c6d96; flex: 1; }
.ec-days-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1.5px solid rgba(89,49,150,0.25);
  color: #593196; font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-family: inherit; flex-shrink: 0;
}
.ec-days-btn:hover:not(:disabled) { background: #593196; color: #fff; border-color: #593196; }
.ec-days-btn:disabled { opacity: 0.3; cursor: default; }
.ec-days-val { font-size: 15px; font-weight: 700; color: #1c0f33; min-width: 44px; text-align: center; }

/* ─── FUP TOOLTIP ───────────────────────────────────────────────────────────── */
.ec-fup-row { padding: 0 0 2px; }
.ec-fup-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #92600a;
  background: #fef9ec; border: 1px solid #f6d860;
  border-radius: 8px; padding: 4px 10px 4px 8px;
}
.ec-fup-q {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #f6d860; color: #92600a;
  font-size: 10px; font-weight: 700; cursor: default; flex-shrink: 0;
}
.ec-fup-tip {
  display: none;
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background: #1c0f33; color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.5;
  padding: 10px 12px; border-radius: 10px;
  pointer-events: none; z-index: 20;
  white-space: normal; text-align: left;
}
.ec-fup-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1c0f33;
}
.ec-fup-q:hover .ec-fup-tip { display: block; }
