/* ============================================================
   بوابة الجوال — app.css
   Design: Dark luxury gold theme, Cairo/Tajawal fonts
============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  --gold:       #C8A84B;
  --gold2:      #E8C96A;
  --gold-dim:   rgba(200,168,75,0.14);
  --gold-glow:  rgba(200,168,75,0.25);
  --dark:       #07070F;
  --dark2:      #0D0D18;
  --dark3:      #121220;
  --dark4:      #191928;
  --dark5:      #202035;
  --dark6:      #282840;
  --text:       #EDE9E0;
  --text2:      #9B9490;
  --text3:      #5A5860;
  --border:     rgba(200,168,75,0.18);
  --border2:    rgba(200,168,75,0.08);
  --red:        #E05252;
  --green:      #4CAF72;
  --blue:       #4A8ED9;
  --header-h:   60px;
  --sidebar-w:  230px;
  --radius:     12px;
  --radius-sm:  8px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: var(--dark6); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ============================================================
   TOPBAR / HEADER
============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(7,7,15,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.topbar-inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; text-decoration: none;
  margin-left: 20px;
}
.logo-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), #8A6820);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  box-shadow: 0 0 16px var(--gold-glow);
  flex-shrink: 0;
}
.logo-texts { display: flex; flex-direction: column; }
.logo-name { font-size: 18px; font-weight: 900; color: var(--gold); font-family: 'Tajawal'; line-height: 1.1; }
.logo-tagline { font-size: 9px; color: var(--text3); line-height: 1; }

/* ============================================================
   TOP NAV + DROPDOWNS
============================================================ */
.topnav {
  display: flex; align-items: center;
  gap: 2px; flex: 1;
}

.nav-top-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: transparent;
  border: none; border-radius: 20px;
  color: var(--text2);
  font-size: 13px; font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-top-btn:hover { background: var(--dark4); color: var(--text); }
.nav-top-btn.active { color: var(--gold); background: var(--gold-dim); }
.caret { font-size: 9px; opacity: 0.7; }

/* Dropdown wrapper */
.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 300;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.dropdown-panel.wide-panel {
  min-width: 480px;
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 16px;
}

.dp-label {
  font-size: 10px; font-weight: 800; color: var(--text3);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 8px; margin-top: 4px;
}
.dp-label:first-child { margin-top: 0; }

.dp-link {
  display: block; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text2);
  transition: all 0.15s;
}
.dp-link:hover { background: var(--dark4); color: var(--gold); padding-right: 14px; }

.dp-sep { height: 1px; background: var(--border2); margin: 8px 0; }

/* Brand grid inside dropdown */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.brand-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 6px;
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-align: center;
}
.brand-box:hover { border-color: var(--gold); background: var(--gold-dim); }
.brand-icon { font-size: 22px; }
.brand-label { font-size: 11px; font-weight: 700; color: var(--text2); }
.brand-box:hover .brand-label { color: var(--gold); }

/* ============================================================
   SEARCH IN HEADER
============================================================ */
.header-search { position: relative; margin-right: 10px; }

.search-trigger {
  background: var(--dark3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  transition: all 0.2s;
}
.search-trigger:hover { border-color: var(--gold); color: var(--gold); }

.search-box {
  display: none;
  position: absolute; left: 0; top: calc(100% + 8px);
  width: 360px;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.search-box.open { display: block; }

.search-box input {
  width: 100%; padding: 13px 16px;
  background: transparent; border: none;
  color: var(--text); font-size: 14px; font-family: 'Cairo';
  outline: none; border-bottom: 1px solid var(--border2);
}
.search-box input::placeholder { color: var(--text3); }

.search-results { max-height: 320px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; transition: background 0.15s; cursor: pointer;
}
.search-result-item:hover { background: var(--dark4); }
.sri-ico { font-size: 20px; }
.sri-name { font-size: 13px; font-weight: 600; }
.sri-brand { font-size: 11px; color: var(--text3); }
.sri-price { margin-right: auto; font-size: 13px; font-weight: 700; color: var(--gold); }
.search-empty { padding: 20px; text-align: center; color: var(--text3); font-size: 13px; }

/* Mobile menu button */
.mobile-menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text2); padding: 6px 12px; border-radius: 8px;
  font-size: 16px; margin-right: 10px;
}

/* ============================================================
   LAYOUT BODY
============================================================ */
.layout-body {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  position: fixed;
  top: var(--header-h); bottom: 0; right: 0;
  width: var(--sidebar-w);
  background: var(--dark2);
  border-left: 1px solid var(--border2);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-inner { padding: 16px 0 30px; }

.sidebar-section { margin-bottom: 6px; }
.sidebar-label {
  font-size: 9px; font-weight: 800; color: var(--text3);
  letter-spacing: 2px; padding: 10px 16px 5px;
  text-transform: uppercase;
}

.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  font-size: 13px; color: var(--text2);
  border-right: 3px solid transparent;
  transition: all 0.18s;
  position: relative;
}
.side-link:hover { background: var(--dark3); color: var(--text); }
.side-link.active { background: var(--gold-dim); color: var(--gold); border-right-color: var(--gold); font-weight: 600; }
.si { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.side-badge {
  margin-right: auto;
  font-size: 9px; font-weight: 800;
  background: var(--gold); color: #000;
  border-radius: 10px; padding: 1px 7px;
}
.side-badge.new-badge { background: var(--green); color: #fff; }

/* ============================================================
   MAIN CONTENT
============================================================ */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  padding: 28px;
  max-width: 100%;
}

/* ============================================================
   SHARED COMPONENTS
============================================================ */

/* Page title bar */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px; font-weight: 900; font-family: 'Tajawal';
  color: var(--gold);
}
.page-title span { color: var(--text2); font-size: 14px; font-weight: 400; margin-right: 10px; }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* Buttons */
.btn-gold {
  padding: 10px 22px; border-radius: 22px;
  background: var(--gold); color: #000;
  font-weight: 700; font-size: 13px; font-family: 'Cairo';
  border: none; transition: all 0.2s;
}
.btn-gold:hover { background: var(--gold2); transform: translateY(-1px); }

.btn-outline {
  padding: 9px 20px; border-radius: 22px;
  background: transparent; color: var(--gold);
  font-weight: 600; font-size: 13px; font-family: 'Cairo';
  border: 1px solid var(--border); transition: all 0.2s;
}
.btn-outline:hover { background: var(--gold-dim); border-color: var(--gold); }

/* Filter Bar */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-label { font-size: 11px; color: var(--text3); flex-shrink: 0; }

.chip {
  padding: 6px 14px; border-radius: 18px;
  border: 1px solid var(--border2);
  background: transparent; color: var(--text2);
  font-size: 12px; font-family: 'Cairo';
  transition: all 0.18s; white-space: nowrap;
}
.chip:hover { border-color: var(--border); color: var(--text); }
.chip.active, .chip.on {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* Select / Dropdown */
.sel {
  background: var(--dark3);
  border: 1px solid var(--border2);
  border-radius: 18px;
  color: var(--text2);
  padding: 7px 14px;
  font-size: 12px;
  font-family: 'Cairo';
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235A5860'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 28px;
}
.sel:focus { border-color: var(--gold); }

/* ============================================================
   HERO BANNER
============================================================ */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, var(--dark3) 0%, #0E0E28 50%, var(--dark3) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 38px 44px;
  margin-bottom: 30px;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; top: -80px; left: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-banner::after {
  content: '📱';
  position: absolute; left: 44px; top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  font-size: 120px; opacity: 0.05;
  pointer-events: none;
}
.hero-h1 {
  font-size: 34px; font-weight: 900;
  font-family: 'Tajawal'; line-height: 1.2;
  margin-bottom: 10px;
}
.hero-h1 em { color: var(--gold); font-style: normal; }
.hero-p { font-size: 14px; color: var(--text2); max-width: 500px; line-height: 1.7; margin-bottom: 22px; }
.hero-stats { display: flex; gap: 32px; margin-bottom: 22px; }
.hstat-num { font-size: 28px; font-weight: 900; color: var(--gold); font-family: 'Tajawal'; }
.hstat-label { font-size: 11px; color: var(--text3); }
.hero-btns { display: flex; gap: 10px; }

/* ============================================================
   STATS ROW
============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--dark3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.stat-ico {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-ico.g { background: rgba(200,168,75,0.12); }
.stat-ico.b { background: rgba(74,142,217,0.12); }
.stat-ico.gr { background: rgba(76,175,114,0.12); }
.stat-ico.r { background: rgba(224,82,82,0.12); }
.stat-num { font-size: 22px; font-weight: 900; font-family: 'Tajawal'; }
.stat-lbl { font-size: 11px; color: var(--text2); }

/* ============================================================
   PHONE CARDS
============================================================ */
.phones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.phone-card {
  background: var(--dark3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.22s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  color: var(--text);
}
.phone-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.phone-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.45);
  color: var(--text);
}
.phone-card:hover::before { opacity: 1; }

.card-badges {
  display: flex; gap: 4px;
  margin-bottom: 10px; min-height: 20px;
  flex-wrap: wrap;
}
.badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 7px;
  letter-spacing: 0.4px;
}
.b-new  { background: rgba(76,175,114,0.15); color: var(--green); border: 1px solid rgba(76,175,114,0.3); }
.b-hot  { background: rgba(224,82,82,0.15); color: var(--red); border: 1px solid rgba(224,82,82,0.3); }
.b-5g   { background: rgba(74,142,217,0.15); color: var(--blue); border: 1px solid rgba(74,142,217,0.3); }
.b-fold { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--border); }

/* Phone visual — stylized SVG phone shape */
.card-phone-visual {
  display: flex; justify-content: center;
  height: 110px; margin-bottom: 12px;
}
.phone-shape {
  width: 52px; height: 94px;
  border-radius: 9px;
  border: 2px solid rgba(200,168,75,0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow:
    3px 6px 20px rgba(0,0,0,0.5),
    -1px -1px 6px rgba(200,168,75,0.08),
    inset 0 1px 0 rgba(200,168,75,0.1);
  position: relative;
}
.ps-notch {
  height: 7px; background: inherit;
  display: flex; align-items: center; justify-content: center;
}
.ps-notch::after {
  content: '';
  width: 14px; height: 3px;
  border-radius: 2px;
  background: rgba(200,168,75,0.2);
}
.ps-screen {
  flex: 1;
  background: linear-gradient(160deg, #182035 0%, #0A1018 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 7px; color: rgba(200,168,75,0.3);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}
.ps-screen::before {
  content: '';
  position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px;
  background: linear-gradient(120deg, rgba(74,142,217,0.06) 0%, transparent 60%);
  border-radius: 3px;
}
.ps-home {
  height: 14px; background: inherit;
  display: flex; align-items: center; justify-content: center;
}
.ps-home::after {
  content: '';
  width: 18px; height: 4px;
  border-radius: 3px;
  background: rgba(200,168,75,0.18);
}

.card-brand { font-size: 9px; font-weight: 800; color: var(--gold); letter-spacing: 2px; margin-bottom: 3px; }
.card-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; line-height: 1.3; }
.card-tagline { font-size: 11px; color: var(--text3); margin-bottom: 9px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-specs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.spec-chip {
  font-size: 9px; color: var(--text2);
  background: var(--dark4); border: 1px solid var(--border2);
  border-radius: 5px; padding: 2px 6px;
}
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; }
.card-price { font-size: 16px; font-weight: 900; color: var(--gold); font-family: 'Tajawal'; }
.card-price small { font-size: 10px; color: var(--text3); font-weight: 400; }
.card-score { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--gold); }
.score-bar { height: 2px; background: var(--dark5); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 2px; }

/* ============================================================
   PHONE DETAIL PAGE
============================================================ */
.detail-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  background: var(--dark3);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 22px;
}
.detail-visual {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.detail-phone {
  width: 110px; height: 210px;
  border-radius: 18px;
  border: 2px solid rgba(200,168,75,0.45);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px var(--gold-dim);
}
.dp-notch { height: 12px; display: flex; align-items: center; justify-content: center; }
.dp-notch::after { content: ''; width: 24px; height: 4px; border-radius: 3px; background: rgba(200,168,75,0.18); }
.dp-screen {
  flex: 1;
  background: linear-gradient(160deg, #152030 0%, #0A1018 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.dp-screen-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(200,168,75,0.25); }
.dp-home { height: 22px; display: flex; align-items: center; justify-content: center; }
.dp-home::after { content: ''; width: 32px; height: 5px; border-radius: 4px; background: rgba(200,168,75,0.18); }
.detail-price-box { text-align: center; }
.d-big-price { font-size: 28px; font-weight: 900; color: var(--gold); font-family: 'Tajawal'; }
.d-big-price small { font-size: 13px; color: var(--text3); font-weight: 400; }
.d-score { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--gold); margin-top: 6px; }

.detail-info h1 { font-size: 26px; font-weight: 900; font-family: 'Tajawal'; margin-bottom: 4px; }
.detail-brand { font-size: 10px; font-weight: 800; color: var(--gold); letter-spacing: 2px; margin-bottom: 8px; }
.detail-tagline { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 16px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.spec-box {
  background: var(--dark4); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px;
}
.spec-box-ico { font-size: 18px; margin-bottom: 5px; }
.spec-box-lbl { font-size: 10px; color: var(--text3); margin-bottom: 3px; }
.spec-box-val { font-size: 12px; font-weight: 700; }

/* Sellers */
.sellers-section {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.sellers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.seller-card {
  background: var(--dark4); border: 1px solid var(--border2);
  border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all 0.2s; cursor: pointer; text-align: center;
}
.seller-card:hover { border-color: var(--gold); background: var(--dark5); }
.seller-ico { font-size: 26px; }
.seller-name { font-size: 12px; font-weight: 700; }
.seller-price { font-size: 15px; font-weight: 900; color: var(--gold); font-family: 'Tajawal'; }
.seller-note { font-size: 10px; color: var(--text3); }
.seller-avail { font-size: 9px; color: var(--green); font-weight: 700; }

/* YouTube Reviews */
.yt-section {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.yt-card {
  background: var(--dark4); border: 1px solid var(--border2);
  border-radius: 10px; overflow: hidden; cursor: pointer;
  transition: all 0.2s;
}
.yt-card:hover { border-color: #FF0000; transform: translateY(-2px); }
.yt-thumb {
  height: 100px; background: var(--dark5);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.yt-thumb-bg { font-size: 44px; opacity: 0.12; }
.yt-play {
  position: absolute;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
}
.yt-play::after {
  content: '';
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #fff;
  margin-left: 3px;
}
.yt-body { padding: 10px 12px; }
.yt-title { font-size: 12px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.yt-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--text3); }
.yt-ch { color: var(--text2); }

/* ============================================================
   PRICES TABLE
============================================================ */
.prices-wrap { background: var(--dark3); border: 1px solid var(--border2); border-radius: var(--radius); overflow: hidden; }
.prices-table { width: 100%; border-collapse: collapse; }
.prices-table thead th {
  background: var(--dark4); padding: 11px 14px;
  text-align: right; font-size: 11px; font-weight: 700;
  color: var(--text3); letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.prices-table tbody tr { transition: background 0.15s; cursor: pointer; }
.prices-table tbody tr:hover { background: var(--dark4); }
.prices-table tbody td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid rgba(200,168,75,0.05); vertical-align: middle; }
.prices-table tbody tr:last-child td { border-bottom: none; }

.rank-n {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: var(--dark5); color: var(--text3);
}
.rank-n.r1 { background: linear-gradient(135deg, #FFD700, #E0A800); color: #000; }
.rank-n.r2 { background: linear-gradient(135deg, #C0C0C0, #909090); color: #000; }
.rank-n.r3 { background: linear-gradient(135deg, #CD7F32, #8B5A1A); color: #fff; }

.price-val { font-size: 14px; font-weight: 800; color: var(--gold); font-family: 'Tajawal'; }
.price-val.best { color: var(--green); }
.score-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--gold-dim); color: var(--gold);
  border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 700;
}

/* ============================================================
   COMPARE
============================================================ */
.compare-pick-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 20px; align-items: center; margin-bottom: 28px;
}
.pick-card {
  background: var(--dark3); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.2s; min-height: 140px; justify-content: center;
  text-align: center;
}
.pick-card:hover { border-color: var(--gold); background: var(--gold-dim); }
.pick-card.picked { border-style: solid; border-color: var(--gold); }
.vs-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: #000;
  font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--gold-glow);
}
.compare-table-wrap { background: var(--dark3); border: 1px solid var(--border2); border-radius: var(--radius); overflow: hidden; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table thead th {
  padding: 16px; text-align: center; background: var(--dark4);
  border-bottom: 1px solid var(--border2); font-size: 14px;
}
.compare-table thead th:first-child { text-align: right; color: var(--text3); font-size: 11px; width: 130px; }
.compare-table tbody td { padding: 12px 16px; text-align: center; border-bottom: 1px solid rgba(200,168,75,0.05); font-size: 13px; }
.compare-table tbody td:first-child { text-align: right; color: var(--text2); font-size: 11px; font-weight: 700; }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover td { background: var(--dark4); }
.cv-win { color: var(--green); font-weight: 700; }
.cv-lose { color: var(--text3); }
.cv-eq { color: var(--text2); }

/* ============================================================
   ENCYCLOPEDIA
============================================================ */
.enc-hero {
  background: linear-gradient(135deg, var(--dark3), var(--dark4));
  border: 1px solid var(--border);
  border-radius: 16px; padding: 32px;
  margin-bottom: 26px;
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
}
.enc-hero h2 { font-size: 26px; font-weight: 900; font-family: 'Tajawal'; margin-bottom: 8px; }
.enc-hero p { font-size: 13px; color: var(--text2); line-height: 1.7; }
.enc-big-icon { font-size: 80px; opacity: 0.25; }

.enc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 26px; }
.enc-card {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 18px;
  cursor: pointer; transition: all 0.2s;
}
.enc-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.enc-ico { font-size: 30px; margin-bottom: 8px; }
.enc-name { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.enc-desc { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 8px; }
.enc-meta { font-size: 10px; color: var(--text3); }

.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.company-card {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 18px;
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.company-card:hover { border-color: var(--gold); }
.company-flag { font-size: 30px; margin-bottom: 8px; }
.company-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.company-country { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.company-tag { font-size: 10px; color: var(--gold); background: var(--gold-dim); padding: 2px 9px; border-radius: 8px; display: inline-block; }

/* ============================================================
   NEWS
============================================================ */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.news-card {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all 0.2s;
}
.news-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.news-img {
  height: 130px; background: var(--dark4);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; opacity: 0.35;
}
.news-body { padding: 14px; }
.news-cat { font-size: 9px; font-weight: 800; color: var(--gold); letter-spacing: 1px; margin-bottom: 5px; }
.news-title { font-size: 13px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.news-meta { font-size: 10px; color: var(--text3); display: flex; gap: 8px; }

/* ============================================================
   TRENDING SIDEBAR (home)
============================================================ */
.home-grid { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.trending-panel {
  background: var(--dark3); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 18px;
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.trending-h { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.trending-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--border2);
  cursor: pointer; transition: padding 0.15s;
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-item:hover { padding-right: 6px; }
.t-rank { font-size: 13px; font-weight: 900; color: var(--text3); min-width: 18px; font-family: 'Tajawal'; }
.t-rank.hot { color: var(--red); }
.t-name { font-size: 12px; font-weight: 600; }
.t-brand { font-size: 10px; color: var(--text3); }
.t-price { margin-right: auto; font-size: 12px; font-weight: 700; color: var(--gold); font-family: 'Tajawal'; white-space: nowrap; }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: var(--dark2);
  border-top: 1px solid var(--border2);
  margin-top: 60px;
  margin-right: var(--sidebar-w);
}
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 40px 28px 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 28px; }
.footer-brand p { font-size: 13px; color: var(--text2); margin-top: 10px; line-height: 1.7; max-width: 280px; }
.footer-col h4 { font-size: 11px; font-weight: 800; color: var(--gold); margin-bottom: 12px; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: 12px; color: var(--text2); margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--border2); padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text3);
}

/* ============================================================
   PAGINATION
============================================================ */
.pagination-wrap { display: flex; justify-content: center; margin-top: 30px; gap: 6px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 14px; border-radius: 8px;
  background: var(--dark3); border: 1px solid var(--border2);
  color: var(--text2); font-size: 13px; font-family: 'Cairo';
  cursor: pointer; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }

/* ============================================================
   MODAL / OVERLAY
============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
}
.overlay.open { display: flex; }
.modal {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  max-width: 460px; width: 92%;
  max-height: 80vh; overflow-y: auto;
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 20px; cursor: pointer; }
.modal-close:hover { color: var(--gold); }

.selector-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border2); transition: all 0.2s;
}
.sel-item:hover { border-color: var(--gold); background: var(--gold-dim); }
.sel-name { font-size: 12px; font-weight: 600; }
.sel-brand { font-size: 10px; color: var(--text3); }
.sel-price { margin-right: auto; font-size: 12px; color: var(--gold); font-weight: 700; }

/* ============================================================
   ALERTS & TOASTS
============================================================ */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
  border: 1px solid;
}
.alert-info { background: rgba(74,142,217,0.1); border-color: rgba(74,142,217,0.3); color: var(--blue); }
.alert-success { background: rgba(76,175,114,0.1); border-color: rgba(76,175,114,0.3); color: var(--green); }
.alert-warn { background: rgba(200,168,75,0.1); border-color: var(--border); color: var(--gold); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .specs-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .dropdown-panel.wide-panel { min-width: 320px; grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(100%); width: 220px; }
  .sidebar.open { transform: translateX(0); width: 220px; box-shadow: -10px 0 40px rgba(0,0,0,0.5); }
  .main-content { margin-right: 0; padding: 16px; }
  .footer { margin-right: 0; }
  .mobile-menu-btn { display: flex; }
  .topnav { display: none; }
  .header-search .search-trigger { padding: 7px 12px; font-size: 12px; }
  .hero-banner { padding: 24px; }
  .hero-h1 { font-size: 24px; }
  .compare-pick-row { grid-template-columns: 1fr; }
  .phones-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .enc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .phones-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.3s ease both; }

/* LIGHT MODE */
body.light {
  --gold:#A07830;--gold2:#C09040;--gold-dim:rgba(160,120,48,0.10);--gold-glow:rgba(160,120,48,0.20);
  --dark:#F5F4F0;--dark2:#ECEAE4;--dark3:#E4E2DA;--dark4:#D8D5CC;--dark5:#CCCAC0;--dark6:#BFBCB2;
  --text:#1A1A1A;--text2:#5A5550;--text3:#9A9890;
  --border:rgba(160,120,48,0.22);--border2:rgba(160,120,48,0.10);
  --red:#C03030;--green:#2E7D4F;--blue:#2060A0;
}
body.light .topbar{background:rgba(245,244,240,0.97)}
body.light .phone-card:hover{box-shadow:0 14px 44px rgba(0,0,0,0.15)}
body.light .dropdown-panel{box-shadow:0 20px 60px rgba(0,0,0,0.15)}
body.light .ps-screen,.dp-screen{background:linear-gradient(160deg,#C8D8E8 0%,#A8B8C8 100%)}
body.light .hero-banner{background:linear-gradient(135deg,var(--dark3) 0%,#E0DDD5 50%,var(--dark3) 100%)}
.theme-toggle{width:38px;height:38px;border-radius:50%;background:var(--dark3);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:17px;transition:all 0.2s;flex-shrink:0;margin-right:8px}
.theme-toggle:hover{background:var(--gold-dim);border-color:var(--gold)}
