/* ==========================================================================
   gs-desktop.css — تحسينات الوضع الحاسوبي (لا تؤثر على الهاتف إطلاقاً)
   كل القواعد داخل @media (min-width:...) فقط.
   1) الإعلانات المبوبة: 8 إعلانات في الصف
   2) إعلاناتي: شبكة بدل عمود هاتف
   3) لوحتا الأدمن والبائع: شريط جانبي بتمرير ظاهر + تذييل مضغوط
   4) النوافذ المنبثقة: أعرض على الحاسوب
   5) صفحة الحساب: عمودان
   ========================================================================== */

/* ---------- 1) الإعلانات المبوبة /listings ---------- */
@media (min-width:640px){
  html .gs-ads-grid.grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:768px){
  html .gs-ads-grid.grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (min-width:1024px){
  html .gs-ads-grid.grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
  html.gs-ads main.gs-ads-main{max-width:min(1600px,96vw)}
}
@media (min-width:1100px){
  html .gs-ads-grid.grid{grid-template-columns:repeat(8,minmax(0,1fr));gap:12px}
}
@media (min-width:1024px){
  /* بطاقة أصغر وأنيقة عند 8 في الصف */
  html .gs-ads-grid > button{border-radius:16px !important}
  html .gs-ads-grid > button h3{font-size:12.5px;line-height:1.35}
  html .gs-ads-grid > button p.text-primary{font-size:12.5px}
  html .gs-ads-grid > button > div.p-2\.5{padding:8px 9px 10px}
}

/* ---------- 2) إعلاناتي /listings/my ---------- */
@media (min-width:1024px){
  html main.gs-my-main{
    max-width:min(1200px,94vw);
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;
  }
  html main.gs-my-main > *{margin:0 !important}
  html main.gs-my-main > .text-center{grid-column:1/-1}
}
@media (min-width:1500px){
  html main.gs-my-main{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ---------- 3) لوحتا التحكم: الشريط الجانبي ---------- */
@media (min-width:1024px){
  /* الشريط ثابت بطول الشاشة، والقائمة داخله تُمرَّر مع شريط ظاهر */
  html.gs-admin aside.lg\:sticky{
    position:sticky;top:0;height:100vh;height:100dvh;align-self:flex-start;
    overflow:visible;           /* لا نقصّ زر طيّ الشريط الذي يبرز خارج حافته */
  }

  /* زر طيّ الشريط (›): كامل الظهور، بخلفية بنفسجية متدرجة بدل الأبيض */
  html.gs-admin aside > button.absolute{
    width:32px;height:32px;top:54px;
    inset-inline-end:-16px;
    z-index:50;
    color:#fff;border:2px solid rgba(255,255,255,.9);
    background:linear-gradient(135deg,#7c3aed,#a855f7 60%,#ec4899);
    box-shadow:0 8px 18px -4px rgba(124,58,237,.55),0 0 0 1px rgba(124,58,237,.25);
    cursor:pointer;
  }
  html.gs-admin aside > button.absolute:hover{filter:brightness(1.1);transform:scale(1.08)}
  html.gs-admin aside > button.absolute:focus-visible{outline:3px solid #c4b5fd;outline-offset:2px}
  html.gs-admin aside > button.absolute svg{width:18px;height:18px;color:#fff;stroke-width:2.6}
  html.gs-admin aside nav{
    min-height:0;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    scrollbar-width:thin !important;
    scrollbar-color:rgba(139,92,246,.55) transparent;
    -ms-overflow-style:auto !important;
    scroll-behavior:smooth;
  }
  html.gs-admin aside nav::-webkit-scrollbar{display:block !important;width:7px;height:7px}
  html.gs-admin aside nav::-webkit-scrollbar-track{background:transparent;margin:6px 0}
  html.gs-admin aside nav::-webkit-scrollbar-thumb{background:rgba(139,92,246,.45);border-radius:999px}
  html.gs-admin aside nav::-webkit-scrollbar-thumb:hover{background:rgba(139,92,246,.75)}

  /* تذييل الشريط (العودة للموقع / لوحة متجري / الحساب) مضغوط ليترك مساحة أكبر للقائمة */
  html.gs-admin aside > div:last-child{flex-shrink:0;padding-top:6px;padding-bottom:6px}
  html.gs-admin aside > div:last-child > button{padding-top:7px;padding-bottom:7px}
  html.gs-admin aside > div:last-child > div{padding-top:6px;padding-bottom:2px;margin-top:2px}

  /* عناصر القائمة أقرب لبعضها */
  html.gs-admin aside nav button{padding-top:8px;padding-bottom:8px}
  html.gs-admin aside nav > div{margin-bottom:2px}
}
@media (min-width:1024px) and (max-height:760px){
  html.gs-admin aside > div:first-child{padding-top:10px;padding-bottom:10px}
  html.gs-admin aside nav{padding-top:4px;padding-bottom:4px}
  html.gs-admin aside nav button{padding-top:6px;padding-bottom:6px;font-size:13px}
  html.gs-admin aside > div:last-child > button{padding-top:5px;padding-bottom:5px;font-size:13px}
  html.gs-admin aside > div:last-child p.text-\[10px\]{display:none}
}

/* ---------- 4) النوافذ المنبثقة (Dialog) ---------- */
@media (min-width:1024px){
  html [role="dialog"][class*="max-w-md"],
  html [role="dialog"][class*="max-w-lg"]{
    max-width:min(760px,92vw) !important;
  }
  html [role="dialog"][class*="max-h-["]{max-height:88vh !important}
  html [role="dialog"] .max-h-\[60vh\],
  html [role="dialog"] .max-h-\[65vh\],
  html [role="dialog"] .max-h-\[70vh\],
  html [role="dialog"] .max-h-\[80vh\]{max-height:72vh !important}
  /* حقول النماذج داخل النافذة تأخذ عمودين عندما تكون الشبكة موجودة */
  html [role="dialog"] .grid.grid-cols-2{gap:14px}
}

/* ---------- 5) صفحة الحساب /account ---------- */
@media (min-width:1024px){
  html .gs-a-stack{
    max-width:min(940px,92vw);
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch;
  }
  html .gs-a-stack > .gs-a-hd,
  html .gs-a-stack > .gs-a-hero,
  html .gs-a-stack > .gs-a-btn-out,
  html .gs-a-stack > button.gs-a-btn,
  html .gs-a-stack > :not(button):not(.gs-a-row2){grid-column:1/-1}
  html .gs-a-stack .gs-a-btn-out{margin-top:0}
}

/* ---------- 6) صفحة النطاقات (لوحة البائع) ---------- */
@media (min-width:1024px){
  html .gsd{max-width:760px}
}
