/*
 * App download popup (components/frontend/app-download-popup.blade.php).
 * Sits above sticky headers but below the login popup and the product option picker.
 */

.modal.fs-app-popup {
    --bs-modal-zindex: 100010;
    --bs-modal-width: 760px;
    --fsap-accent: #f26b1d;
    --fsap-accent-dark: #d9560b;
    --fsap-green: #2f9e44;
    --fsap-ink: #1f2937;
    --fsap-muted: #4b5563;
    z-index: 100010;
}

body.fs-app-popup-open .modal-backdrop {
    --bs-backdrop-zindex: 100000;
    --bs-backdrop-opacity: .6;
    z-index: 100000;
}

.fs-app-popup .fs-app-popup__dialog {
    max-width: 760px;
}

.fs-app-popup .fs-app-popup__content {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--fsap-green) 22%, transparent) 0 120px, transparent 121px),
        #fff;
    box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5);
}

.fs-app-popup__close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #374151;
    font-size: 17px;
    cursor: pointer;
}

.fs-app-popup__close:hover {
    background: #f3f4f6;
}

.fs-app-popup__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
}

/* ── Visual (left) ───────────────────────────────────────────────────── */

.fs-app-popup__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100%;
    padding: 36px 16px 36px 28px;
}

.fs-app-popup__blob {
    position: absolute;
    border-radius: 50%;
}

.fs-app-popup__blob--a {
    top: 18%;
    left: -40px;
    width: 230px;
    height: 230px;
    background: linear-gradient(135deg, #ffb347, var(--fsap-accent));
    opacity: .9;
}

.fs-app-popup__blob--b {
    right: 8px;
    bottom: 10%;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #8bd17c, var(--fsap-green));
    opacity: .85;
}

.fs-app-popup__mockup {
    position: relative;
    width: 100%;
    max-width: 240px;
    max-height: 380px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(15, 23, 42, .3));
}

/* Built-in phone */
.fs-app-phone {
    position: relative;
    width: 190px;
    aspect-ratio: 9 / 18.5;
    padding: 9px;
    border-radius: 34px;
    background: #111827;
    box-shadow: 0 24px 40px -14px rgba(15, 23, 42, .6), inset 0 0 0 2px #374151;
    transform: rotate(-6deg);
}

.fs-app-phone__notch {
    position: absolute;
    top: 9px;
    left: 50%;
    z-index: 1;
    width: 70px;
    height: 16px;
    border-radius: 0 0 10px 10px;
    background: #111827;
    transform: translateX(-50%);
}

.fs-app-phone__screen {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    padding: 26px 10px 10px;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
}

.fs-app-phone__logo {
    align-self: center;
    max-width: 110px;
    max-height: 28px;
    object-fit: contain;
}

.fs-app-phone__search {
    display: flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 99px;
    color: #9ca3af;
    font-size: 9px;
}

.fs-app-phone__banner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fsap-accent), #ffb347);
    color: #fff;
}

.fs-app-phone__banner b {
    font-size: 15px;
    line-height: 1.05;
}

.fs-app-phone__banner small {
    margin-top: 4px;
    font-size: 8px;
    font-weight: 700;
}

.fs-app-phone__tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.fs-app-phone__tiles i {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 7px;
    background: #f3f4f6;
    color: var(--fsap-ink);
    font-size: 11px;
}

/* ── Text (right) ────────────────────────────────────────────────────── */

.fs-app-popup__text {
    position: relative;
    padding: 34px 34px 28px 8px;
}

.fs-app-popup__logo {
    display: block;
    max-width: 140px;
    max-height: 36px;
    margin-bottom: 12px;
    object-fit: contain;
}

.fs-app-popup__title {
    margin: 0 0 8px;
    color: var(--fsap-ink);
    font-size: 26px !important; /* the theme forces h2 sizes */
    font-weight: 800;
    line-height: 1.2;
}

.fs-app-popup__subtitle {
    margin: 0 0 16px;
    color: var(--fsap-muted);
    font-size: 15px;
    line-height: 1.5;
}

.fs-app-popup__features {
    display: grid;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.fs-app-popup__features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--fsap-green) 9%, #fff);
    color: var(--fsap-ink);
    font-size: 14.5px;
    font-weight: 500;
}

.fs-app-popup__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--fsap-green);
    color: #fff;
    font-size: 13px;
}

.fs-app-popup__actions {
    display: flex;
    gap: 10px;
}

.fs-app-popup__download {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 99px;
    background: linear-gradient(135deg, #ff8a3d, var(--fsap-accent));
    box-shadow: 0 10px 22px -10px var(--fsap-accent);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: filter .15s ease, transform .1s ease;
}

.fs-app-popup__download:hover {
    filter: brightness(.95);
}

.fs-app-popup__download:active {
    transform: translateY(1px);
}

.fs-app-popup__later {
    min-height: 48px;
    padding: 0 22px;
    border: 1.5px solid var(--fsap-green);
    border-radius: 99px;
    background: #fff;
    color: var(--fsap-green);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.fs-app-popup__later:hover {
    background: color-mix(in srgb, var(--fsap-green) 8%, #fff);
}

/* Dark pill behind the badge: uploaded store badges are often white artwork on a
   transparent background (made for the dark footer) and vanish on the white popup. */
.fs-app-popup__store {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    padding: 4px 10px;
    border-radius: 10px;
    background: #111;
    text-decoration: none;
}

.fs-app-popup__store img {
    height: 40px;
    width: auto;
}

.fs-app-popup__store-fallback {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 4px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
}

.fs-app-popup__store-fallback i {
    font-size: 22px;
}

.fs-app-popup__store-fallback small {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .04em;
}

.fs-app-popup__download:focus-visible,
.fs-app-popup__later:focus-visible,
.fs-app-popup__store:focus-visible,
.fs-app-popup__close:focus-visible {
    outline: 2px solid var(--fsap-ink);
    outline-offset: 2px;
}

/* ── Tablet / phone ──────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
    .fs-app-popup .fs-app-popup__dialog {
        max-width: 440px;
        margin-inline: auto;
        padding-inline: 12px;
    }

    .fs-app-popup__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .fs-app-popup__visual {
        min-height: 0;
        padding: 26px 16px 4px;
    }

    .fs-app-popup__blob--a { top: 10%; left: 12%; width: 150px; height: 150px; }
    .fs-app-popup__blob--b { right: 14%; bottom: 0; width: 100px; height: 100px; }

    .fs-app-phone { width: 128px; border-radius: 26px; }
    .fs-app-phone__screen { gap: 6px; padding-top: 20px; border-radius: 19px; }
    .fs-app-phone__banner b { font-size: 11px; }
    .fs-app-popup__mockup { max-width: 160px; max-height: 230px; }

    .fs-app-popup__text {
        padding: 14px 20px 22px;
        text-align: center;
    }

    .fs-app-popup__logo { display: none; }
    .fs-app-popup__title { font-size: 21px !important; }
    .fs-app-popup__subtitle { font-size: 14px; }

    .fs-app-popup__features {
        gap: 6px;
        text-align: start;
    }

    .fs-app-popup__features li { font-size: 13.5px; padding: 6px 9px; }
    .fs-app-popup__actions { flex-direction: column; }
    .fs-app-popup__store { justify-content: center; }
}

@media (max-width: 380px) {
    .fs-app-popup__features li:nth-child(n + 4) { display: none; }
}

/* Short phone screens (e.g. iPhone SE): drop the mockup so the buttons stay in view. */
@media (max-width: 767.98px) and (max-height: 720px) {
    .fs-app-popup__visual { display: none; }
    .fs-app-popup__text { padding-top: 52px; }
}
