/**
 * IMOVZ PWA - banner de instalação
 * Mobile (<=768px): bottom sheet fixo. Desktop: card no canto inferior direito.
 */

.imovz-pwa-banner,
.imovz-pwa-banner *,
.imovz-pwa-banner *::before,
.imovz-pwa-banner *::after {
    box-sizing: border-box;
}

.imovz-pwa-banner {
    position: fixed;
    z-index: 99999;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #0B1F1E;
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 201, 177, 0.18);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    will-change: transform, opacity;
}

.imovz-pwa-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.imovz-pwa-banner[hidden] {
    display: none !important;
}

/* Fechar (X) */
.imovz-pwa-banner__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.imovz-pwa-banner__close:hover,
.imovz-pwa-banner__close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Corpo */
.imovz-pwa-banner__body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 32px;
}

.imovz-pwa-banner__icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #0B1F1E;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    object-fit: cover;
}

.imovz-pwa-banner__text {
    min-width: 0;
    flex: 1 1 auto;
}

.imovz-pwa-banner__title {
    display: block;
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.imovz-pwa-banner__desc {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.74);
}

/* Instruções iOS */
.imovz-pwa-banner__ios {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 201, 177, 0.08);
    border: 1px solid rgba(0, 201, 177, 0.35);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.imovz-pwa-banner__ios[hidden] {
    display: none !important;
}

.imovz-pwa-banner__ios-icon {
    flex: 0 0 auto;
    display: inline-flex;
    color: #00C9B1;
    margin-top: 1px;
}

.imovz-pwa-banner__ios-text {
    margin: 0;
}

.imovz-pwa-banner__ios-text strong {
    color: #ffffff;
    font-weight: 600;
}

/* Ações */
.imovz-pwa-banner__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.imovz-pwa-banner__btn {
    flex: 1 1 0;
    min-height: 46px;
    padding: 10px 16px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.imovz-pwa-banner__btn:active {
    transform: scale(0.98);
}

.imovz-pwa-banner__btn:focus-visible {
    outline: 2px solid #00C9B1;
    outline-offset: 2px;
}

.imovz-pwa-banner__btn[hidden] {
    display: none !important;
}

.imovz-pwa-banner__btn--primary {
    background: #00C9B1;
    color: #0B1F1E;
    box-shadow: 0 6px 18px rgba(0, 201, 177, 0.28);
}

.imovz-pwa-banner__btn--primary:hover {
    background: #00b8a2;
}

.imovz-pwa-banner__btn--secondary {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.imovz-pwa-banner__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Desktop: card no canto inferior direito */
@media (min-width: 769px) {
    .imovz-pwa-banner {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: 380px;
        max-width: calc(100vw - 48px);
        padding: 20px;
        border-radius: 16px;
        box-shadow: 0 20px 56px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(0, 201, 177, 0.18);
        transform: translateY(24px);
    }

    .imovz-pwa-banner.is-visible {
        transform: translateY(0);
    }

    .imovz-pwa-banner__btn {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 9px 18px;
    }

    .imovz-pwa-banner__actions {
        justify-content: flex-end;
    }
}

/* Acessibilidade: sem animação para quem prefere */
@media (prefers-reduced-motion: reduce) {
    .imovz-pwa-banner,
    .imovz-pwa-banner__btn,
    .imovz-pwa-banner__close {
        transition: none !important;
    }
}
