/* ===== ANDROID APP PROMO (see app-promo.php) =====
   Uses the homepage tokens from testebi-style.css, with fallbacks so the
   same markup also works on pages that don't load that stylesheet. */

/* App is Android-only — hide every promo on iPhone/iPad. */
.is-ios .app-banner,
.is-ios .app-card,
.is-ios .app-side,
.is-ios .app-nav-link,
.is-ios .app-top,
.is-ios .app-sky { display: none !important; }

/* ----- Smart banner (Android phones only) ----- */
.app-banner { display: none; }

.is-android .app-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 6px;
  background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-family: var(--font, "Noto Sans Georgian", sans-serif);
  position: relative;
  z-index: 70;
}

.is-android.app-banner-off .app-banner { display: none; }

.app-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-subtle, #94a3b8);
  border-radius: 9999px;
  cursor: pointer;
}

.app-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.app-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.app-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-text span {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-banner-cta {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--blue, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.app-banner-cta:active { background: var(--blue-hover, #1d4ed8); }

/* ----- Homepage card ----- */
.app-card {
  display: flex;
  gap: 32px;
  align-items: center;
  margin: 48px auto 0;
  max-width: 768px;
  width: 100%;
  padding: 28px 24px;
  border-radius: var(--radius-xl, 20px);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(37,99,235,.10) 0%, rgba(37,99,235,0) 55%),
    var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
  font-family: var(--font, "Noto Sans Georgian", sans-serif);
}

@media (min-width: 640px) { .app-card { padding: 36px 40px; } }

.dark .app-card {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(59,130,246,.16) 0%, rgba(59,130,246,0) 55%),
    var(--bg-card);
}

.app-card-main { flex: 1; min-width: 0; }

.app-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.app-card-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(37,99,235,.25);
}

.app-card-badge {
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 6px;
  border-radius: 9999px;
  background: var(--emerald-bg, #ecfdf5);
  color: var(--emerald, #059669);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.dark .app-card-badge { color: #34d399; }

.app-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
  color: var(--text, #0f172a);
}

@media (min-width: 640px) { .app-card-title { font-size: 24px; } }

.app-card-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted, #64748b);
  margin-bottom: 16px;
}

.app-card-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 20px;
  margin-bottom: 20px;
}

@media (min-width: 560px) { .app-card-features { grid-template-columns: 1fr 1fr; } }

.app-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text, #0f172a);
}

.app-card-features svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--emerald, #059669);
}

.dark .app-card-features svg { color: #34d399; }

.app-card-store {
  display: inline-block;
  line-height: 0;
  transition: transform var(--transition, .18s ease);
}

.app-card-store:hover { transform: translateY(-1px); }
.app-card-store img { width: 180px; height: auto; }

/* QR is only useful on desktop — on a phone, the badge is one tap away. */
.app-card-qr { display: none; }

@media (min-width: 768px) {
  .is-desktop .app-card-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
}

.app-card-qr img {
  width: 132px;
  height: 132px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
}

.app-card-qr span {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

/* ----- Sidebar box (desktop sidebar) ----- */
.app-side {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: auto 12px 12px;
  padding: 12px;
  border-radius: var(--radius-lg, 16px);
  background: var(--blue-light, #eff6ff);
  text-decoration: none;
  transition: background var(--transition, .18s ease);
}

.app-side:hover { background: #dbeafe; }
.dark .app-side:hover { background: rgba(59,130,246,.2); }

.app-side-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.app-side-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.app-side-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-text, #1d4ed8);
}

.app-side-text > span {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* ----- "New" pill next to nav links ----- */
.app-nav-new {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9999px;
  background: var(--emerald, #059669);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}

/* ----- Top ad-slot banner (mobile/tablet, replaces the top ad) ----- */
.app-top {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 672px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: var(--radius-lg, 16px);
  background:
    radial-gradient(circle at 92% 18%, rgba(255,255,255,.18) 0 60px, transparent 61px),
    radial-gradient(circle at 78% 110%, rgba(255,255,255,.10) 0 90px, transparent 91px),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #4338ca 100%);
  color: #fff;
  text-decoration: none;
  font-family: var(--font, "Noto Sans Georgian", sans-serif);
  /* no shadow: the .top-banner-ad slot clips overflow */
}

@media (min-width: 480px) { .app-top { gap: 22px; padding: 22px 28px; } }

.app-top-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  outline: 2px solid rgba(255,255,255,.35);
}

@media (min-width: 480px) { .app-top-icon { width: 84px; height: 84px; border-radius: 20px; } }

.app-top-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-top-label {
  padding: 2px 9px;
  margin-bottom: 6px;
  border-radius: 9999px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.app-top-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}

@media (min-width: 480px) { .app-top-title { font-size: 24px; } }

.app-top-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,.85);
}

@media (min-width: 480px) { .app-top-sub { font-size: 14px; } }

.app-top-store {
  width: 150px;
  height: auto;
  margin-top: 10px;
  transition: transform var(--transition, .18s ease);
}

.app-top:hover .app-top-store { transform: translateY(-1px); }

/* ----- Desktop skyscraper (160×600, replaces the left side ad) ----- */
.app-sky {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  min-height: 600px;
  padding: 24px 12px 16px;
  border-radius: var(--radius-lg, 16px);
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.16) 0 70px, transparent 71px),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,.08) 0 110px, transparent 111px),
    linear-gradient(170deg, #2563eb 0%, #1d4ed8 55%, #4338ca 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: var(--font, "Noto Sans Georgian", sans-serif);
}

.app-sky-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  outline: 2px solid rgba(255,255,255,.35);
  margin-bottom: 14px;
}

.app-sky-label {
  padding: 2px 9px;
  margin-bottom: 8px;
  border-radius: 9999px;
  background: rgba(255,255,255,.18);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.app-sky-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.app-sky-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.85);
}

.app-sky-features {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-self: stretch;
  text-align: left;
}

.app-sky-features li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.app-sky-features svg { flex-shrink: 0; margin-top: 1px; color: #6ee7b7; }

.app-sky-qr {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,.85);
}

.app-sky-qr img {
  width: 112px;
  height: 112px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
}

.app-sky-store {
  width: 136px;
  height: auto;
  margin-top: 12px;
  transition: transform var(--transition, .18s ease);
}

.app-sky:hover .app-sky-store { transform: translateY(-1px); }

/* appPromoBadge(..., 'auto'): black button in light mode, white in dark mode */
.app-badge-dark { display: none; }
.dark .app-badge-light { display: none; }
.dark .app-badge-dark { display: inline; }

/* Test pages: the top ad slot sits right under the header — give it air. */
.alte-top-banner .app-top { margin-top: 16px; }

/* ----- App popup (test pages) ----- */
.app-pop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-family: "Google Sans", "Noto Sans Georgian", sans-serif;
}

.app-pop-backdrop.open { display: flex; animation: appPopFade .2s ease both; }
.is-ios .app-pop-backdrop { display: none !important; }

.app-pop {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px 24px 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.16) 0 90px, transparent 91px),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,.08) 0 130px, transparent 131px),
    linear-gradient(160deg, #2563eb 0%, #1d4ed8 55%, #4338ca 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.45);
  animation: appPopIn .25s cubic-bezier(.34,1.3,.64,1) both;
}

.app-pop-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
}

.app-pop-close:hover { background: rgba(255,255,255,.25); }

.app-pop-icon {
  display: block;
  margin: 0 auto 14px;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  outline: 2px solid rgba(255,255,255,.35);
}

.app-pop-label {
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 8px;
  border-radius: 9999px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.app-pop-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: #fff;
}

.app-pop-sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,.85);
}

.app-pop-features {
  list-style: none;
  margin: 16px auto 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.app-pop-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.app-pop-features svg { flex-shrink: 0; margin-top: 2px; color: #6ee7b7; }

/* QR only on desktop — on a phone the button is one tap away. */
.app-pop-qr { display: none; }

.is-desktop .app-pop-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
}

.app-pop-qr img {
  width: 120px;
  height: 120px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
}

.app-pop-cta {
  display: inline-block;
  margin-top: 18px;
  line-height: 0;
  transition: transform .18s ease;
}

.app-pop-cta:hover { transform: translateY(-1px); }

.app-pop-no {
  display: block;
  margin: 10px auto 0;
  padding: 8px 12px;
  border: none;
  background: none;
  color: rgba(255,255,255,.75);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.app-pop-no:hover { color: #fff; }

@keyframes appPopFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes appPopIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .app-pop-backdrop.open, .app-pop { animation: none; }
}
