/* ============================================================
   PWA INSTALL BANNER - Chỉ hiển thị trên Mobile
   ============================================================ */

/* Overlay nền mờ */
.pwa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Banner trượt từ trên xuống */
.pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(-110%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0 12px;
}

.pwa-banner.show {
    transform: translateY(0);
}

.pwa-banner__card {
    max-width: 480px;
    margin: 12px auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: pwaSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pwaSlideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header banner */
.pwa-banner__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
}

.pwa-banner__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EE4D2D, #FF7337);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
}

.pwa-banner__icon img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.pwa-banner__title {
    font-size: 15px;
    font-weight: 800;
    color: #222;
    line-height: 1.3;
}

.pwa-banner__subtitle {
    font-size: 12px;
    color: #6B7280;
    margin-top: 2px;
    line-height: 1.4;
}

/* Nút đóng */
.pwa-banner__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F4F6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.pwa-banner__close:hover {
    background: #E5E7EB;
}

.pwa-banner__close svg {
    width: 14px;
    height: 14px;
    stroke: #6B7280;
}

/* Body: lợi ích */
.pwa-banner__benefits {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
}

.pwa-banner__benefit {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #F9FAFB;
    border: 1px solid #F3F4F6;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
}

.pwa-banner__benefit span {
    font-size: 13px;
}

/* Footer: nút hành động */
.pwa-banner__actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #F3F4F6;
}

.pwa-banner__btn-install {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #EE4D2D, #FF7337);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.pwa-banner__btn-install:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.4);
}

.pwa-banner__btn-install:active {
    transform: scale(0.98);
}

.pwa-banner__btn-later {
    padding: 12px 16px;
    background: #F3F4F6;
    color: #6B7280;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
}

.pwa-banner__btn-later:hover {
    background: #E5E7EB;
}

/* ===== HƯỚNG DẪN iOS (không có beforeinstallprompt) ===== */
.pwa-ios-steps {
    padding: 12px 16px 16px;
    border-top: 1px solid #F3F4F6;
}

.pwa-ios-steps__title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
}

.pwa-ios-steps__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pwa-ios-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #EE4D2D;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.pwa-ios-step__text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.pwa-ios-step__text strong {
    color: #EE4D2D;
}

.pwa-ios-step__icon {
    display: inline-flex;
    vertical-align: middle;
    margin: 0 2px;
}

/* ===== CHỈ HIỂN THỊ TRÊN MOBILE ===== */
@media (min-width: 768px) {

    .pwa-banner,
    .pwa-overlay {
        display: none !important;
    }
}

/* Safe area cho iPhone notch */
@supports (padding-top: env(safe-area-inset-top)) {
    .pwa-banner {
        padding-top: env(safe-area-inset-top);
    }
}