/* ══════════════════════════════════════════════════════════
   App Nadjane — PWA Install Button, Progress Bar & iOS Modal
   Compatível com Android (Chrome/Edge) e iOS (Safari)
══════════════════════════════════════════════════════════ */

/* ── Botão de Instalação ───────────────────────────────── */
.btn-pwa-install {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #8B6145 0%, #C4A882 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 9px 20px 9px 16px;
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    transition: box-shadow .3s ease, transform .2s ease;
    box-shadow: 0 4px 16px rgba(139, 97, 69, .35);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    vertical-align: middle;
}

.btn-pwa-install:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(139, 97, 69, .5);
    transform: translateY(-1px);
}

.btn-pwa-install:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(139, 97, 69, .3);
}

.btn-pwa-install .pwa-btn-icon {
    font-size: .9rem;
    flex-shrink: 0;
    display: inline-block;
    line-height: 1;
}

.btn-pwa-install .pwa-btn-text {
    line-height: 1;
    min-width: 68px;
    text-align: center;
}

/* Estado: instalando */
.btn-pwa-install.installing {
    background: linear-gradient(135deg, #6B4226 0%, #8B6145 100%);
    cursor: not-allowed;
    pointer-events: none;
}

/* Estado: instalado */
.btn-pwa-install.installed {
    background: linear-gradient(135deg, #2d7a3a 0%, #34c759 100%);
    box-shadow: 0 4px 16px rgba(52, 199, 89, .35);
    cursor: default;
    pointer-events: none;
}

/* ── Barra de Progresso ────────────────────────────────── */
.pwa-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: rgba(255, 255, 255, .75);
    border-radius: 0 0 50px 50px;
    transition: width .22s ease;
    pointer-events: none;
}

/* ── Animação de rotação (ícone de carregamento) ───────── */
@keyframes pwa-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.pwa-btn-icon.spinning {
    animation: pwa-spin .75s linear infinite;
}

/* ── Modal iOS ─────────────────────────────────────────── */
#pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

#pwa-ios-modal.visible {
    opacity: 1;
    pointer-events: all;
}

.pwa-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, .70);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 12px;
}

.pwa-modal-box {
    position: relative;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 8px 28px 44px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 -8px 48px rgba(20, 16, 12, .22);
    transform: translateY(100%);
    transition: transform .42s cubic-bezier(.34, 1.15, .64, 1);
}

#pwa-ios-modal.visible .pwa-modal-box {
    transform: translateY(0);
}

/* Alça de arrasto (estilo iOS) */
.pwa-modal-handle {
    width: 40px;
    height: 4px;
    background: #E0D8CE;
    border-radius: 2px;
    margin: 12px auto 20px;
}

/* Botão fechar */
.pwa-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #F0EDE8;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B6B6B;
    font-size: .78rem;
    transition: background .2s, color .2s;
    padding: 0;
    line-height: 1;
}

.pwa-modal-close:hover {
    background: #E0DAD2;
    color: #1C1C1C;
}

/* Ícone do app */
.pwa-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    overflow: hidden;
    margin: 0 auto 18px;
    box-shadow: 0 6px 24px rgba(139, 97, 69, .25);
    background: #F8F4EF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-modal-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Título */
.pwa-modal-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 500;
    color: #1C1C1C;
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.2;
}

/* Subtítulo */
.pwa-modal-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem;
    color: #6B6B6B;
    text-align: center;
    margin: 0 0 26px;
    line-height: 1.6;
}

/* Passos */
.pwa-modal-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pwa-modal-steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem;
    color: #3A3A3A;
    line-height: 1.55;
}

.pwa-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #8B6145, #C4A882);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    margin-top: 1px;
}

/* Botão CTA do modal */
.pwa-modal-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, #8B6145 0%, #C4A882 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 15px 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: box-shadow .25s ease, transform .15s ease;
    box-shadow: 0 4px 18px rgba(139, 97, 69, .38);
    -webkit-tap-highlight-color: transparent;
}

.pwa-modal-cta:hover {
    box-shadow: 0 6px 24px rgba(139, 97, 69, .52);
    transform: translateY(-1px);
}

.pwa-modal-cta:active {
    transform: translateY(0);
}

/* Nota rodapé do modal */
.pwa-modal-note {
    font-family: 'DM Sans', sans-serif;
    font-size: .75rem;
    color: #9A9A9A;
    text-align: center;
    margin: 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ── Wrapper do lado direito da nav do appointment ────── */
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Responsivo ───────────────────────────────────────── */
@media (max-width: 991px) {
    .btn-pwa-install {
        font-size: .74rem;
        padding: 8px 16px 8px 13px;
    }
}

@media (max-width: 575px) {
    .btn-pwa-install {
        font-size: .71rem;
        padding: 8px 13px;
        gap: 5px;
    }

    .btn-pwa-install .pwa-btn-text {
        min-width: 56px;
    }

    .pwa-modal-box {
        padding: 8px 18px 36px;
    }

    .pwa-modal-title {
        font-size: 1.35rem;
    }

    .pwa-modal-steps li {
        font-size: .83rem;
    }
}
