/* سلطان فون — the home page's layout, shared by the three looks.
   Each look sets the colours (custom properties) and a few touches. */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --soft: #f4f5f7;
    --ink: #15181c;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #e8590c;
    --accent-ink: #ffffff;
    --accent-soft: #fff1e8;
    --strip-bg: #15181c;
    --strip-ink: #ffffff;
    --top-bg: rgba(255, 255, 255, 0.9);
    --top-ink: #15181c;
    --hero-bg: #f6f7f9;
    --hero-ink: #15181c;
    --hero-accent: #e8590c;
    --phone-body: #23262b;
    --phone-screen: linear-gradient(160deg, #ffb37d, #e8590c);
    --installment-bg: #15181c;
    --installment-ink: #ffffff;
    --installment-accent: #ffb37d;
    --price: #15181c;
    --tag-used: #0f9d58;
    --tag-few: #d97706;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 26px rgba(0, 0, 0, 0.07);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.55; padding-bottom: 76px; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
.wrap { width: min(1180px, 100% - 28px); margin-inline: auto; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: end; }

.back-to-choice { position: absolute; top: 6px; inset-inline-end: 8px; z-index: 50; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 999px; }

.strip { background: var(--strip-bg); color: var(--strip-ink); text-align: center; font-size: 13px; font-weight: 600; padding: 8px 12px; }

/* ---- Top ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--top-bg); color: var(--top-ink); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 11px; color: var(--muted); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 999px; padding: 0 14px; min-height: 42px; max-width: 520px; margin-inline-start: auto; }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; }
.cart { position: relative; font-size: 22px; padding: 6px; }
.cart-badge { position: absolute; top: -2px; inset-inline-start: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 18px; text-align: center; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; font-weight: 700; cursor: pointer; transition: transform 0.15s ease, filter 0.15s ease; }
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(0.95); }
.btn-main { background: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--soft); color: var(--ink); }

/* ---- Hero ---- */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 44px 0 36px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center; }
.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--hero-accent); }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 56px); line-height: 1.12; letter-spacing: -0.01em; }
.hero h1 span { color: var(--hero-accent); }
.hero-lead { margin: 14px 0 0; font-size: 17px; opacity: 0.85; max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rating { margin: 16px 0 0; font-size: 14px; opacity: 0.85; }
.hero-art { position: relative; height: 320px; }
.hero-phone { position: absolute; top: 10px; inset-inline-start: 22%; width: 150px; height: 300px; border-radius: 34px; padding: 8px; background: var(--phone-body); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25); transform: rotate(-6deg); z-index: 2; }
.hero-phone span { display: block; height: 100%; border-radius: 27px; background: var(--phone-screen); }
.hero-phone-back { inset-inline-start: 46%; top: 30px; transform: rotate(8deg); opacity: 0.85; z-index: 1; }

/* ---- Perks ---- */
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.perk { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.perk b { font-size: 24px; }
.perk span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.perk strong { font-size: 14px; color: var(--ink); }

/* ---- Shop ---- */
.shop { padding: 34px 0 40px; }
.section-head h2 { margin: 0 0 12px; font-size: 26px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.tab.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.more-wrap { display: flex; justify-content: center; margin-top: 18px; }

.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { position: relative; background: var(--soft); height: 180px; display: grid; place-items: center; }
.tags { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fff; }
.tag-used { color: var(--tag-used); }
.tag-few { color: var(--tag-few); }
.pic { display: grid; place-items: center; }
.pic-phone { position: relative; width: 78px; height: 150px; border-radius: 20px; border: 5px solid var(--phone-body); background: var(--phone-screen); display: grid; place-items: end center; padding-bottom: 14px; box-shadow: 0 14px 26px rgba(0, 0, 0, 0.15); }
.pic-notch { position: absolute; top: 6px; width: 26px; height: 7px; border-radius: 4px; background: var(--phone-body); }
.pic-brand { font-size: 11px; font-weight: 800; color: #fff; letter-spacing: 0.04em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.pic-icon { font-size: 58px; }
.pic-has-photo { width: 100%; height: 100%; padding: 10px; }
.pic-photo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { margin: 0; font-size: 15px; line-height: 1.35; }
.card-meta { margin: 0; font-size: 12px; color: var(--muted); min-height: 1.4em; }
.price { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.price-cash { font-size: 20px; font-weight: 800; color: var(--price); }
.price-label { font-size: 12px; color: var(--muted); }
.installment { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; background: var(--accent-soft); border-radius: 10px; padding: 7px 9px; color: var(--ink); }
.installment b { color: var(--accent); font-size: 13px; }
.delivery { font-size: 12px; font-weight: 700; color: var(--tag-used); }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.btn-buy { flex: 1; background: var(--accent); color: var(--accent-ink); min-height: 40px; }
.btn-add { width: 40px; min-height: 40px; padding: 0; background: var(--soft); color: var(--ink); font-size: 20px; }

/* ---- Installment ---- */
.installment-band { background: var(--installment-bg); color: var(--installment-ink); padding: 48px 0; }
.installment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.installment-band .eyebrow { color: var(--installment-accent); }
.installment-band h2 { margin: 0; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.2; }
.installment-who { opacity: 0.85; }
.installment-example { font-weight: 700; color: var(--installment-accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 12px 14px; }
.steps b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--installment-accent); color: var(--installment-bg); }

/* ---- Contact ---- */
.contact { padding: 34px 0; }
.contact-card { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.contact-card > div { flex: 1; }
.contact-card p { margin: 2px 0; color: var(--muted); font-size: 14px; }
.contact-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 0 26px; }

/* ---- Bottom navigation (like an app) ---- */
.bottom-nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--top-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); }
.bottom-nav a span { font-size: 20px; }
.bottom-nav a.is-on { color: var(--accent); font-weight: 700; }
.bottom-nav .cart-badge { top: -2px; inset-inline-start: calc(50% + 6px); }

@media (max-width: 860px) {
    .hero-grid, .installment-grid { grid-template-columns: 1fr; }
    .hero-art { height: 220px; order: -1; }
    .hero-phone { width: 110px; height: 220px; border-radius: 26px; padding: 6px; }
    .hero-phone span { border-radius: 20px; }
    .perks { grid-template-columns: 1fr 1fr; }
    .search { display: none; }
    .cart { margin-inline-start: auto; }
}

@media (max-width: 600px) {
    /* On a phone the words come first: the drawing is left out */
    .hero-art { display: none; }
}

@media (max-width: 520px) {
    .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card-media { height: 140px; }
    .pic-phone { width: 62px; height: 118px; border-radius: 16px; border-width: 4px; }
    .pic-icon { font-size: 44px; }
    .card-body { padding: 10px; }
    .card-name { font-size: 13px; }
    .price-cash { font-size: 16px; }
    .installment { font-size: 11px; }
    .contact-card { flex-direction: column; text-align: center; }
    .hero { padding-top: 24px; }
    .hero-lead { font-size: 15px; }
}

@media (min-width: 861px) {
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
}

/* The card on a narrow phone: one line each */
@media (max-width: 520px) {
    .delivery { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tag { font-size: 10px; padding: 2px 7px; }
    .strip { padding-inline-end: 120px; text-align: start; font-size: 12px; }
}
