@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #050b14;        /* درجة اللون الغامق جداً المطابقة للصورة */
  --panel: #08101e;     /* لون البانل والـ Header */
  --card: #0d1722;      /* لون كروت الألعاب والتصنيفات */
  --text: #ffffff;
  --muted: #94a3b8;     /* لون النصوص الفرعية الرمادية */
  --accent: #65cc00;    /* النيون الأخضر اللامع المكتوب بـ Fox Games */
  --line: rgba(30, 58, 99, 0.4); /* خطوط تقسيم ناعمة مائلة للأزرق الداكن */
  --line2: rgba(101, 204, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ربط الـ Canvas الخاص بالخلفية */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.content {
  max-width: 1440px;
  margin: auto;
  padding: 0 40px;
}

/* ================= HEADER (TOPBAR) ================= */

.topbar {
  height: 76px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand b, .green-text {
  color: var(--accent);
}

.mainNav {
  display: flex;
  gap: 12px;
  margin-left: 40px;
}

.mainNav a {
  position: relative;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 16px;
  border-bottom: none !important;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mainNav a.active {
  color: #000000 !important;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(101, 204, 0, 0.3);
}

.mainNav a:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.topSearch {
  margin-left: auto;
  width: 350px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d192d;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  position: relative;
}

.topSearch input {
  background: transparent;
  border: 0;
  outline: 0;
  color: white;
  width: 100%;
  font-size: 14px;
}

.topSearch input::placeholder {
  color: #64748b;
}

.search-icon-btn {
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
}

.navActions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.langBtn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  height: 42px;
  transition: all 0.3s ease;
}

.langBtn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.navActions button.loginBtn {
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: white;
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.navActions button.loginBtn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cartBtn {
  background: var(--accent) !important;
  color: #000000 !important;
  border: 0 !important;
  height: 42px;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-badge {
  background: white !important;
  color: black !important;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-weight: 700;
}

/* ================= HERO BANNER ================= */

.hero {
  padding: 30px 0;
}

.hero-banner-section {
  width: 100%;
}

.hero-banner-card {
  position: relative;
  min-height: 400px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 60px;
  background: linear-gradient(90deg, rgba(5, 11, 20, 0.95) 0%, rgba(5, 11, 20, 0.7) 50%, rgba(5, 11, 20, 0.2) 100%),
              url('/assets/hero-gaming-banner.jpg') center right/cover no-repeat;
  box-shadow: 0 20px 55px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  max-width: 600px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-cta-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.shop-now-btn, .browse-cat-btn {
  border: 0;
  border-radius: 8px;
  padding: 14px 28px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.2s, background 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-now-btn {
  background: var(--accent);
  color: #000000;
}

.browse-cat-btn {
  background: rgba(255, 255, 255, 0.03);
  color: white;
  border: 1px solid var(--line);
}

.shop-now-btn:hover, .browse-cat-btn:hover {
  transform: translateY(-2px);
}

.hero-features {
  display: flex;
  gap: 30px;
}

.feature-item {
  color: #cbd5e1;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-game-logos {
  position: absolute;
  bottom: 30px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 25px;
  opacity: 0.5;
}

.game-logo-item {
  font-size: 15px;
  font-weight: 800;
  color: white;
  letter-spacing: 1px;
}

/* ================= SECTIONS & FILTERS ================= */

.section {
  padding: 30px 0;
}

.sectionHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.sectionHead h2 {
  font-size: 24px;
  font-weight: 700;
}

.view-all-btn {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filters {
  display: flex;
  gap: 12px;
}

.filters input,
.filters select,
.coupon input,
.checkoutForm input,
.chatInput input {
  background: #0d192d;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
}

.filters input {
  width: 260px;
}

/* ================= PRODUCTS (ENGINEERED FOR MOBILE) ================= */

.productGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.productCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.productCard:hover {
  transform: translateY(-6px);
  border-color: var(--line2);
  box-shadow: 0 10px 25px rgba(101, 204, 0, 0.15);
}

.productCover {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background-image: none !important;
}

.productCover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.productCard:hover .productCover img {
  transform: scale(1.04);
}

.productInfo {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.productInfo h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 42px;
}

.productInfo p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.priceRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 6px;
}

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

.rating {
  color: #ffd54a;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.add {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.add:hover {
  background: var(--accent);
  color: black;
  border-color: var(--accent);
}

/* ================= CATEGORIES ================= */

.trendGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.trendCard {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.3s;
}

.trendCard img {
  transition: transform 0.3s ease;
}

.trendCard:hover img {
  transform: scale(1.05);
}

.trendCard:hover {
  border-color: var(--line2);
  transform: translateY(-2px);
}

.trendCard:before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 20, 0.1), rgba(5, 11, 20, 0.95));
  z-index: 1;
}

.trendCard div {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
}

.trendCard h3 {
  font-size: 15px;
  font-weight: 700;
}

.trendCard p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ================= BENEFITS ================= */

.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.benefits > div {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.benefit-icon {
  font-size: 24px;
  margin-top: 3px;
}

.benefits b {
  display: block;
  color: white;
  font-size: 15px;
  margin-bottom: 4px;
}

.benefits span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ================= CHECKOUT / SUPPORT ================= */

.checkoutShowcase,
.supportBox {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.checkoutShowcase h2,
.supportBox h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.checkoutShowcase p,
.supportBox p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.paymentMethods {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

.method-card {
  background: rgba(255, 255, 255, 0.03); 
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 155px;
  height: 52px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.method-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(101, 204, 0, 0.2);
}

.method-card span {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.method-card i {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.supportActions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.supportActions .whatsapp-support-btn,
.supportActions button {
  border: 0;
  border-radius: 8px;
  padding: 13px 24px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.supportActions .whatsapp-support-btn {
  background: #22c55e;
  color: #000;
}

.supportActions button {
  background: #0d192d;
  color: white;
  border: 1px solid var(--line);
}

.supportActions .whatsapp-support-btn:hover,
.supportActions button:hover {
  transform: translateY(-2px);
}

/* ================= CART DRAWER ================= */

.cartDrawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #080f1a;
  border-left: 1px solid var(--line);
  z-index: 2200;
  padding: 24px;
  overflow: auto;
  transition: right 0.3s ease, left 0.3s ease;
}

.cartDrawer.open {
  right: 0;
}

.cartHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cartHead h3 {
  font-size: 20px;
  font-weight: 700;
}

.cartHead button {
  background: transparent;
  border: 0;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.cartItem {
  border: 1px solid var(--line);
  background: #0d1722;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.coupon {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.coupon button {
  background: var(--accent);
  color: black;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.summary p {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin: 12px 0;
  font-size: 15px;
}

.summary .grand {
  color: white;
  font-size: 22px;
  font-weight: 800;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.checkoutForm {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.full {
  width: 100%;
}

.primary.full.pay-now-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--accent) !important;
  color: #000000 !important;
  border: 0;
  padding: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.primary.full.pay-now-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.payment-logos {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 8px;
  border-radius: 4px;
}

.pay-logo {
  height: 14px;
  object-fit: contain;
  display: block;
}

.whatsapp.full {
  background: #22c55e;
  color: black;
  border: 0;
  padding: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

/* ================= CHAT ================= */

.chat {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 340px;
  max-width: 92vw;
  background: #0d1722;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  z-index: 1800;
  display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.chat.open {
  display: block;
}

.chatTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #08101e;
  padding: 16px;
  font-weight: 700;
}

.chatTop button {
  background: transparent;
  border: 0;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.chatBody {
  padding: 20px;
  min-height: 200px;
}

.chatInput {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.chatInput button {
  background: var(--accent);
  color: black;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.chatBubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: black;
  font-size: 22px;
  cursor: pointer;
  z-index: 1700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(101, 204, 0, 0.3);
}

/* ================= FOOTER ================= */

footer {
  padding: 40px 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer b {
  color: white;
}

.reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* ================= دعم الاتجاه العربي (RTL Support) ================= */
html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .mainNav {
  margin-left: 0;
  margin-right: 40px;
}

html[dir="rtl"] .topSearch {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .cartDrawer {
  right: auto;
  left: -440px;
  border-left: none;
  border-right: 1px solid var(--line);
}

html[dir="rtl"] .cartDrawer.open {
  left: 0;
  right: auto;
}

html[dir="rtl"] .chat, 
html[dir="rtl"] .chatBubble {
  right: auto;
  left: 24px;
}

/* ================= RESPONSIVE ================= */

@media(max-width:1280px) {
  .content { padding: 0 24px; }
  .topbar { padding: 0 24px; gap: 16px; }
  .mainNav { margin-left: 20px; gap: 8px; }
  html[dir="rtl"] .mainNav { margin-right: 20px; }
  .productGrid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .trendGrid { grid-template-columns: repeat(3, 1fr); }
}

@media(max-width:1024px) {
  .mainNav { display: none !important; }
  .topSearch { width: 280px; }
  .productGrid { grid-template-columns: repeat(3, 1fr); }
  .benefits { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* التعديل الجذري للهواتف (أقل من 768px) */
@media(max-width:768px) {
  body {
    padding-bottom: 70px !important; /* مساحة للـ Bottom Navigation */
  }

  .content { padding: 0 14px; }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .brand { font-size: 20px; }
  
  .topSearch {
    order: 3;
    width: 100% !important;
    margin: 4px 0 0 0 !important;
  }

  .navActions {
    margin-left: auto;
    gap: 8px;
  }
  html[dir="rtl"] .navActions {
    margin-left: 0;
    margin-right: auto;
  }

  .langBtn, .navActions button.loginBtn, .cartBtn {
    padding: 0 12px !important;
    font-size: 13px !important;
    height: 38px !important;
  }

  .hero-banner-card {
    padding: 30px 20px;
    min-height: 280px;
    background: linear-gradient(180deg, rgba(5, 11, 20, 0.95) 0%, rgba(5, 11, 20, 0.75) 100%),
                url('/assets/hero-gaming-banner.jpg') center center/cover no-repeat;
  }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 13px; margin-bottom: 20px; }
  .hero-cta-buttons { flex-direction: column; gap: 10px; width: 100%; margin-bottom: 0; }
  .shop-now-btn, .browse-cat-btn { width: 100%; justify-content: center; padding: 12px; }
  .banner-game-logos, .hero-features { display: none; }

  /* هندسة كروت المنتجات لتناسب الجوال تماماً */
  .productGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .productCard {
    border-radius: 12px;
  }
  .productCover {
    aspect-ratio: 1 / 1; /* جعل الصورة مربعة لتوفير مساحة عمودية مريحة للعرض */
  }
  .productInfo {
    padding: 10px !important;
  }
  .productInfo h3 {
    font-size: 13px !important;
    min-height: 36px !important;
  }
  .productInfo p {
    font-size: 11px !important;
  }
  .priceRow {
    margin: 8px 0 6px !important;
  }
  .price {
    font-size: 14px !important;
  }
  .rating {
    font-size: 11px !important;
  }
  .add {
    padding: 8px !important;
    font-size: 12px !important;
  }

  .trendGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .trendCard {
    aspect-ratio: 1 / 1;
  }

  .benefits { grid-template-columns: 1fr; gap: 16px; }

  .sectionHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .filters { width: 100%; flex-direction: column; gap: 8px; }
  .filters input, .filters select { width: 100%; }

  .checkoutShowcase, .supportBox {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }
  .paymentMethods { grid-template-columns: repeat(2, 1fr); display: grid; width: 100%; }
  .method-card { width: 100%; }
  
  .supportActions { width: 100%; flex-direction: column; }
  .supportActions button, .supportActions .whatsapp-support-btn { width: 100%; justify-content: center; }

  .cartDrawer { width: 100% !important; max-width: 100vw !important; }

  footer { flex-direction: column; gap: 12px; text-align: center; padding: 24px 16px; }
}

@media(max-width:360px) {
  .productGrid { grid-template-columns: 1fr !important; }
}
