/* ==========================================================================
   PWA - Estilos Customizados (Offline Banner & iOS Prompt)
   ========================================================================== */

/* 1. Banner Global de Conectividade Offline */
.pwa-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100000;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.pwa-offline-banner.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.pwa-offline-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Ajuste no corpo da página quando o banner offline estiver ativo */
body:has(.pwa-offline-banner:not(.hidden)) {
    margin-top: 40px !important;
}

/* 2. Banner de Instalação para iOS (Safari) */
.pwa-ios-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: calc(100% - 40px);
    max-width: 420px;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-ios-prompt.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px) !important;
    pointer-events: none;
}

.pwa-ios-prompt-card {
    position: relative;
    background: var(--bg-surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-highlight);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 30px rgba(var(--brand-primary-rgb), 0.15);
    color: var(--text-main);
    text-align: left;
}

.pwa-ios-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 0.5;
    padding: 5px;
    transition: color 0.2s;
}

.pwa-ios-close:hover {
    color: var(--text-main);
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-right: 20px;
}

.pwa-ios-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-right: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pwa-ios-title-container {
    display: flex;
    flex-direction: column;
}

.pwa-ios-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    line-height: 1.2;
}

.pwa-ios-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 3px 0 0 0;
    line-height: 1.2;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}

.pwa-ios-number {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 22px;
    height: 22px;
    background: rgba(var(--brand-primary-rgb), 0.15);
    color: var(--brand-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50%;
    margin-top: 2px;
}

.pwa-ios-text {
    color: var(--text-main);
    line-height: 1.5;
}

.pwa-ios-icon {
    color: var(--brand-primary);
    font-size: 1.05rem;
    margin: 0 2px;
    vertical-align: middle;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 40px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}
