:root {
  color-scheme: light;
  --bg: #e2e8f0;
  --card: #ffffff;
  --muted: #1e293b;
  --text: #0f172a;
  --brand: #15803d;
  --accent: #047857;
  --danger: #b91c1c;
  --list: #334155;
  --badge-bg: #f1f5f9;
  --badge-text: #0f172a;
  --badge-border: #d7dee9;
  --pill-bg: #cbd5e1;
  --pill-border: #c0c9d7;
  --card-border: #d7dee9;
  --gallery-bg: #f1f5f9;
  --media-border: #d7dee9;
  --media-bg: #ffffff;
  --divider: #d2d9e4;
  --btn-secondary-bg: #e8edf5;
  --btn-secondary-border: #cbd5e1;
  --btn-secondary-text: #0f172a;
  --scrollbar-track: #e2e8f0;
  --scrollbar-thumb: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  --scrollbar-thumb-hover: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  --scrollbar-thumb-color: #a2b1c6;
  --radius: 16px;
}

:root.dark {
  color-scheme: dark;
  --bg: #0b0f14;
  --card: #131a22;
  --muted: #a7b1bd;
  --text: #eef3f8;
  --brand: #22c55e;
  --accent: #60a5fa;
  --danger: #f97316;
  --list: #dce7f3;
  --badge-bg: #1b2532;
  --badge-text: #cfe3ff;
  --badge-border: #243244;
  --pill-bg: #18212b;
  --pill-border: #223140;
  --card-border: #1e2835;
  --gallery-bg: #0e141b;
  --media-border: #223140;
  --media-bg: #0b0f14;
  --divider: #1e2835;
  --btn-secondary-bg: #0f1720;
  --btn-secondary-border: #1f2a37;
  --btn-secondary-text: #d9e3ef;
  --scrollbar-track: #0b0f14;
  --scrollbar-thumb: linear-gradient(180deg, #2e343b 0%, #3d434b 100%);
  --scrollbar-thumb-hover: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  --scrollbar-thumb-color: #3a3f46;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.6 "Cairo", "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
}

body.rtl header {
  text-align: right;
}

body.rtl .details {
  text-align: right;
}

.top-actions {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  justify-content: flex-end;
}

.lang-toggle {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s, transform 0.1s;
}

.lang-toggle img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.lang-toggle:hover {
  background: #16a34a;
  transform: scale(1.05);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

header {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.title {
  font-weight: 800;
  font-size: clamp(22px, 3vw, 34px);
}

.sub {
  color: var(--muted);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  background: var(--pill-bg);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  font-size: 13px;
  color: var(--muted);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-number {
  unicode-bidi: isolate;
  display: inline-block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  text-decoration: underline;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

#offers-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  width: 100%;
  grid-column: 1 / -1;
}

#offers-container > p {
  grid-column: 1 / -1;
  text-align: center;
  margin: 24px 0;
}

.card {
  grid-column: span 12;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: background 0.3s ease, border 0.3s ease;
}

.card-inner {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .card-inner {
    grid-template-columns: 50% 50%;
  }
}

@media (max-width: 725px) {
  .top-actions {
    top: 12px;
    inset-inline-end: 12px;
    gap: 8px;
  }

  .container {
    padding-top: 36px;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
  background: var(--gallery-bg);
  transition: background 0.3s ease;
}

.gallery img,
.gallery video {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--media-border);
  background: var(--media-bg);
  transition: all 0.3s ease;
}

.gallery .hero {
  grid-column: span 3;
  height: 220px;
}

.details {
  padding: 14px 16px 18px;
}

.code {
  font: 700 12px/1 monospace;
  color: var(--accent);
}

.h2 {
  margin: 6px 0 4px;
  font-weight: 750;
  font-size: clamp(18px, 2.2vw, 22px);
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.badge {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--badge-text);
  transition: all 0.3s ease;
}

.list {
  margin: 10px 0 14px;
  padding-inline-start: 18px;
  padding-inline-end: 18px;
  color: var(--list);
  transition: color 0.3s ease;
}

.price {
  font-weight: 800;
  font-size: 20px;
  color: var(--brand);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 0;
  cursor: pointer;
  color: #07110a;
  background: var(--brand);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 750;
  transition: transform 0.06s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

.btn:active {
  transform: translateY(1px);
}

.icon-wa {
  width: 20px;
  height: 20px;
  fill: #fff;
  vertical-align: middle;
  margin-inline-end: 8px;
  transition: transform 0.2s ease;
}

.btn:hover .icon-wa {
  transform: scale(1.15);
}

footer {
  margin: 34px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.divider {
  height: 1px;
  background: var(--divider);
  margin: 22px 0;
  opacity: 0.8;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 20px;
  border: 2px solid var(--bg);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border: 2px solid var(--bg);
}

@supports (scrollbar-width: thin) and (scrollbar-color: auto) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track);
  }
}

#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
  transition: opacity 0.3s ease;
}

#lightbox.hidden {
  display: none;
}

#lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 90vh;
  max-width: 90vw;
}

.lightbox-media-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 12px;
  border: 2px solid var(--card-border);
}

#lightbox button,
#lightbox span {
  position: absolute;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

#lightbox button:hover,
#lightbox span:hover {
  background: rgba(255, 255, 255, 0.2);
}

#lightbox-close {
  top: 20px;
  right: 30px;
  font-size: 2.4rem;
}

#lightbox-prev {
  left: 50px;
}

#lightbox-next {
  right: 50px;
}

.icon-sprite {
  display: none;
}

.status-text {
  grid-column: 1 / -1;
  text-align: center;
  margin: 24px 0;
}

.error-text {
  color: #ef4444;
}
