/* PageLife.gr PWA Install & App Manager v0.16 */

/* Desktop stays as the proven V2-style floating trigger. */
.pagelife-pwa-desktop-button[hidden],
.pagelife-pwa-mobile-card[hidden],
.pagelife-pwa-dialog[hidden],
#pagelife-pwa-install-root[hidden] {
    display: none !important;
}

.pagelife-pwa-desktop-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 999px;
    background: #fff;
    color: #161616;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,.14);
}

.pagelife-pwa-desktop-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
}

/* Mobile only: inline top card, never fixed. */
.pagelife-pwa-mobile-card {
    display: none;
}

@media (max-width: 767px) {
    .pagelife-pwa-mobile-card {
        position: relative;
        z-index: 30;
        display: grid;
        grid-template-columns: 46px minmax(0,1fr) auto;
        grid-template-areas:
            "icon copy close"
            "icon button button";
        gap: 8px 10px;
        align-items: center;
        width: calc(100% - 24px);
        margin: 10px 12px 14px;
        padding: 11px 12px;
        box-sizing: border-box;
        border: 1px solid rgba(0,0,0,.08);
        border-radius: 15px;
        background: #fff7f7;
        color: #1c1c1c;
        box-shadow: 0 3px 14px rgba(0,0,0,.08);
    }

    .pagelife-pwa-mobile-icon {
        grid-area: icon;
        width: 46px;
        height: 46px;
        border-radius: 10px;
        object-fit: cover;
        background: #fff;
    }

    .pagelife-pwa-mobile-copy {
        grid-area: copy;
        min-width: 0;
    }

    .pagelife-pwa-mobile-title {
        margin-bottom: 2px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.2;
    }

    .pagelife-pwa-mobile-text {
        font-size: 12.5px;
        line-height: 1.3;
        color: #555;
    }

    .pagelife-pwa-mobile-button {
        grid-area: button;
        justify-self: start;
        min-height: 35px;
        padding: 7px 16px;
        border: 0;
        border-radius: 999px;
        background: #d50000;
        color: #fff;
        font: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .pagelife-pwa-mobile-close {
        grid-area: close;
        align-self: start;
        justify-self: end;
        width: 29px;
        height: 29px;
        margin: -5px -5px 0 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #666;
        font-size: 22px;
        line-height: 29px;
        cursor: pointer;
    }

    .pagelife-pwa-desktop-button {
        display: none !important;
    }
}

/* iOS instructions dialog */
.pagelife-pwa-dialog {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: end center;
    padding: 14px;
}

.pagelife-pwa-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.42);
}

.pagelife-pwa-dialog-card {
    position: relative;
    width: min(100%,430px);
    padding: 22px 20px 20px;
    border-radius: 18px;
    background: #fff;
    color: #161616;
    box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.pagelife-pwa-dialog-card h2 {
    margin: 0 36px 16px 0;
    font-size: 20px;
}

.pagelife-pwa-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
}

.pagelife-pwa-ios-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagelife-pwa-ios-steps li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
}

.pagelife-pwa-step-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(0,0,0,.06);
}

html.pagelife-pwa-dialog-open,
html.pagelife-pwa-dialog-open body {
    overflow: hidden;
}


/* v0.16 test marker. The mobile card itself remains a normal-flow element. */
@media (max-width: 767px) {
    .pagelife-pwa-version {
        position: absolute;
        right: 10px;
        bottom: 7px;
        padding: 2px 5px;
        border-radius: 999px;
        background: rgba(255,255,255,.88);
        color: #666;
        font-size: 9px;
        line-height: 1.2;
        font-weight: 700;
        pointer-events: none;
        user-select: none;
    }
}
