/* ===========================================================
   DZ Phones — dzphones.xyz
   Light, clean, content-first. RTL Arabic.
   =========================================================== */

:root {
  --bg: #FAFAF8;
  --bg-raised: #FFFFFF;
  --ink: #15171C;
  --ink-soft: #4B4F58;
  --muted: #6B7280;
  --border: #E8E6E0;
  --accent: #1E6F5C;       /* deep teal-green */
  --accent-dark: #154F41;
  --accent-soft: #E6F2EE;
  --flag-red: #D6463C;     /* used sparingly: price emphasis */
  --flag-red-soft: #FBEAE8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 15, 0.04), 0 1px 1px rgba(20,20,15,0.03);
  --shadow-md: 0 8px 24px rgba(20, 20, 15, 0.07);
  --font-display: 'Cairo', 'Tajawal', sans-serif;
  --font-body: 'Tajawal', 'Cairo', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 48px 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.logo-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%);
}

.logo-mark::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 9px;
  height: 9px;
  background: var(--flag-red);
  border-radius: 50%;
  border: 2px solid var(--bg-raised);
}

.logo-mark-dz {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.92rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-mark-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.logo-mark-sm .logo-mark-dz { font-size: 0.68rem; }
.logo-mark-sm::before { width: 6px; height: 6px; right: 3px; bottom: 3px; border-width: 1.5px; }

.brand-text { color: var(--ink); }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.main-nav { display: flex; gap: 28px; font-weight: 600; font-size: 0.95rem; }
.main-nav a { color: var(--ink-soft); transition: color 0.15s; }
.main-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner { padding: 64px 20px 56px; text-align: center; max-width: 760px; margin: 0 auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid rgba(30, 111, 92, 0.18);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 28px;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.97rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-ghost { background: var(--bg-raised); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- Section heads ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.see-all { font-weight: 700; color: var(--accent-dark); white-space: nowrap; font-size: 0.95rem; }
.see-all:hover { text-decoration: underline; }

.page-head { padding-bottom: 16px; }

/* ---------- Phone grid & card ---------- */
.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.phone-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.phone-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(30, 111, 92, 0.3);
}

.phone-card-img {
  margin: -18px -18px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-card-img img {
  height: 92%;
  width: auto;
  object-fit: contain;
}

.phone-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.phone-brand-tag {
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

.phone-card-name {
  font-size: 1.08rem;
  margin: 0;
  font-family: var(--font-display);
}

.phone-card-name-ar {
  font-size: 0.86rem;
  color: var(--muted);
  margin: -6px 0 0;
}

.spec-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 999px;
}

.spec-icon { color: var(--accent); font-size: 0.85em; }

.phone-card-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--border);
}

.phone-card-price strong { color: var(--flag-red); font-size: 1.05em; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-chip {
  font-family: var(--font-body);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--accent); color: var(--accent-dark); }

.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Brand grid ---------- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}

.brand-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.brand-card-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.brand-card-name-ar { font-size: 0.82rem; color: var(--muted); }
.brand-card-count { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

.ar-soft { font-weight: 500; color: var(--muted); font-size: 0.85em; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: 18px 20px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb span { color: var(--ink); font-weight: 600; }

/* ---------- Phone detail page ---------- */
.phone-detail { padding: 24px 20px 64px; max-width: 880px; }

.phone-detail-top {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 32px;
}

.phone-detail-img {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.phone-detail-img img { width: 100%; height: auto; }

.phone-detail-head { margin-bottom: 0; }
.phone-detail-name-ar { font-size: 1.05rem; color: var(--muted); margin: -8px 0 14px; }
.phone-detail-sub { font-size: 1.05rem; }

@media (max-width: 560px) {
  .phone-detail-top { grid-template-columns: 1fr; }
  .phone-detail-img { max-width: 200px; margin: 0 auto; }
}

.price-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.price-box-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.price-label { font-weight: 700; color: var(--ink-soft); }
.price-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--flag-red); }

.price-table, .specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.price-table th, .price-table td,
.specs-table th, .specs-table td {
  padding: 12px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.price-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.price-table td:last-child { font-weight: 700; color: var(--accent-dark); }

.specs-table th {
  width: 35%;
  color: var(--muted);
  font-weight: 600;
  vertical-align: top;
}

.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: none; }

.price-disclaimer { font-size: 0.82rem; color: var(--muted); margin: 16px 0 0; }

.specs-section { margin-bottom: 40px; }

.related-section { margin-top: 8px; }
.related-section h2 { margin-bottom: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding: 40px 20px 24px;
}

.footer-inner > div:first-child { max-width: 420px; }
.footer-inner p { font-size: 0.88rem; margin: 6px 0 0; }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.92rem; font-weight: 600; }
.footer-links a:hover { color: var(--accent-dark); }

.footer-bottom {
  padding: 16px 20px 28px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .main-nav { gap: 16px; font-size: 0.88rem; }
  .hero-inner { padding: 44px 20px 40px; }
  .section { padding: 36px 0; }
  .footer-inner { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
