/* ═══════════════ تطبيق الموقع (sa-*) ═══════════════
   The invitation to install the site as an app
   (resources/views/partials/site_app_install.blade.php), dressed like an
   app-store listing in the site's own colours (--theme-* from theme_color,
   which every site theme sets). Phones only. */

.sa-sheet {
    --sa-brand: var(--theme-brand, #B8541A);
    --sa-brand-rgb: var(--theme-brand-rgb, 184, 84, 26);
    --sa-surface: var(--theme-surface, #FFFFFF);
    --sa-text: var(--theme-text, #1F1A17);
    --sa-mute: var(--theme-text-muted, #6B7280);
    --sa-line: var(--theme-line, rgba(0, 0, 0, .08));

    position: fixed;
    inset-inline: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    max-width: 480px;
    margin-inline: auto;
    padding: 18px 16px 14px;
    border-radius: 22px;
    background: var(--sa-surface);
    color: var(--sa-text);
    font-family: var(--m-font-body, inherit);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28), 0 0 0 1px var(--sa-line);
    animation: sa-up .38s cubic-bezier(.2, .9, .25, 1) both;
}
.sa-sheet[hidden], .sa-sheet [hidden], .sa-pointer[hidden] { display: none !important; }
/* A thin strip of the brand along the top edge — the card belongs to the site. */
.sa-sheet::before {
    content: "";
    position: absolute; inset-inline: 22px; top: 0;
    height: 4px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--sa-brand), rgba(var(--sa-brand-rgb), .55));
}

.sa-sheet__x {
    position: absolute; top: 10px; inset-inline-end: 10px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: rgba(var(--sa-brand-rgb), .08); color: var(--sa-mute);
    font-size: 13px; cursor: pointer;
}

.sa-sheet__head { display: flex; align-items: center; gap: 14px; padding-inline-end: 34px; }
.sa-sheet__icon {
    width: 64px; height: 64px; flex: 0 0 64px;
    border-radius: 16px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 6px 16px rgba(var(--sa-brand-rgb), .25), 0 0 0 1px var(--sa-line);
}
.sa-sheet__title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sa-sheet__title strong {
    font-size: 17px; font-weight: 800; line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sa-sheet__title span { font-size: 12.5px; color: var(--sa-mute); line-height: 1.5; }

.sa-sheet__facts {
    list-style: none; margin: 16px 0 0; padding: 12px 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid var(--sa-line);
}
.sa-sheet__facts li {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 0 4px; text-align: center;
    font-size: 11.5px; font-weight: 700; line-height: 1.4; color: var(--sa-text);
}
.sa-sheet__facts li + li { border-inline-start: 1px solid var(--sa-line); }
.sa-sheet__facts i {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    background: rgba(var(--sa-brand-rgb), .10); color: var(--sa-brand);
    font-size: 14px;
}

.sa-sheet__steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sa-sheet__steps li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 14px;
    background: rgba(var(--sa-brand-rgb), .06);
    font-size: 14px; font-weight: 600; line-height: 1.6;
}
.sa-sheet__steps li i { color: var(--sa-brand); margin-inline-start: 4px; }
.sa-sheet__n {
    flex: 0 0 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--sa-brand); color: #fff;
    font-size: 13px; font-weight: 800;
}

.sa-sheet__act { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.sa-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 48px; padding: 0 18px;
    border: 0; border-radius: 14px;
    font-family: inherit; font-size: 15px; font-weight: 800;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.sa-btn--primary {
    background: linear-gradient(135deg, var(--sa-brand), rgba(var(--sa-brand-rgb), .82));
    color: #fff;
    box-shadow: 0 10px 24px rgba(var(--sa-brand-rgb), .35);
}
.sa-btn--primary:active { transform: scale(.98); }
.sa-btn--ghost { min-height: 40px; background: transparent; color: var(--sa-mute); font-size: 13.5px; font-weight: 700; }
.sa-btn:focus-visible, .sa-sheet__x:focus-visible { outline: 3px solid rgba(var(--sa-brand-rgb), .45); outline-offset: 2px; }

/* iPhone Safari: a bouncing arrow over the Share button at the bottom. */
.sa-pointer {
    position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483001;
    width: 44px; height: 44px; margin-left: -22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--theme-brand, #B8541A); color: #fff; font-size: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    animation: sa-bounce 1.1s ease-in-out infinite;
}
.sa-sheet.is-ios { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

@keyframes sa-up {
    from { opacity: 0; transform: translateY(24px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes sa-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
    .sa-sheet, .sa-pointer { animation: none; }
}
@media (min-width: 768px) {
    .sa-sheet, .sa-pointer { display: none !important; }
}

/* The badge in the home page's app section, next to the store badges. */
[data-sa-item][hidden] { display: none !important; }

/* The site's own stylesheets size every img, li and p of the page (and
   some with !important); the card keeps its own measures. */
.sa-sheet img.sa-sheet__icon {
    width: 64px !important; height: 64px !important;
    max-width: none !important; min-width: 0 !important;
    margin: 0 !important; padding: 0 !important;
}
.sa-sheet .sa-sheet__title strong { font-size: 17px !important; margin: 0 !important; }
.sa-sheet .sa-sheet__title span,
.sa-sheet .sa-sheet__facts li,
.sa-sheet .sa-sheet__steps li { margin: 0 !important; letter-spacing: 0 !important; }
.sa-sheet .sa-sheet__title span { font-size: 12.5px !important; }
.sa-sheet .sa-sheet__facts li { font-size: 11.5px !important; list-style: none !important; }
.sa-sheet .sa-sheet__steps li { font-size: 14px !important; list-style: none !important; }
.sa-sheet .sa-btn { font-size: 15px !important; line-height: 1.2 !important; }
.sa-sheet .sa-btn--ghost { font-size: 13.5px !important; }
.sa-sheet .sa-sheet__facts li span,
.sa-sheet .sa-sheet__steps li span { font-size: inherit !important; line-height: inherit !important; color: inherit !important; }
