/**
 * MiRestoApp - PWA Installation Component Styles
 */

/* ── REGLA DE ORO: Ocultar en Desktop (pantallas grandes) ────────────────── */
@media (min-width: 992px) {
    .mr-pwa-banner,
    .mr-pwa-header-btn,
    .btn-install-pwa,
    #mr-pwa-banner-container {
        display: none !important;
    }
}

/* ── Banner Flotante Inferior (Mobile / Tablet) ──────────────────────────── */
.mr-pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    width: calc(100% - 32px);
    max-width: 460px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(26, 60, 26, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(47, 138, 59, 0.25);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s ease;
    backdrop-filter: blur(10px);
}

.mr-pwa-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.mr-pwa-banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: #2f8a3b;
}

.mr-pwa-banner-content {
    flex: 1;
    min-width: 0;
}

.mr-pwa-banner-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f2a1f;
    margin: 0 0 2px 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mr-pwa-banner-desc {
    font-size: 0.76rem;
    color: #5f6f61;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mr-pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mr-pwa-btn-install {
    background: linear-gradient(135deg, #2f8a3b 0%, #246d2f 100%);
    color: #ffffff !important;
    border: none;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(47, 138, 59, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.mr-pwa-btn-install:hover,
.mr-pwa-btn-install:focus {
    background: linear-gradient(135deg, #287732 0%, #1e5927 100%);
    box-shadow: 0 6px 16px rgba(47, 138, 59, 0.45);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.mr-pwa-btn-install:active {
    transform: scale(0.97);
}

.mr-pwa-btn-close {
    background: transparent;
    border: none;
    color: #8a9a8c;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
}

.mr-pwa-btn-close:hover {
    background: #eef5ed;
    color: #1f2a1f;
}

/* ── Modal / Bottom Sheet para Guía de Instalación (iOS y Android Fallback) ── */
.mr-pwa-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 25, 16, 0.65);
    backdrop-filter: blur(5px);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mr-pwa-modal-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.mr-pwa-modal-sheet {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 32px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.mr-pwa-modal-backdrop.is-visible .mr-pwa-modal-sheet {
    transform: translateY(0);
}

.mr-pwa-modal-handle {
    width: 40px;
    height: 5px;
    background: #d8e4d6;
    border-radius: 3px;
    margin: -8px auto 16px;
}

.mr-pwa-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.mr-pwa-modal-logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: #2f8a3b;
}

.mr-pwa-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1f2a1f;
    margin: 0 0 3px 0;
}

.mr-pwa-modal-subtitle {
    font-size: 0.82rem;
    color: #5f6f61;
    margin: 0;
}

.mr-pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mr-pwa-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7faf5;
    border: 1px solid #e3ede1;
    border-radius: 16px;
    padding: 12px 14px;
}

.mr-pwa-step-num {
    width: 28px;
    height: 28px;
    background: #2f8a3b;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mr-pwa-step-text {
    flex: 1;
    font-size: 0.86rem;
    color: #273328;
    line-height: 1.35;
    margin: 0;
}

.mr-pwa-step-text strong {
    color: #1a4d21;
}

.mr-pwa-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #cfded0;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.95rem;
    color: #2f8a3b;
    vertical-align: middle;
    margin: 0 2px;
}

.mr-pwa-modal-btn-dismiss {
    width: 100%;
    background: #2f8a3b;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(47, 138, 59, 0.3);
    transition: background 0.2s ease, transform 0.15s ease;
}

.mr-pwa-modal-btn-dismiss:hover {
    background: #246d2f;
}

/* ── Topbar Badge (sólo móvil/tablet) ────────────────────────────────────── */
.mr-pwa-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2f8a3b, #246d2f);
    border: none;
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(47, 138, 59, 0.3);
}

.mr-pwa-header-btn:hover {
    background: linear-gradient(135deg, #246d2f, #1b5223);
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(47, 138, 59, 0.4);
}

/* ── Toast de Éxito ───────────────────────────────────────────────────────── */
.mr-pwa-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #246d2f;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(36, 109, 47, 0.35);
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.mr-pwa-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

@media (max-width: 576px) {
    .mr-pwa-banner {
        bottom: 12px;
        width: calc(100% - 20px);
        padding: 11px 13px;
        gap: 10px;
    }
    .mr-pwa-banner-icon {
        width: 42px;
        height: 42px;
    }
    .mr-pwa-banner-title {
        font-size: 0.88rem;
    }
    .mr-pwa-banner-desc {
        font-size: 0.74rem;
    }
    .mr-pwa-btn-install {
        padding: 7px 12px;
        font-size: 0.80rem;
    }
}
