/* Hawary Store — navy + neon blue, taken from the shopfront sign.
   Light is the default; dark is the alternate. The header, footer and bottom
   bar stay navy in both, because that chrome is the brand itself. */

:root {
  --navy-900: #171B24;
  --navy-850: #1D222D;
  --navy-800: #242A38;
  --navy-750: #2A3140;
  --navy-700: #333B4C;
  --navy-600: #414A5E;

  --neon:      #0E9AC9;
  --neon-dim:  #0B7FA6;
  --neon-wash: rgba(14, 154, 201, .10);

  --paper:    #F6F8FB;
  --surface:  #FFFFFF;
  --raised:   #F1F4F9;
  --line:     #DFE4EC;
  --line-soft:#EDF0F5;

  --text:   #171B24;
  --text-2: #545D6D;
  --text-3: #8A94A4;

  --ok:        #34D399;
  --ok-wash:   rgba(52, 211, 153, .13);
  --warn:      #FBBF24;
  --warn-wash: rgba(251, 191, 36, .13);
  --off:       #98A1B0;
  --off-wash:  rgba(152, 161, 176, .16);
  --wa:        #25D366;

  /* Text sitting on a neon fill — flips with the theme. */
  --on-neon: #FFFFFF;

  --r:    14px;
  --r-sm: 9px;
  --hdr:  56px;
  --font: "Cairo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --paper:     var(--navy-850);
  --surface:   var(--navy-800);
  --raised:    var(--navy-750);
  --line:      var(--navy-700);
  --line-soft: #2C3341;
  --text:      #F2F5F9;
  --text-2:    #AEB7C7;
  --text-3:    #77808F;
  --neon:      #38C6F4;
  --neon-dim:  #2AA8D4;
  --neon-wash: rgba(56, 198, 244, .12);
  --off:       #6B7484;
  --off-wash:  rgba(107, 116, 132, .16);
  --on-neon:   #06232F;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1080px, 100% - 24px); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ---------------- header ---------------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: var(--navy-900);
  border-bottom: 1px solid var(--navy-700);
}
.hdr-in { display: flex; align-items: center; gap: 12px; height: var(--hdr); }

.logo {
  display: flex; align-items: center; gap: 9px;
  /* The wordmark is Latin and reads left-to-right, icon first — RTL would
     otherwise flip the phone icon to the far side of the text. */
  direction: ltr;
}

/* Sits beside the logo; the auto margin moved here so it stays adjacent and
   the theme button is the thing pushed to the far end. */
.hdr-link {
  margin-inline-start: 14px; margin-inline-end: auto;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--navy-700); background: transparent;
  color: #AEB7C7; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transition: .15s;
}
.hdr-link:hover { color: var(--neon); border-color: var(--neon); }
@media (max-width: 400px) { .hdr-link { margin-inline-start: 8px; padding: 5px 9px; font-size: 11.5px; } }
.logo svg { flex: none; }
.logo .txt { line-height: 1; }
.logo .txt b {
  display: block; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .04em;
}
.logo .txt span {
  display: block; color: #AEB7C7; font-size: 9.5px;
  font-weight: 600; letter-spacing: .34em; margin-top: 2px;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--navy-700); background: transparent; color: #AEB7C7;
  border-radius: 9px; cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--neon); border-color: var(--neon); }

/* ---------------- search ---------------- */
.searchbar {
  position: sticky; top: var(--hdr); z-index: 55;
  background: var(--paper);
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line-soft);
}
.sb { position: relative; }
.sb input {
  width: 100%; height: 50px;
  padding-block: 0; padding-inline-start: 16px; padding-inline-end: 48px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 16px; font-weight: 600; transition: .15s;
}
.sb input::placeholder { color: var(--text-3); font-weight: 500; }
.sb input:focus {
  outline: none; border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-wash);
}
.sb .ico { position: absolute; inset-inline-end: 15px; top: 15px; color: var(--text-3); pointer-events: none; }
.sb .clear {
  position: absolute; inset-inline-end: 12px; top: 12px; width: 26px; height: 26px;
  border: 0; background: var(--line); color: var(--text-2); border-radius: 50%;
  cursor: pointer; display: none; place-items: center; font-size: 17px; line-height: 1;
}
.sb.has-text .clear { display: grid; }
.sb.has-text .ico { display: none; }

.rows { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-top: 10px; }
.rows::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; font-weight: 700;
  white-space: nowrap; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--navy-600); }
.chip.on { background: var(--neon); border-color: var(--neon); color: var(--on-neon); }
.chip .c { font-size: 11.5px; opacity: .72; font-variant-numeric: tabular-nums; }

/* ---------------- results ---------------- */
main { padding-bottom: 90px; }
.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 0 2px; color: var(--text-3); font-size: 13px; font-weight: 600;
}
.meta b { color: var(--neon); font-variant-numeric: tabular-nums; }

.brand-h {
  display: flex; align-items: baseline; gap: 9px;
  margin: 22px 0 9px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.brand-h h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.brand-h .n { font-size: 12px; color: var(--text-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.brand-h .sub { font-size: 11.5px; color: var(--warn); font-weight: 600; margin-inline-start: auto; }

.list { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 740px) { .list { grid-template-columns: 1fr 1fr; } }

.row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s;
}
.row:hover { border-color: var(--neon-dim); }
.row.out { opacity: .5; }
.row.out:hover { border-color: var(--line); }

.info { flex: 1; min-width: 0; }
.name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; font-size: 14.5px; }
.name .cap { color: var(--text-2); font-weight: 600; font-size: 13px; }
.name .sw { font-size: 11.5px; letter-spacing: .5px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.t {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  border: 1px solid transparent; white-space: nowrap;
}
.t-tax  { background: var(--warn-wash); color: var(--warn); border-color: rgba(251,191,36,.3); }
.t-free { background: var(--ok-wash);  color: var(--ok);  border-color: rgba(52,211,153,.3); }
.t-out  { background: var(--off-wash); color: var(--off); border-color: var(--line); }
.t-info { background: var(--neon-wash); color: var(--neon); border-color: rgba(56,198,244,.3); }
.t-mut  { background: var(--raised); color: var(--text-2); border-color: var(--line); }

.right { display: flex; align-items: center; gap: 9px; flex: none; }
.price {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  text-align: end; line-height: 1.1; border-radius: 7px; transition: .15s;
}
.price b {
  display: block; font-size: 19px; font-weight: 800; color: var(--neon);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; direction: ltr;
}
.price span { font-size: 10px; color: var(--text-3); font-weight: 700; }
.price:hover b { color: var(--text); }
.price.copied b { color: var(--ok); }
.row.out .price b { color: var(--off); text-decoration: line-through; }

.wa-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; background: var(--wa); color: #fff; transition: .15s;
}
.wa-btn:hover { transform: scale(1.08); }

.empty { text-align: center; padding: 64px 20px; color: var(--text-2); }
.empty b { display: block; font-size: 17px; color: var(--text); margin-bottom: 6px; }

/* ---------------- footer + bar ---------------- */
.ft { margin-top: 46px; border-top: 1px solid var(--navy-700); background: var(--navy-900); padding: 26px 0 30px; }
.ft-g { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .ft-g { grid-template-columns: 1.1fr 1fr 1fr; } }
.ft h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #77808F; font-weight: 800; }
.ft p, .ft a { display: block; margin: 0 0 5px; color: #AEB7C7; font-size: 13.5px; }
.ft a:hover { color: var(--neon); }
.ft .tel { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.soc { display: flex; gap: 8px; margin-top: 10px; }
.soc a {
  width: 32px; height: 32px; display: grid; place-items: center; margin: 0;
  border: 1px solid var(--navy-700); border-radius: 8px; color: #AEB7C7;
}
.soc a:hover { color: var(--neon); border-color: var(--neon); }
.copy { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--navy-700); color: #77808F; font-size: 12px; }

.bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
  display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--navy-900); border-top: 1px solid var(--navy-700);
}
.bar a { flex: 1; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14.5px; }
.bar .w { background: var(--wa); color: #fff; }
.bar .c { background: var(--neon); color: var(--on-neon); }
@media (min-width: 860px) { .bar { display: none; } main { padding-bottom: 20px; } }

.toast {
  position: fixed; bottom: 74px; inset-inline-start: 50%; transform: translateX(50%) translateY(20px);
  background: var(--neon); color: var(--on-neon); padding: 9px 18px; border-radius: 10px;
  font-weight: 800; font-size: 13.5px; z-index: 100; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* A brand heading whose note is a full sentence must not squeeze the count
   onto two lines on a phone. */
@media (max-width: 560px) {
  .brand-h { flex-wrap: wrap; row-gap: 3px; }
  .brand-h .sub { margin-inline-start: 0; flex-basis: 100%; }
}

/* ---------------- old-style text list ---------------- */
.oldwrap { padding-top: 6px; }

.oldblk {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 14px; overflow: hidden;
}
/* Two tabs splitting the full width — a thumb should hit either without aiming. */
.listtabs { display: flex; gap: 8px; padding-top: 12px; }
.listtabs .chip {
  flex: 1; justify-content: center;
  padding-block: 12px; font-size: 15px;
}

/* Lines mix Arabic and Latin ("ايفون ٢٠ واط (1000)" next to "17promax 512G
   (106000)"). plaintext resolves each line on its own, so a trailing price
   never jumps to the wrong end; text-align keeps them on one edge regardless,
   which pure plaintext would not do. */
.oldlist {
  margin: 0; padding: 15px;
  font-family: var(--font); font-size: 14.5px; line-height: 2.05;
  white-space: pre-wrap; overflow-wrap: anywhere;
  direction: rtl; unicode-bidi: plaintext; text-align: right;
  color: var(--text);
}
@media (max-width: 560px) { .oldlist { font-size: 13.5px; line-height: 1.95; padding: 12px; } }
