:root{
  --bg:#0b1220;
  --text:#e8eefc;
  --muted:#9bb0d3;
  --accent:#4da3ff;
  --ok:#22c55e;

  --radius:18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --max:1200px;

  /* مقاسات ثابتة */
  --thumb-h: 380px;     /* ارتفاع صورة الكارت (ديسكتوب) */
  --content-min: 92px;  /* أقل ارتفاع لمنطقة النص */
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;overflow-x:hidden}

body{
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(77,163,255,.25), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(34,197,94,.18), transparent 60%),
    var(--bg);
  color:var(--text);
}

/* ================= HEADER ================= */
.hdgs-header{
  max-width:var(--max);
  margin:auto;
  padding:28px 16px 10px;
}

.hdgs-top{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
}

.hdgs-brand{display:flex; flex-direction:row; align-items:center; gap:6px; flex-shrink:0;}

.hdgs-logo{ margin-bottom: 0px; }
.hdgs-logo img{ max-height:48px; width:auto; display:block; }

.hdgs-h1{margin:0;font-size:22px}
.hdgs-sub{margin:0;color:var(--muted);font-size:14px;line-height:1.5}

.hdgs-search{
  display:flex;
  gap:10px;
  align-items:center;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:10px 12px;
  min-width:220px;
}

.hdgs-search-input{
  width:100%;
  background:transparent;
  border:0;
  outline:none;
  color:var(--text);
  font-size:14px;
}

/* Filters + info buttons row */
.hdgs-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
}

.hdgs-filter{
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  outline: none;
  min-width: 190px;
}
.hdgs-filter option{ color:#000; }

/* ✅ Info buttons (Offline/Online) */
.hdgs-infoBtn{
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.hdgs-infoBtn:hover{
  transform: translateY(-1px);
  border-color: rgba(77,163,255,.35);
  background: rgba(255,255,255,.09);
}

/* ================= MAIN ================= */
.hdgs-main{
  max-width:var(--max);
  margin: 8px auto 40px;
  padding: 0 16px;
}

/* ================= GRID ================= */
.hdgs-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:18px;
  margin-top:18px;
  align-items:stretch;
}

/* ================= CARD ================= */
.hdgs-card{
  width:100%;
  display:flex;
  flex-direction:column;
  position:relative;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: transform .18s ease, border-color .18s ease;
}

.hdgs-card:hover{
  transform: translateY(-4px);
  border-color: rgba(77,163,255,.35);
}

/* الصورة ثابتة */
.hdgs-thumb{
  width:100%;
  height: var(--thumb-h);
  object-fit:cover; /* ✅ نفس الكمبيوتر */
  display:block;
  background:#0a1020;
}

/* المحتوى */
.hdgs-content{
  padding:12px 12px 14px;
  min-height: var(--content-min);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.hdgs-name{
  font-weight:800;
  font-size:14.5px;
  margin:0 0 6px;
  line-height:1.3;

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height: 38px;
}

.hdgs-meta{
  color:var(--muted);
  font-size:12.5px;
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin:0;
}

/* ================= OVERLAY ================= */
.hdgs-overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.78));
  opacity:0;
  transition: opacity .18s ease;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:12px;
  gap:10px;
}

.hdgs-card:hover .hdgs-overlay,
.hdgs-card.hdgs-open .hdgs-overlay{
  opacity:1;
}

.hdgs-priceTag{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:14px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
}

.hdgs-label{color:rgba(255,255,255,.80);font-size:12px}
.hdgs-price{font-size:16px;font-weight:900}

.hdgs-actions{display:flex;gap:10px}

.hdgs-btn{
  width:100%;
  border:0;
  padding:10px 12px;
  border-radius:14px;
  font-weight:900;
  font-size:13.5px;
  text-decoration:none !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.hdgs-buy{background: var(--ok); color:#04210f !important;}
.hdgs-download{background: var(--accent); color:#07192e !important;}

/* Disabled download button */
.hdgs-disabled{
  opacity:.45;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: none;
}

/* ================= Badges ================= */
.hdgs-badges{
  position:absolute;
  top:12px;
  left:12px;
  display:flex;
  gap:8px;
  z-index:2;
}

.hdgs-badge{
  padding:7px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  background: rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  line-height:1;
}

.hdgs-badge--online{
  background: rgba(34,197,94,.22);
  border-color: rgba(34,197,94,.35);
}

.hdgs-badge--offline{
  background: rgba(77,163,255,.22);
  border-color: rgba(77,163,255,.35);
}

/* ================= Empty + Footer ================= */
.hdgs-empty{
  color: rgba(255,255,255,.75);
  padding: 18px;
  border:1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
}

/* footer styles below */

/* ================= Floating WhatsApp ================= */
.hdgs-wa-float{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(34,197,94,.95);
  color: #05210f;
  text-decoration: none !important;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

/* ================= MODAL (Popup) ================= */
.hdgs-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
}
.hdgs-modal.is-open{ display:block; }

.hdgs-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(2px);
}

.hdgs-modal__panel{
  position: relative;
  max-width: 560px;
  width: calc(100% - 24px);
  margin: 10vh auto;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  overflow: hidden;
}

.hdgs-modal__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.hdgs-modal__title{
  font-weight: 900;
  font-size: 15px;
}

.hdgs-modal__close{
  background: transparent;
  border: 0;
  color:#fff;
  font-size: 18px;
  cursor:pointer;
  padding: 6px 10px;
  border-radius: 10px;
}
.hdgs-modal__close:hover{ background: rgba(255,255,255,.08); }

.hdgs-modal__body{
  padding: 14px;
  color: rgba(255,255,255,.92);
  line-height: 1.9;
}
.hdgs-modal__body a{ color: var(--accent); text-decoration: underline; }
.hdgs-modal__body ul{ margin:10px 0 0; padding: 0 18px; }

/* منع الاسكرول ورا المودال */
html.hdgs-modal-open, html.hdgs-modal-open body{
  overflow: hidden;
}

/* ================= Responsive ================= */
@media (max-width:1100px){
  .hdgs-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width:820px){
  .hdgs-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }

  .hdgs-search{ min-width:100%; }

  .hdgs-filter{ flex:1; min-width:0; }

  .hdgs-infoBtn{ flex:1; }

  /* ✅ موبايل: نفس شكل الكمبيوتر (cover) ومفيش تعارض */
  :root{ --thumb-h: 340px; } /* أقل شوية للموبايل */
  .hdgs-thumb{ height: var(--thumb-h); object-fit: cover; }

  .hdgs-modal__panel{ margin: 12vh auto; }
}

@media (max-width:480px){
  .hdgs-grid{ grid-template-columns: 1fr; }
  .hdgs-actions{ flex-direction: column; }

  :root{ --thumb-h: 360px; }
}
/* ===== Mobile: show FULL poster (no crop) ===== */
@media (max-width: 820px){

  /* الغي أي ارتفاع ثابت للصورة على الموبايل */
  :root{
    --thumb-h: auto;
  }

  /* اجبر الكارت ما يحاولش يثبت ارتفاع للصورة */
  .hdgs-thumb{
    height: auto !important;
    width: 100%;
    display: block;

    /* ✅ ده اللي يخليها كاملة بدون قص */
    object-fit: contain !important;

    /* نسبة بوستر ثابتة عشان شكل الكروت يبقى مظبوط */
    aspect-ratio: 3 / 4;

    /* الخلفية لو الصورة مش مليانة الإطار بالكامل */
    background: #0a1020;
  }
}
/* ===== Mobile: remove big gap above first card ===== */
@media (max-width: 820px){

  /* المسافة بين الهيدر والمحتوى */
  .hdgs-main{
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* المسافة فوق أول صف كروت */
  .hdgs-grid{
    margin-top: 8px !important;   /* خليها 0 لو عايزاها لازقة تماما */
  }

  /* لو فيه مسافة زيادة من جزء الفلاتر */
  .hdgs-filters-wrap{
    margin-bottom: 8px !important; /* خليها 0 لو لسه فيه فراغ */
  }
}
@media (max-width: 820px){
  .hdgs-social-inline{ display:none !important; }
}
@media (max-width: 820px){
  .hdgs-social-inline{ display:none !important; }
}


/* ===== Social Icons ===== */
.hdgs-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hdgs-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hdgs-social__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  text-decoration: none;
  opacity: 0.85;
}

.hdgs-social__link svg {
  width: 18px;
  height: 18px;
}

.hdgs-social__link:hover {
  transform: translateY(-2px);
  opacity: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.hdgs-social__link--fb { background: #1877F2; }
.hdgs-social__link--wa { background: #25D366; }
.hdgs-social__link--tg { background: #229ED9; }
.hdgs-social__link--dc { background: #5865F2; }

@media (max-width: 600px) {
  .hdgs-top-right { flex-wrap: wrap; justify-content: flex-end; }
  .hdgs-social__link { width: 34px; height: 34px; }
  .hdgs-social__link svg { width: 16px; height: 16px; }
}

/* Inactive social icon (no URL set yet) */
.hdgs-social__link--inactive {
  opacity: 0.35;
  cursor: default;
  filter: grayscale(0.5);
}
.hdgs-social__link--inactive:hover {
  transform: none;
  box-shadow: none;
  opacity: 0.35;
}

/* ===== Mobile Header Fix ===== */
@media (max-width: 820px) {

  /* الهيدر يبقى عمودي - اللوجو فوق، السيرش والأيقونات تحت */
  .hdgs-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    flex-wrap: nowrap;
  }

  /* اللوجو في المنتصف */
  .hdgs-brand {
    justify-content: center;
    text-align: center;
  }

  /* السيرش والأيقونات في صف واحد */
  .hdgs-top-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    flex-shrink: unset;
  }

  /* السيرش ياخد باقي المساحة */
  .hdgs-search {
    flex: 1;
    min-width: 0 !important;
  }

  /* الأيقونات أصغر شوية */
  .hdgs-social {
    gap: 6px;
    flex-shrink: 0;
  }

  .hdgs-social__link {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .hdgs-social__link svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .hdgs-social__link {
    width: 30px;
    height: 30px;
  }
  .hdgs-social__link svg {
    width: 14px;
    height: 14px;
  }
}

/* ===== Coming Soon Badge ===== */
.hdgs-soon-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 3px 14px rgba(139, 92, 246, 0.65);
  z-index: 10;
  letter-spacing: 0.5px;
  animation: hdgs-soon-pulse 2s ease-in-out infinite;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}

@keyframes hdgs-soon-pulse {
  0%, 100% { box-shadow: 0 3px 14px rgba(139, 92, 246, 0.65); transform: scale(1); }
  50%       { box-shadow: 0 4px 24px rgba(139, 92, 246, 0.95); transform: scale(1.04); }
}

/* ===== Footer ===== */
.hdgs-footer {
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  padding: 28px 24px;
  width: 100%;
  box-sizing: border-box;
}

.hdgs-footer__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* اللوجو */
.hdgs-footer__brand img { max-height: 36px; width: auto; display: block; }
.hdgs-footer__name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

/* رقم الواتساب */
.hdgs-footer__wa {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #25D366;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.hdgs-footer__wa:hover { opacity: 0.8; }
.hdgs-footer__wa svg { width: 17px; height: 17px; flex-shrink: 0; }

/* الأيقونات */
.hdgs-footer__social { display: flex; align-items: center; gap: 8px; }

.hdgs-footer__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
}
.hdgs-footer__icon svg { width: 15px; height: 15px; }
.hdgs-footer__icon:hover { opacity: 1; transform: translateY(-2px); }
.hdgs-footer__icon--fb { background: #1877F2; }
.hdgs-footer__icon--wa { background: #25D366; }
.hdgs-footer__icon--tg { background: #229ED9; }
.hdgs-footer__icon--dc { background: #5865F2; }

/* حقوق الملكية */
.hdgs-footer__copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* موبايل */
@media (max-width: 600px) {
  .hdgs-footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* ===== New Badge ===== */
.hdgs-new-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 3px 14px rgba(34, 197, 94, 0.6);
  z-index: 10;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.25);
  animation: hdgs-new-shine 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hdgs-new-shine {
  0%, 100% { box-shadow: 0 3px 14px rgba(34,197,94,0.6); }
  50%       { box-shadow: 0 4px 26px rgba(34,197,94,1); }
}

/* ===== Animated Background Particles ===== */
.hdgs-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hdgs-particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0;
  animation: hdgs-float linear infinite;
}

@keyframes hdgs-float {
  0%   { transform: translateY(110vh) scale(0.4); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-10vh) scale(1.1); opacity: 0; }
}

/* عشان الكروت تبقى فوق الـ particles */
.hdgs-header, .hdgs-main, .hdgs-footer {
  position: relative;
  z-index: 1;
}
