/* Ana ekrana ekle — giriş sonrası banner + üst Yükle */
.ayka-pwa-install {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #0c1526 0%, #0f172a 100%);
    color: #f8fafc;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.35);
    border-top: 1px solid rgba(0, 174, 239, 0.35);
}

.ayka-pwa-install[hidden] {
    display: none !important;
}

.ayka-pwa-install__text {
    flex: 1 1 auto;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 500;
}

.ayka-pwa-install__btn {
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(180deg, #00aeef, #0088c7);
    color: #fff !important;
    cursor: pointer;
    touch-action: manipulation;
}

.ayka-pwa-install__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
}

.ayka-pwa-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.25rem 0.65rem;
    margin-right: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 174, 239, 0.45);
    background: rgba(0, 174, 239, 0.12);
    color: #0088c7 !important;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.ayka-pwa-header-btn i {
    font-size: 0.85rem;
}

/* Adım adım yükleme rehberi */
body.ayka-pwa-guide-open {
    overflow: hidden;
}

.ayka-pwa-guide {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.ayka-pwa-guide[hidden] {
    display: none !important;
}

.ayka-pwa-guide__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
}

.ayka-pwa-guide__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: min(88vh, 640px);
    overflow: auto;
    border-radius: 16px;
    padding: 1rem 1rem 1.1rem;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.35);
}

.ayka-pwa-guide__x {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.ayka-pwa-guide__title {
    margin: 0 2rem 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0c1526;
}

.ayka-pwa-guide__intro {
    margin: 0 0 0.75rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #475569;
}

.ayka-pwa-guide__steps {
    margin: 0 0 0.85rem;
    padding-left: 1.15rem;
}

.ayka-pwa-guide__steps li {
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.45;
    font-weight: 600;
    color: #0f172a;
}

.ayka-pwa-guide__hint {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #1e40af;
}

.ayka-pwa-guide__ok {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    background: linear-gradient(180deg, #00aeef, #0088c7);
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
}

@media (min-width: 769px) {
    .ayka-pwa-install {
        left: auto;
        right: 1rem;
        bottom: 1rem;
        max-width: 420px;
        border-radius: 14px;
        border: 1px solid rgba(0, 174, 239, 0.35);
    }

    .ayka-pwa-update {
        left: auto;
        right: 1rem;
        bottom: 1rem;
        max-width: 420px;
        border-radius: 14px;
        border: 1px solid rgba(0, 174, 239, 0.35);
    }

    body.ayka-pwa-update-visible .ayka-pwa-install:not([hidden]) {
        bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    }

    .ayka-pwa-guide {
        align-items: center;
    }
}

/* Güncelleme bandı — alt toast (mobil + PWA) */
.ayka-pwa-update {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 10060;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "icon body btn close";
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #0c1526 0%, #0f172a 100%);
    color: #f8fafc;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.42);
    border-top: 1px solid rgba(0, 174, 239, 0.4);
    animation: ayka-pwa-update-in 0.32s ease-out;
}

@keyframes ayka-pwa-update-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ayka-pwa-update[hidden] {
    display: none !important;
}

.ayka-pwa-update__icon {
    grid-area: icon;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(0, 174, 239, 0.16);
    color: #38bdf8;
    font-size: 1.05rem;
}

.ayka-pwa-update__body {
    grid-area: body;
    min-width: 0;
}

.ayka-pwa-update__title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 700;
    color: #f8fafc;
}

.ayka-pwa-update__desc {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 500;
    color: #94a3b8;
}

.ayka-pwa-update__btn {
    grid-area: btn;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    background: linear-gradient(180deg, #00aeef, #0088c7);
    color: #fff !important;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
}

.ayka-pwa-update__close {
    grid-area: close;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

body.ayka-pwa-update-visible .ayka-pwa-install:not([hidden]) {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
    .ayka-pwa-update {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "icon body close"
            "btn btn btn";
        gap: 0.65rem 0.75rem;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
    }

    .ayka-pwa-update__icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.15rem;
    }

    .ayka-pwa-update__title {
        font-size: 1.08rem;
        letter-spacing: -0.01em;
    }

    .ayka-pwa-update__desc {
        font-size: 0.94rem;
        color: #cbd5e1;
    }

    .ayka-pwa-update__btn {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .ayka-pwa-update__close {
        align-self: start;
        margin-top: -0.15rem;
    }

    body.ayka-pwa-update-visible .ayka-pwa-install:not([hidden]) {
        bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px));
        border-radius: 14px 14px 0 0;
    }

    body.ayka-pwa-update-visible.aykasoft-brand .layout-wrapper .content-wrapper {
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    }

    body.ayka-pwa-update-visible.aykasoft-brand:has(.ayka-pwa-install:not([hidden])) .layout-wrapper .content-wrapper {
        padding-bottom: calc(11rem + env(safe-area-inset-bottom, 0px));
    }
}
