/* ======================================================================
   MODULE — PWA INSTALL BANNER
   Inline banner (sayfa içi) + iOS full-page kurulum modali
   Prefix: .pwa-banner.*  +  .pwa-ios-*
   ====================================================================== */

/* ════════════════════════════════════════════════════════════
   INLINE BANNER — FIXED bottom-center pill (chat/a11y FAB seviyesi)
   z-sticky: 200 (modal 400 üstünde durur)
   Modal açıkken (chat/a11y/pwa-ios) banner gizlenir.
   ════════════════════════════════════════════════════════════ */

.pwa-banner {
    /* FIXED bottom-center — pill container (CTA + dismiss tek pill içinde) */
    position: fixed;
    bottom: var(--sp-5, 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-sticky, 200);
    /* Default: gizli — JS state'e göre açar */
    display: none;
    align-items: stretch;
    gap: 0;
    line-height: 0;
    /* Pill background — eskiden CTA üzerindeydi, artık container'da */
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(85, 107, 47, 0.38);
    overflow: hidden;
}

.pwa-banner[data-pwa-state="visible"] {
    display: inline-flex;
    animation: pwa-banner-in 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwa-banner-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Modal/panel açıkken banner gizlensin (chat, a11y, pwa iOS) */
body.m-chat-open .pwa-banner,
body.a11y-modal-open .pwa-banner,
body.pwa-modal-open .pwa-banner {
    display: none !important;
}

/* Mobile — bottom 16px (chat/a11y FAB ile aynı offset) */
@media (max-width: 480px) {
    .pwa-banner {
        bottom: 24px;
    }
}

/* Ana CTA — sol taraf, transparent, container pill'in parçası */
.pwa-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 20px;
    background: transparent;
    color: #fff;
    border: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    transition: background var(--t-fast, 0.15s);
}
.pwa-banner-cta:hover {
    background: rgba(255, 255, 255, 0.08);
}
.pwa-banner-cta:active {
    background: rgba(255, 255, 255, 0.14);
}
.pwa-banner-cta:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}
.pwa-banner-cta svg { flex-shrink: 0; }

/* Dismiss × — pill'in sağ ucunda, hairline divider ile ayrılmış */
.pwa-banner-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background var(--t-fast, 0.15s), color var(--t-fast, 0.15s);
}
.pwa-banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.pwa-banner-dismiss:active {
    background: rgba(255, 255, 255, 0.18);
}
.pwa-banner-dismiss:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Mobile — biraz daha sıkışık */
@media (max-width: 480px) {
    .pwa-banner-cta {
        padding: 9px 14px 9px 16px;
        font-size: 13px;
    }
    .pwa-banner-dismiss {
        padding: 0 12px;
    }
}
.pwa-banner-dismiss:focus-visible {
    outline: 2px solid var(--primary, #e85d04);
    outline-offset: 2px;
}

/* Mobile — daha sıkışık */
@media (max-width: 480px) {
    .pwa-banner-cta {
        padding: 8px 12px 8px 14px;
        font-size: 13px;
    }
    .pwa-banner-dismiss {
        padding: 0 12px;
    }
}

/* ════════════════════════════════════════════════════════════
   iOS MODAL — Mobile full-page beyaz, Desktop center modal
   ════════════════════════════════════════════════════════════ */

.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 400);
    display: none;
    flex-direction: column;
    background: #ffffff;
    animation: pwa-ios-fade 200ms ease-out;
}
.pwa-ios-modal.is-open { display: flex; }
.pwa-ios-modal[hidden] { display: none; }

@keyframes pwa-ios-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pwa-ios-modal-panel {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pwa-ios-slide 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pwa-ios-slide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Desktop (≥640px) — center modal ─── */
@media (min-width: 640px) {
    .pwa-ios-modal {
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        align-items: center;
        justify-content: center;
        padding: 4vh 16px;
    }
    .pwa-ios-modal.is-open { flex-direction: row; }
    .pwa-ios-modal-panel {
        width: min(92vw, 560px);
        max-width: 560px;
        height: auto;
        max-height: 86vh;
        border-radius: 16px;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
        animation: pwa-ios-slide-desktop 280ms cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes pwa-ios-slide-desktop {
        from { opacity: 0; transform: translateY(-16px) scale(0.98); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
}


/* Header */
.pwa-ios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: #fff;
    flex-shrink: 0;
}
.pwa-ios-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #111827);
    line-height: 1.3;
}
.pwa-ios-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}
.pwa-ios-close:hover {
    background: var(--bg-soft, #f3f4f6);
    color: var(--text, #111827);
}

/* Body */
.pwa-ios-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 32px;
    color: var(--text, #2a2520);
    font-size: 15px;
    line-height: 1.6;
}
.pwa-ios-body::-webkit-scrollbar { width: 8px; }
.pwa-ios-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* Hero — icon + subtitle */
.pwa-ios-hero {
    text-align: center;
    margin-bottom: 28px;
}
.pwa-ios-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 12px 32px rgba(85, 107, 47, 0.28);
}
.pwa-ios-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
    max-width: 480px;
    margin-inline: auto;
}

/* Steps */
.pwa-ios-steps {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pwa-ios-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-soft, #f3f4f6);
    border-radius: 14px;
    border-left: 4px solid var(--primary, #556B2F);
}

.pwa-ios-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary, #556B2F);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-ios-step-text {
    flex: 1;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text, #1a1410);
}

.pwa-ios-step-text strong {
    color: var(--primary, #556B2F);
    font-weight: 700;
}

/* Inline icon badges (Share, Add) */
.pwa-ios-share-icon,
.pwa-ios-add-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 4px;
    vertical-align: -7px;
    background: var(--primary, #556B2F);
    color: #fff;
    border-radius: 7px;
}

.pwa-ios-hint {
    margin: 32px auto 0;
    max-width: 480px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    opacity: 0.85;
    padding-top: 20px;
    border-top: 1px dashed var(--border, #e5e7eb);
}

/* Body scroll lock while modal open */
body.pwa-modal-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════
   TOAST (install status feedback)
   ════════════════════════════════════════════════════════════ */

.pwa-toast {
    position: fixed;
    bottom: calc(var(--sp-5, 20px) + 80px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-popover, 500);
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    max-width: calc(100% - 32px);
    text-align: center;
    animation: pwa-toast-in 200ms ease-out;
}
.pwa-toast[hidden] { display: none; }
.pwa-toast.is-info    { background: rgba(107, 142, 158, 0.95); }
.pwa-toast.is-success { background: rgba(34, 197, 94, 0.95); }
.pwa-toast.is-error   { background: rgba(220, 38, 38, 0.95); }

@keyframes pwa-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Print — modaller gizlensin */
@media print {
    .pwa-banner,
    .pwa-ios-modal,
    .pwa-toast {
        display: none !important;
    }
}
