/*
 * WEBGLOBE MAINTAINER NOTES
 *
 * Coordinate installation and service-worker behavior for the selected application scope.
 *
 * The selectors form a contract with the rendered markup and browser interactions. Preserve
 * keyboard focus, disabled/hidden states and the smaller-screen rules when adjusting the
 * cascade; an attractive desktop layout is not sufficient evidence of usable mobile forms.
 *
 * Application identity and service-worker scope determine which installed app owns a page. Keep
 * private account responses out of offline caches and preserve the separation between the two
 * shop installations.
 */
html {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

.pwa-entry-page,
.pwa-offline-page,
.pwa-entry-page *,
.pwa-offline-page *,
.pwa-push-offer,
.pwa-push-offer * {
    box-sizing: border-box;
}

.pwa-install-button {
    width: auto;
    margin: 0;
    border: 1px solid rgba(34, 211, 238, 0.55);
    font: inherit;
    cursor: pointer;
}

.pwa-open-button { text-decoration: none; }

.pwa-install-button[hidden],
.pwa-install-status[hidden] {
    display: none !important;
}

.pwa-install-status {
    max-width: 220px;
    color: inherit;
    font-size: 0.76rem;
    opacity: 0.82;
}

.pwa-push-offer {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    background: rgba(2, 7, 12, 0.78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.pwa-push-offer__panel {
    width: min(100%, 480px);
    max-width: 100%;
    min-width: 0;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - max(2rem, env(safe-area-inset-top)) - max(2rem, env(safe-area-inset-bottom)));
    overflow-y: auto;
    padding: clamp(1.35rem, 5vw, 2rem);
    border: 1px solid rgba(103, 232, 249, 0.46);
    border-radius: 20px 6px 20px 6px;
    color: #e9f8ff;
    background: linear-gradient(145deg, #061522, #082f49);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56), inset 0 1px rgba(255, 255, 255, 0.1);
}

.pwa-push-offer__kicker {
    color: #d9ff43;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.pwa-push-offer__panel h2 {
    margin: 0.55rem 0 0;
    color: #fff;
    font-size: clamp(1.6rem, 6vw, 2.35rem);
    line-height: 1.08;
}

.pwa-push-offer__panel p {
    margin: 0.85rem 0 1.35rem;
    color: #bcd6e8;
    line-height: 1.6;
}

.pwa-push-offer__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr);
    gap: 0.7rem;
}

.pwa-push-offer__actions button {
    min-height: 48px;
    padding: 0.72rem 0.9rem;
    border: 1px solid #22d3ee;
    border-radius: 8px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.pwa-push-offer__activate {
    color: #02111d;
    background: linear-gradient(135deg, #d9ff43, #67e8f9);
}

.pwa-push-offer__later {
    color: #dff9ff;
    background: rgba(8, 47, 73, 0.78);
}

.pwa-push-offer__actions button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.pwa-entry-page,
.pwa-offline-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: grid;
    place-items: center;
    overflow-x: hidden;
    overflow-x: clip;
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    color: #e9f8ff;
    background: radial-gradient(circle at 18% 18%, rgba(34, 211, 238, 0.22), transparent 32%), linear-gradient(145deg, #020d18, #07345a);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwa-entry-card,
.pwa-offline-card {
    width: min(100%, 680px);
    max-width: 100%;
    min-width: 0;
    padding: clamp(1.5rem, 6vw, 3.5rem);
    border: 1px solid rgba(103, 232, 249, 0.36);
    border-radius: 28px 8px 28px 8px;
    background: rgba(3, 20, 35, 0.9);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), inset 0 1px rgba(255, 255, 255, 0.12);
    text-align: center;
}

.pwa-entry-icon {
    width: 112px;
    height: 112px;
    border-radius: 26px;
    box-shadow: 0 0 44px rgba(34, 211, 238, 0.22);
}

.pwa-entry-kicker {
    display: block;
    margin: 1rem 0 0.5rem;
    color: #67e8f9;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.pwa-entry-card h1,
.pwa-offline-card h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 7vw, 3.4rem);
}

.pwa-entry-card p,
.pwa-offline-card p {
    margin: 1rem auto 1.5rem;
    max-width: 540px;
    color: #bcd6e8;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.pwa-entry-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.pwa-primary-action,
.pwa-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0.8rem 1rem;
    border: 1px solid #22d3ee;
    border-radius: 10px;
    color: #02111d;
    background: linear-gradient(135deg, #67e8f9, #38bdf8);
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.pwa-primary-action:disabled {
    cursor: wait;
    opacity: 0.72;
}

.pwa-secondary-action {
    color: #dff9ff;
    background: rgba(8, 47, 73, 0.8);
}

.pwa-entry-install {
    width: 100%;
    margin-top: 0.85rem;
}

@media (max-width: 560px) {
    .pwa-entry-actions { grid-template-columns: 1fr; }
    .pwa-push-offer__actions { grid-template-columns: 1fr; }
}

@media (max-height: 560px) and (orientation: landscape) {
    .pwa-push-offer { place-items: start center; }
    .pwa-push-offer__panel { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-push-offer *, .pwa-entry-page *, .pwa-offline-page * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
