/* Globelogs eSIM page — design mapped from mobile mockup (Globelogs-eSIMs / Puffer).
   Placeholder catalog + gated purchase until the eSIM provider backend ships. */

.esim-page {
  --esim-magenta: #e1147a;
  --esim-magenta-dark: #be123c;
  --esim-magenta-hover: #c20e66;
  --esim-blush: #fff1f2;
  --esim-blush-border: #fecdd3;
  --esim-teal: #0d9488;
  --esim-teal-light: #f0fdfa;
  --esim-teal-border: #ccfbf1;
  --esim-green: #10b981;
  --esim-green-bg: #ecfdf5;
  --esim-green-border: #a7f3d0;
  --esim-radius: 16px;
  --esim-radius-md: 12px;
  --esim-shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.esim-page .esim-hero {
  background: linear-gradient(135deg, #fce4f0 0%, #f3e8ff 100%);
  border-radius: var(--esim-radius);
  padding: 18px 20px;
  color: #171217;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(192, 38, 211, 0.12);
}

.esim-page .esim-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.esim-page .esim-hero-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #171217;
}

.esim-page .esim-hero-chip {
  width: 28px;
  height: 28px;
  background: var(--esim-magenta);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.esim-page .esim-hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.esim-page .esim-soon-badge {
  background: rgba(225, 20, 122, 0.18);
  border: 1px solid rgba(225, 20, 122, 0.45);
  color: #000;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.esim-page .esim-balance-pill {
  text-align: right;
}

.esim-page .esim-balance-pill span {
  font-size: 9.5px;
  font-weight: 700;
  color: #918793;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
}

.esim-page .esim-balance-pill strong {
  font-size: 15px;
  font-weight: 800;
  color: #171217;
}

.esim-page .esim-hero-sub {
  font-size: 11px;
  color: #655c67;
  line-height: 1.45;
  margin: 0;
}

.esim-page .esim-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.esim-page .esim-search-icon {
  position: absolute;
  left: 12px;
  color: var(--secondary);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.esim-page #esim-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--esim-radius-md);
  padding: 11px 12px 11px 36px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}

.esim-page #esim-search-input:focus {
  border-color: var(--esim-magenta);
  box-shadow: 0 0 0 3px rgba(225, 20, 122, 0.1);
}

.esim-page .esim-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.esim-page .esim-tabs::-webkit-scrollbar {
  display: none;
}

.esim-page .esim-tab {
  height: 32px;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--secondary);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  font-family: inherit;
}

.esim-page .esim-tab:hover {
  border-color: var(--esim-blush-border);
}

.esim-page .esim-tab.active {
  background: var(--esim-magenta);
  color: #fff;
  border-color: var(--esim-magenta);
  box-shadow: 0 3px 10px rgba(225, 20, 122, 0.25);
}

.esim-page .esim-regions {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.esim-page .esim-regions::-webkit-scrollbar {
  display: none;
}

.esim-page .esim-chip {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.esim-page .esim-chip:hover {
  border-color: var(--esim-blush-border);
}

.esim-page .esim-chip.active {
  background: var(--esim-blush);
  border-color: var(--esim-magenta);
  color: var(--esim-magenta);
  font-weight: 800;
}

.esim-page .esim-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--secondary);
}

.esim-page .esim-meta strong {
  color: var(--text);
  font-weight: 800;
}

.esim-page .esim-meta-instant {
  color: var(--esim-teal);
  font-weight: 700;
}

.esim-page .esim-hero,
.esim-page .esim-search,
.esim-page .esim-tabs,
.esim-page .esim-regions,
.esim-page .esim-meta,
.esim-page .esim-list {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.esim-page .esim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.esim-page .esim-dest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--esim-radius-md);
  padding: 12px 14px;
  box-shadow: var(--esim-shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
  width: 100%;
  gap: 10px;
}

.esim-page .esim-dest:hover {
  border-color: var(--esim-blush-border);
  transform: translateY(-1px);
}

.esim-page .esim-dest-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.esim-page .esim-dest-flag {
  font-size: 24px;
  width: 36px;
  height: 36px;
  background: var(--bg, #fafafb);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.esim-page .esim-dest-info {
  min-width: 0;
}

.esim-page .esim-dest-info h3 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.esim-page .esim-dest-net {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--esim-teal);
  display: flex;
  align-items: center;
  gap: 4px;
}

.esim-page .esim-dest-right {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
  flex-shrink: 0;
}

.esim-page .esim-dest-right .esim-from {
  font-size: 10px;
  color: var(--secondary);
  font-weight: 600;
  display: block;
}

.esim-page .esim-dest-right strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.esim-page .esim-dest-right svg {
  color: var(--secondary);
  width: 16px;
  height: 16px;
}

.esim-page .esim-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* ─── Modals (bottom sheets, matches gift-cards conventions) ────────── */
.esim-page .esim-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: gcFadeIn 0.2s ease-in-out;
}

.esim-page .esim-modal-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  animation: gcSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.esim-page .esim-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.esim-page .esim-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.esim-page .esim-modal-close {
  background: var(--bg, #f1f5f9);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-weight: 700;
  font-family: inherit;
}

.esim-page .esim-country-pill {
  background: var(--esim-teal-light);
  border: 1px solid var(--esim-teal-border);
  border-radius: var(--esim-radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.esim-page .esim-country-flag {
  font-size: 22px;
}

.esim-page .esim-country-pill h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.esim-page .esim-country-pill p {
  font-size: 11px;
  color: var(--esim-teal);
  font-weight: 600;
  margin: 0;
}

.esim-page .esim-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.esim-page .esim-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.esim-page .esim-plan-btn {
  background: var(--bg, #fafafb);
  border: 1.5px solid var(--border);
  border-radius: var(--esim-radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.esim-page .esim-plan-btn:hover {
  border-color: var(--esim-blush-border);
}

.esim-page .esim-plan-btn.active {
  background: var(--esim-blush);
  border-color: var(--esim-magenta);
}

.esim-page .esim-plan-btn strong.esim-data-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.esim-page .esim-plan-btn span.esim-duration {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--secondary);
}

.esim-page .esim-plan-btn strong.esim-plan-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--esim-magenta);
  margin-top: 4px;
}

.esim-page .esim-input {
  width: 100%;
  background: var(--bg, #fafafb);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  margin-top: 4px;
  font-family: inherit;
}

.esim-page .esim-input:focus {
  border-color: var(--esim-magenta);
  background: var(--surface);
}

.esim-page .esim-receipt {
  background: var(--bg, #f8fafc);
  border-radius: var(--esim-radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}

.esim-page .esim-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--secondary);
}

.esim-page .esim-receipt-row strong {
  color: var(--text);
  text-align: right;
}

.esim-page .esim-receipt-total {
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text);
}

.esim-page .esim-receipt-total span:last-child {
  color: var(--esim-magenta);
}

.esim-page .esim-pay-btn {
  background: var(--esim-magenta);
  color: #fff;
  border: none;
  border-radius: var(--esim-radius-md);
  padding: 13px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(225, 20, 122, 0.28);
  font-family: inherit;
}

.esim-page .esim-pay-btn:hover {
  background: var(--esim-magenta-hover);
}

.esim-page .esim-soon-note {
  font-size: 10.5px;
  color: var(--secondary);
  text-align: center;
  margin: -4px 0 0;
  line-height: 1.5;
}

.esim-page .esim-activation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.esim-page .esim-qr-frame {
  width: 170px;
  height: 170px;
  background: #fff;
  border: 2px dashed var(--esim-magenta);
  border-radius: var(--esim-radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--esim-shadow-card);
  color: var(--text);
}

.esim-page .esim-qr-hint {
  font-size: 10px;
  font-weight: 700;
  color: var(--secondary);
}

.esim-page .esim-activation-note {
  font-size: 11.5px;
  color: var(--secondary);
  line-height: 1.5;
  margin: 0;
}

.esim-page .esim-code-box {
  width: 100%;
  background: var(--bg, #fafafb);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.esim-page .esim-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.esim-page .esim-code-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
}

.esim-page .esim-code-box code {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.esim-page .esim-copy-btn {
  background: var(--esim-blush);
  color: var(--esim-magenta);
  border: 1px solid var(--esim-blush-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.esim-page .esim-copy-btn.copied {
  background: var(--esim-green-bg);
  color: var(--esim-green);
  border-color: var(--esim-green-border);
}

.esim-page .esim-done-btn {
  width: 100%;
  background: var(--esim-green);
  box-shadow: none;
}

.esim-page .esim-done-btn:hover {
  background: #059669;
}

@media (min-width: 1024px) {
  .esim-page .esim-hero,
  .esim-page .esim-search,
  .esim-page .esim-tabs,
  .esim-page .esim-regions,
  .esim-page .esim-meta,
  .esim-page .esim-list { max-width: none; }
  .esim-page .esim-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
  .esim-page .esim-plan-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}