/**
 * Vindhya Millets — PWA Install Banner Styles
 * High-performance, GPU-accelerated, zero-jank mobile install prompt
 */

/* ════════ CUSTOM PWA INSTALL BANNER CARD ════════ */
/* STRICTLY HIDDEN ON DESKTOP & TABLET VIEW (> 768px) */
#vmPwaInstallSheet {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ONLY SHOWN ON MOBILE VIEW (<= 768px) */
@media (max-width: 768px) {
  #vmPwaInstallSheet {
    display: flex !important;
    visibility: visible !important;
    position: fixed !important;
    /* Cleanly floats ABOVE the mobile dock bar (dock height 64px + bottom offset 12px + center arch 12px = 88px) */
    bottom: calc(96px + env(safe-area-inset-bottom, 12px)) !important;
    left: 12px !important;
    right: 12px !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    background: #FFFFFF !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.26), 0 0 0 1.5px rgba(27, 67, 36, 0.14) !important;
    padding: 12px 14px !important;
    z-index: 999980 !important;
    align-items: center !important;
    gap: 12px !important;
    transform: translateY(140%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box !important;
  }

  #vmPwaInstallSheet.vm-show-install {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* When the page does NOT have the mobile floating dock bar */
  body:not(:has(.mobile-bottom-nav)) #vmPwaInstallSheet {
    bottom: calc(20px + env(safe-area-inset-bottom, 12px)) !important;
  }
}

.vm-install-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #1B4324;
  padding: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(27, 67, 36, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vm-install-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vm-install-text-col {
  flex: 1;
  min-width: 0;
}

.vm-install-title {
  font-size: 0.90rem;
  font-weight: 700;
  color: #1B4324;
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.vm-install-desc {
  font-size: 0.74rem;
  color: #64748B;
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vm-install-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vm-btn-pwa-install {
  background: #1B4324;
  color: #FFFFFF;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vm-btn-pwa-install:hover {
  background: #2D5A27;
  transform: translateY(-1px);
}

.vm-btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.vm-btn-pwa-dismiss:hover {
  color: #475569;
  background: #F1F5F9;
}

@media (max-width: 400px) {
  #vmPwaInstallSheet {
    bottom: calc(92px + env(safe-area-inset-bottom, 10px)) !important;
    left: 8px !important;
    right: 8px !important;
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .vm-install-icon-box {
    width: 40px;
    height: 40px;
    padding: 5px;
  }
  .vm-install-title {
    font-size: 0.84rem;
  }
  .vm-install-desc {
    font-size: 0.70rem;
  }
  .vm-btn-pwa-install {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}
