:root{
    --bg:#081330;
    --bg2:#0d1c42;
    --card:#112455;
    --card2:#15306c;
    --line:rgba(255,255,255,.09);
    --text:#eef3ff;
    --muted:#9db0d6;
    --accent:#2f7bff;
    --accent2:#69a7ff;
    --wa:#1faa59;
    --radius:16px;
    --gut:16px;
    --safe-b:env(safe-area-inset-bottom, 0px);
}
*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-behavior:smooth; }
body{
    margin:0;
    background:var(--bg);
    background-image:radial-gradient(1200px 500px at 85% -10%, rgba(47,123,255,.22), transparent 60%);
    background-repeat:no-repeat;
    color:var(--text);
    font-family:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    font-size:16px;
    line-height:1.6;
    overflow-x:hidden;
    -webkit-tap-highlight-color:transparent;
}
body.lock{ overflow:hidden; }
img{ max-width:100%; display:block; }
button{ font:inherit; color:inherit; }
a{ color:inherit; }
.wrap{ width:100%; max-width:1180px; margin:0 auto; padding-left:var(--gut); padding-right:var(--gut); }

.top{ padding-top:max(12px, env(safe-area-inset-top)); }
.top-in{ display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:60px; }
.brand{ display:flex; flex-direction:column; text-decoration:none; min-width:0; }
.brand-word{
    font-family:system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight:800; font-size:1.55rem; letter-spacing:.06em; line-height:1.1;
    background:linear-gradient(180deg, #ffffff 30%, #b9c8e6 100%);
    -webkit-background-clip:text; background-clip:text; color:transparent;
}
.brand-logo{ height:34px; width:auto; }
.brand-sub{ color:var(--muted); font-size:.82rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:60vw; }
.top-wa{
    display:inline-flex; align-items:center; gap:8px; flex-shrink:0;
    min-height:42px; padding:0 14px; border-radius:999px;
    background:rgba(31,170,89,.14); color:#7fe3a8; border:1px solid rgba(31,170,89,.35);
    text-decoration:none; font-weight:600; font-size:.9rem;
}

.hero{ margin-top:6px; position:relative; }
.slides{
    position:relative; overflow:hidden; border-radius:var(--radius);
    aspect-ratio:2048 / 765; background:var(--bg2);
    box-shadow:0 18px 40px -20px rgba(0,0,0,.6);
    touch-action:pan-y;
}
.slide{
    position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
    opacity:0; transition:opacity .6s ease;
}
.slide.on{ opacity:1; }
.dots{ display:flex; justify-content:center; gap:6px; margin-top:10px; }
.dot{ width:8px; height:8px; border-radius:99px; border:0; padding:0; background:rgba(255,255,255,.25); cursor:pointer; transition:width .3s, background .3s; }
.dot.on{ width:22px; background:var(--accent2); }

.intro{ margin-top:18px; }
.intro-text{ margin:0 0 10px; color:var(--muted); font-size:.95rem; }
.intro-tags{ display:flex; flex-wrap:wrap; gap:8px; }
.tag{ display:inline-flex; align-items:center; min-height:30px; padding:0 12px; border-radius:999px; font-size:.82rem; border:1px solid var(--line); color:var(--muted); background:rgba(255,255,255,.03); }
.tag-strong{ color:#fff; background:linear-gradient(90deg, #1d5fe0, #2f7bff); border-color:transparent; font-weight:600; }

.bar{
    position:sticky; top:0; z-index:20; margin-top:16px; padding:10px 0 8px;
    background:rgba(8,19,48,.86);
    -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
    border-bottom:1px solid var(--line);
}
.search{
    display:flex; align-items:center; gap:10px; min-height:46px; padding:0 14px;
    background:var(--bg2); border:1px solid var(--line); border-radius:12px; color:var(--muted);
}
.search:focus-within{ border-color:rgba(105,167,255,.6); box-shadow:0 0 0 3px rgba(47,123,255,.18); }
.search input{
    flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--text);
    font:inherit; font-size:16px; height:44px;
}
.search input::placeholder{ color:#7084ae; }
.search input::-webkit-search-cancel-button{ filter:invert(1) opacity(.5); }
.chips{
    display:flex; gap:8px; margin-top:10px; overflow-x:auto; overscroll-behavior-x:contain;
    scroll-snap-type:x proximity; scrollbar-width:none; padding-bottom:2px;
    margin-left:calc(var(--gut) * -1); margin-right:calc(var(--gut) * -1);
    padding-left:var(--gut); padding-right:var(--gut);
}
.chips::-webkit-scrollbar{ display:none; }
.chip{
    flex:0 0 auto; scroll-snap-align:start; min-height:40px; padding:0 16px; border-radius:12px;
    border:1px solid var(--line); background:var(--card); color:var(--text); cursor:pointer;
    font-weight:600; font-size:.9rem; white-space:nowrap; transition:background .2s, border-color .2s;
}
.chip small{ color:var(--muted); font-weight:500; margin-inline-start:4px; }
.chip.on{ background:var(--accent); border-color:var(--accent); }
.chip.on small{ color:rgba(255,255,255,.8); }

main.wrap{ padding-top:16px; padding-bottom:40px; }
.grid{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.card{
    display:flex; flex-direction:column; text-align:start; padding:8px; cursor:pointer;
    background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
    transition:transform .15s ease, border-color .2s ease; min-width:0;
}
.card:active{ transform:scale(.98); }
.card[hidden]{ display:none; }
.card-img{
    display:block; aspect-ratio:1 / 1; border-radius:12px; overflow:hidden; background:#fff;
}
.card-img img{ width:100%; height:100%; object-fit:contain; }
.noimg{ display:flex; align-items:center; justify-content:center; height:100%; color:#97a3bb; font-size:.8rem; }
.card-body{ display:flex; flex-direction:column; gap:6px; padding:10px 4px 4px; flex:1; min-width:0; }
.card-name{
    font-weight:600; font-size:.92rem; line-height:1.5;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
    min-height:2.9em; overflow-wrap:anywhere;
}
.card-meta{ display:flex; align-items:center; justify-content:space-between; gap:6px; flex-wrap:wrap; }
.alias{
    font-family:ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size:.76rem; font-weight:600;
    color:#cfe0ff; background:rgba(47,123,255,.16); border:1px solid rgba(105,167,255,.28);
    padding:2px 8px; border-radius:8px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.pack{ display:inline-flex; align-items:center; gap:4px; color:var(--muted); font-size:.8rem; }
.card-price{ margin-top:auto; font-weight:700; color:#fff; font-size:.95rem; }
.card-price.ask{ color:var(--muted); font-weight:500; font-size:.84rem; }
.empty{ text-align:center; color:var(--muted); padding:40px 0; }

.foot{ border-top:1px solid var(--line); background:rgba(0,0,0,.18); padding:28px 0 calc(90px + var(--safe-b)); }
.foot-in{ display:grid; gap:14px; }
.foot-brand{ display:flex; flex-direction:column; gap:2px; }
.foot-brand span{ color:var(--muted); font-size:.9rem; }
.foot-list{ list-style:none; margin:0; padding:0; display:grid; gap:8px; color:var(--muted); font-size:.92rem; }
.foot-list a{ text-decoration:none; }
.copy{ margin:0; color:#6f82aa; font-size:.8rem; }

.fab{
    position:fixed; z-index:30; left:16px; bottom:calc(16px + var(--safe-b));
    width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:var(--wa); color:#fff; box-shadow:0 10px 24px -8px rgba(0,0,0,.6);
}

.sheet{ position:fixed; inset:0; z-index:50; display:flex; align-items:flex-end; justify-content:center; }
.sheet[hidden]{ display:none; }
.sheet-back{ position:absolute; inset:0; background:rgba(3,8,22,.66); animation:fade .2s ease; }
.sheet-box{
    position:relative; width:100%; max-width:560px; max-height:92vh; max-height:92dvh; overflow-y:auto;
    overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
    background:var(--bg2); border-radius:22px 22px 0 0; border:1px solid var(--line); border-bottom:0;
    padding-bottom:calc(18px + var(--safe-b)); animation:up .26s cubic-bezier(.2,.8,.2,1);
}
.sheet-x{
    position:absolute; top:20px; left:22px; margin:0; z-index:2;
    width:40px; height:40px; border-radius:50%; border:0; cursor:pointer;
    background:rgba(8,19,48,.75); color:#fff; display:flex; align-items:center; justify-content:center;
}
.sheet-img{ background:#fff; margin:10px 12px 0; border-radius:16px; overflow:hidden; aspect-ratio:1 / 1; max-height:56vh; }
.sheet-img img{ width:100%; height:100%; object-fit:contain; }
.sheet-body{ padding:16px 18px 0; }
.sheet-cat{ color:var(--accent2); font-size:.84rem; font-weight:600; }
.sheet-body h2{ margin:4px 0 12px; font-size:1.2rem; line-height:1.5; overflow-wrap:anywhere; }
.specs{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin:0 0 12px; }
.specs div{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:8px 10px; min-width:0; }
.specs dt{ color:var(--muted); font-size:.76rem; }
.specs dd{ margin:2px 0 0; font-weight:700; font-size:.92rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheet-desc{ color:#c9d5ef; margin:0 0 12px; white-space:pre-line; font-size:.93rem; }
.sheet-desc:empty{ display:none; }
.sheet-price{ font-size:1.25rem; font-weight:700; margin-bottom:14px; }
.sheet-price.ask{ font-size:1rem; color:var(--muted); font-weight:500; }
.sheet-actions{ display:grid; gap:10px; }
.btn{
    display:flex; align-items:center; justify-content:center; min-height:50px; padding:0 18px; border-radius:14px;
    font-weight:700; text-decoration:none; cursor:pointer; border:1px solid transparent; font-size:1rem;
}
.btn-wa{ background:var(--wa); color:#fff; }
.btn-ghost{ background:transparent; border-color:var(--line); color:var(--text); }

@keyframes up{ from{ transform:translateY(40px); opacity:.4; } to{ transform:none; opacity:1; } }
@keyframes fade{ from{ opacity:0; } to{ opacity:1; } }

@media (min-width:600px){
    :root{ --gut:22px; }
    .grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; }
    .card{ padding:10px; }
    .card-name{ font-size:.98rem; }
}
@media (min-width:900px){
    .grid{ grid-template-columns:repeat(4, minmax(0, 1fr)); gap:18px; }
    .bar .wrap{ display:flex; align-items:center; gap:14px; }
    .search{ flex:0 0 340px; }
    .chips{ margin:0; padding:0; flex:1; flex-wrap:wrap; overflow:visible; }
    .card:hover{ border-color:rgba(105,167,255,.45); transform:translateY(-2px); }
    .sheet{ align-items:center; }
    .sheet-box{ border-radius:22px; border-bottom:1px solid var(--line); max-height:88vh; display:grid; grid-template-columns:1fr 1fr; max-width:900px; padding-bottom:18px; }
    .sheet-x{ top:12px; left:12px; }
    .sheet-img{ margin:14px; max-height:none; align-self:start; }
    .sheet-body{ padding:26px 6px 6px 22px; }
    .foot-in{ grid-template-columns:1fr 1fr; align-items:start; }
    .copy{ grid-column:1 / -1; }
}
@media (min-width:1150px){
    .grid{ grid-template-columns:repeat(5, minmax(0, 1fr)); }
}
@media (max-width:360px){
    :root{ --gut:12px; }
    .grid{ gap:8px; }
    .card{ padding:6px; }
    .card-name{ font-size:.86rem; }
    .top-wa span{ display:none; }
    .top-wa{ width:42px; padding:0; justify-content:center; }
    .specs{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion:reduce){
    *{ animation:none !important; transition:none !important; }
}
