/* ================================================================
   تطبيقات الموبايل  /  Mobile apps download section
   All selectors are prefixed .mad- to avoid collisions.
   ================================================================ */

.mad-apps {
    --mad-blue: #1B79BF;
    --mad-blue-dark: #0E5486;
    --mad-blue-tint: #EAF3FA;
    --mad-gold: #C69C4E;
    --mad-ink: #123A5C;
    --mad-body: #4A5560;
    --mad-panel: #FFFFFF;
    --mad-card: #FBFAF7;
    --mad-line: #DED6C7;
    box-sizing: border-box;
    max-width: 1250px;
    margin: 20px auto;
    padding: 16px 18px 18px;
    background: var(--mad-panel);
    border: 1px solid var(--mad-line);
    border-radius: 14px;
}

    .mad-apps *,
    .mad-apps *::before,
    .mad-apps *::after {
        box-sizing: inherit;
    }

/* ---- heading ---- */
.mad-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--mad-blue);
    margin-bottom: 14px;
}

.mad-head-icon {
    flex: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mad-blue-tint);
    color: var(--mad-blue);
}

    .mad-head-icon svg {
        width: 17px;
        height: 17px;
        display: block;
    }

.mad-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--mad-ink);
    line-height: 1.3;
}

.mad-subtitle {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--mad-body);
}

/* ---- the two app cards ---- */
.mad-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.mad-item {
    flex: 1 1 320px;
}

.mad-card {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 12px 14px;
    background: var(--mad-card);
    border: 1px solid var(--mad-line);
    border-radius: 12px;
    transition: border-color .18s ease, background-color .18s ease;
}

    .mad-card:hover {
        background: #fff;
        border-color: var(--mad-blue);
    }

.mad-app-icon {
    flex: none;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--mad-line);
    border-radius: 14px;
    overflow: hidden;
}

    .mad-app-icon img {
        max-width: 100%;
        max-height: 100%;
        display: block;
    }

.mad-app-body {
    flex: 1 1 auto;
    min-width: 0;
}

.mad-app-name {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: var(--mad-ink);
    line-height: 1.4;
}

.mad-app-desc {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--mad-body);
    line-height: 1.5;
}

.mad-store-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

    .mad-store-links a {
        flex: 0 1 128px;
        min-width: 0;
        display: block;
        line-height: 0;
        border-radius: 6px;
        transition: transform .18s ease;
    }

        .mad-store-links a:hover,
        .mad-store-links a:focus-visible {
            transform: translateY(-2px);
        }

        .mad-store-links a:focus-visible {
            outline: 3px solid var(--mad-gold);
            outline-offset: 2px;
        }

    .mad-store-links img {
        width: 100%;
        max-width: 128px;
        height: auto;
        margin: 0;
        display: block;
    }

@media (max-width: 767px) {
    .mad-card {
        flex-direction: column;
        text-align: center;
    }

    .mad-store-links {
        justify-content: center;
    }
}
