/* Storefront PWA install prompt, guide and notification preferences. */
.pwa-install-banner[hidden],
.pwa-dialog:not([open]) {
    display: none;
}

.pwa-install-banner {
    position: fixed;
    z-index: 90;
    inset-inline: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 13px;
    max-width: 760px;
    margin-inline: auto;
    padding: 12px 14px;
    border: 1px solid rgba(23, 19, 15, .12);
    border-radius: 18px;
    background: rgba(255, 253, 249, .96);
    color: var(--ink, #17130f);
    box-shadow: 0 22px 60px rgba(23, 19, 15, .18);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .22s ease, transform .22s ease;
}

.pwa-install-banner.is-visible {
    opacity: 1;
    transform: none;
}

body.has-mbar .pwa-install-banner {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.pwa-install-banner::before {
    content: "";
    position: absolute;
    inset-block: 10px;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--pwa-accent, #b58a4f);
}

.pwa-banner-close {
    position: absolute;
    inset-block-start: 5px;
    inset-inline-end: 5px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted, #7c7267);
    cursor: pointer;
}

.pwa-banner-close:hover { background: rgba(23, 19, 15, .07); color: var(--ink, #17130f); }
.pwa-banner-close svg { width: 13px; height: 13px; }

.pwa-banner-icon {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(23, 19, 15, .1);
    object-fit: cover;
}

.pwa-banner-copy { min-width: 0; flex: 1; }
.pwa-banner-copy strong { display: block; font-size: .88rem; line-height: 1.35; letter-spacing: -.01em; }
.pwa-banner-copy p { margin: 2px 0 0; color: var(--muted, #7c7267); font-size: .73rem; line-height: 1.55; }

.pwa-banner-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 7px;
}

.pwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.pwa-btn:hover { transform: translateY(-1px); }
.pwa-btn:disabled { cursor: wait; opacity: .62; transform: none; }
.pwa-btn[hidden] { display: none; }
.pwa-btn-primary { background: var(--pwa-accent, #b58a4f); color: #fff; box-shadow: 0 8px 18px rgba(181, 138, 79, .24); }
.pwa-btn-quiet { border-color: rgba(23, 19, 15, .14); background: rgba(255, 255, 255, .55); color: var(--ink, #17130f); }

.pwa-dialog {
    width: min(520px, calc(100% - 28px));
    max-height: min(760px, calc(100vh - 32px));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: var(--ink, #17130f);
    overflow: auto;
}

.pwa-dialog::backdrop {
    background: rgba(17, 14, 10, .55);
    backdrop-filter: blur(5px);
}

.pwa-dialog-card {
    position: relative;
    padding: 26px;
    border: 1px solid rgba(23, 19, 15, .1);
    border-radius: 22px;
    background: #fffdf9;
    box-shadow: 0 28px 90px rgba(23, 19, 15, .28);
}

.pwa-dialog-close {
    position: absolute;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 19, 15, .06);
    color: var(--muted, #7c7267);
    cursor: pointer;
}

.pwa-dialog-close:hover { background: rgba(23, 19, 15, .12); color: var(--ink, #17130f); }
.pwa-dialog-close svg { width: 15px; height: 15px; }

.pwa-dialog-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-inline-end: 32px;
}

.pwa-dialog-head img {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(23, 19, 15, .1);
    object-fit: cover;
}

.pwa-dialog-head h2 { margin: 2px 0 0; font-size: 1.22rem; line-height: 1.2; letter-spacing: -.03em; }

.pwa-eyebrow {
    display: block;
    color: var(--pwa-accent, #96703b);
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

html[dir="rtl"] .pwa-eyebrow { letter-spacing: 0; text-transform: none; }
.pwa-dialog-intro { margin: 17px 0 0; color: var(--muted, #72685c); font-size: .82rem; line-height: 1.8; }

.pwa-guide-body { margin-top: 16px; display: grid; gap: 9px; }
.pwa-guide-step { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border: 1px solid rgba(23, 19, 15, .08); border-radius: 12px; background: #faf7f2; }
.pwa-guide-number { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--pwa-accent, #b58a4f); color: #fff; font-size: .7rem; font-weight: 800; }
.pwa-guide-step p { margin: 1px 0 0; color: #4a4238; font-size: .78rem; line-height: 1.65; }
.pwa-guide-fallback { margin: 0; color: var(--muted, #72685c); font-size: .8rem; line-height: 1.7; }

.pwa-bell-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(181, 138, 79, .12);
    color: var(--pwa-accent, #96703b);
}
.pwa-bell-mark svg { width: 24px; height: 24px; }

.pwa-topic-label { margin-top: 20px; color: var(--ink, #17130f); font-size: .76rem; font-weight: 800; }
.pwa-topic-list { display: grid; gap: 8px; margin-top: 9px; }
.pwa-topic { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(23, 19, 15, .1); border-radius: 11px; background: #faf7f2; color: #4a4238; font-size: .78rem; cursor: pointer; }
.pwa-topic input { width: 16px; height: 16px; accent-color: var(--pwa-accent, #b58a4f); }
.pwa-topic:has(input:checked) { border-color: rgba(181, 138, 79, .45); background: rgba(181, 138, 79, .08); }

.pwa-notify-status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted, #72685c); font-size: .76rem; line-height: 1.6; }
.pwa-notify-status.is-success { color: #2f7d5a; font-weight: 700; }
.pwa-notify-status.is-error { color: #a33f32; font-weight: 700; }

.pwa-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.pwa-account-card { margin-bottom: 16px; }
.pwa-account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pwa-account-card h2 { margin: 2px 0 0; font-size: .96rem; }
.pwa-account-card p { margin: 5px 0 0; color: var(--muted, #7c7267); font-size: .76rem; line-height: 1.65; }

.footer-pwa-link {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.footer-pwa-link:hover { color: var(--gold, #b58a4f); }

.pwa-standalone [data-pwa-install],
.pwa-standalone .pwa-install-banner {
    display: none !important;
}

@media (max-width: 640px) {
    .pwa-install-banner { inset-inline: 10px; gap: 10px; padding: 11px 11px 11px 13px; border-radius: 15px; align-items: flex-start; }
    .pwa-banner-icon { width: 42px; height: 42px; border-radius: 12px; }
    .pwa-banner-copy strong { font-size: .8rem; padding-inline-end: 18px; }
    .pwa-banner-copy p { font-size: .68rem; }
    .pwa-banner-actions { flex-direction: column; align-items: stretch; gap: 5px; }
    .pwa-btn { min-height: 36px; padding: 8px 11px; font-size: .69rem; }
    .pwa-dialog-card { padding: 21px 18px; border-radius: 18px; }
    .pwa-dialog-head h2 { font-size: 1.08rem; }
    .pwa-dialog-actions { justify-content: stretch; }
    .pwa-dialog-actions .pwa-btn { flex: 1; }
}

@media print {
    .pwa-install-banner, .pwa-dialog { display: none !important; }
}
