/* eSIM Mongolia — Capacitor mobile shell styles */

:root {
  --esm-safe-top: env(safe-area-inset-top, 0px);
  --esm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --esm-safe-left: env(safe-area-inset-left, 0px);
  --esm-safe-right: env(safe-area-inset-right, 0px);
  --esm-nav-height: 62px;
}

html.esm-capacitor {
  -webkit-text-size-adjust: 100%;
}

body.esm-native-app {
  padding-top: var(--esm-safe-top);
  padding-left: var(--esm-safe-left);
  padding-right: var(--esm-safe-right);
  padding-bottom: calc(var(--esm-nav-height) + var(--esm-safe-bottom) + 8px);
}

/* Native bottom nav replaces the sticky Call/Book/eSIM bar.
   That bar's "Захиалах" always opened "Бүтэн аяллын захиалга"
   and sat on top of hotel search — hide it in the app shell. */
body.esm-native-app .tp-sticky-mobile {
  display: none !important;
}

/* Fixed bottom navigation */
.esm-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10030;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding-bottom: var(--esm-safe-bottom);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.esm-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 6px;
  text-decoration: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  min-height: var(--esm-nav-height);
}

.esm-nav-item.active {
  color: #2563eb;
}

.esm-nav-icon {
  font-size: 20px;
  line-height: 1;
}

/* Offline overlay */
.esm-offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.92);
  padding: 24px;
}

.esm-offline-overlay.visible {
  display: flex;
}

.esm-offline-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 340px;
  text-align: center;
}

.esm-offline-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.esm-offline-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.esm-offline-card p {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 14px;
}

.esm-offline-retry {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
}

/* Network error banner */
.esm-network-banner {
  position: fixed;
  top: calc(var(--esm-safe-top) + 8px);
  left: 12px;
  right: 12px;
  z-index: 10040;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  display: none;
  text-align: center;
}

.esm-network-banner.visible {
  display: block;
}

/* Pull-to-refresh hint */
body.esm-ptr-ready::before {
  content: "↓ Шинэчлэх";
  position: fixed;
  top: calc(var(--esm-safe-top) + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 10035;
}

/* Modal safe area on notched iPhones */
.esm-capacitor .tp-modal,
.esm-capacitor .tp-assist-panel {
  padding-top: var(--esm-safe-top);
  padding-bottom: var(--esm-safe-bottom);
}

/* Hide desktop nav clutter on native */
.esm-native-app .tp-nav-links {
  display: none;
}

@media (min-width: 900px) {
  body.esm-native-app {
    padding-bottom: calc(var(--esm-nav-height) + var(--esm-safe-bottom));
  }
}
