/*
Theme Name: Q8Store
Theme URI: https://q8outdoor.com
Author: Q8Store
Description: Lightweight app-like WooCommerce theme (Arabic/English).
Version: 1.0.0
Text Domain: q8store
*/

/* ========================= */
/* (1) متغيرات عامة للألوان والحواف */
/* ========================= */
:root{
  --q8-radius: 18px;                 /* تدوير الزوايا العام */
  --q8-bg: #f7f8fa;                  /* لون خلفية الموقع */
  --q8-card: #ffffff;                /* لون الكروت */
  --q8-border: rgba(0,0,0,.06);      /* لون حدود خفيفة */
  --q8-primary: #2b6cb0;             /* لون رئيسي (أزرق) */
}

/* ========================= */
/* (2) إعدادات عامة للجسم والخط */
/* ========================= */
body{
  margin: 0;                         /* إزالة الهوامش الافتراضية */
  background: var(--q8-bg);          /* خلفية الموقع */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; /* خط مناسب */
}

/* ========================= */
/* (3) حاوية المحتوى (Padding للموقع) */
/* ========================= */
.q8-container{
  padding: 16px;                     /* مسافة داخلية مثل التطبيق */
}

/* ========================= */
/* (4) الهيدر (App Header) ثابت بالأعلى */
/* ========================= */
.q8-app-header{
  position: fixed;                   /* ثابت أعلى الشاشة */
  top: 0; left: 0; right: 0;
  height: 64px;                      /* ارتفاع الهيدر */
  background: #fff;                  /* خلفية الهيدر */
  display: grid;                     /* تقسيم الهيدر 3 أعمدة */
  grid-template-columns: 1fr auto 1fr; /* يسار - وسط - يمين */
  align-items: center;
  padding: 0 14px;                   /* مسافة داخلية يمين/يسار */
  border-bottom: 1px solid var(--q8-border); /* خط خفيف تحت الهيدر */
  z-index: 9999;                     /* فوق كل شيء */
}

/* مكان الأيقونات يسار/يمين */
.q8-app-left,
.q8-app-right{
  display: flex;
  gap: 12px;                         /* مسافة بين الأيقونات */
  align-items: center;
}

/* محاذاة الأيقونات جهة اليمين */
.q8-app-right{
  justify-content: flex-end;
}

/* أيقونة بشكل زر (سلة، حساب، منيو) */
.q8-icon{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f5f7;
  border: 1px solid var(--q8-border);
  text-decoration: none;
  cursor: pointer;
  position: relative;               /* علشان Badge السلة */
}

/* مسافة تحت الهيدر علشان المحتوى ما يصعد تحته */
.q8-app-spacer{
  height: 64px;
}

/* ========================= */
/* (5) شعار/اسم البراند في منتصف الهيدر */
/* ========================= */
.q8-brand{
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* الشعار كصورة (custom-logo من ووردبريس) */
.q8-brand .custom-logo{
  height: 32px;
  width: auto;
  display: block;
}

/* بديل إذا ما في شعار: نص */
.q8-brand-text{
  font-weight: 900;
  color: #111;
}

/* ========================= */
/* (6) Badge رقم السلة */
/* ========================= */
.q8-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;              /* أحمر */
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
}

/* ========================= */
/* (7) القائمة الجانبية (Drawer) */
/* ========================= */
.q8-drawer{
  position: fixed;
  inset: 0;                         /* تغطي الشاشة */
  pointer-events: none;             /* مغلقة افتراضيًا */
  z-index: 99999;
}

.q8-drawer-inner{
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: min(86vw, 360px);
  background: #fff;
  transform: translateX(100%);      /* مخفية */
  transition: transform .25s ease;
  box-shadow: -12px 0 30px rgba(0,0,0,.12);
  border-left: 1px solid var(--q8-border);
}

.q8-drawer-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .25s ease;
}

/* عند فتح المنيو (كلاس ينضاف على body) */
body.q8-menu-open .q8-drawer{ pointer-events: auto; }
body.q8-menu-open .q8-drawer-inner{ transform: translateX(0); }
body.q8-menu-open .q8-drawer-backdrop{ opacity: 1; }

.q8-drawer-head{
  padding: 12px;
  display: flex;
  justify-content: flex-start;
}

.q8-close{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f3f5f7;
  border: 1px solid var(--q8-border);
  cursor: pointer;
}

.q8-menu{
  list-style: none;
  padding: 6px 14px 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q8-menu a{
  display: block;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: #111;
  background: #f7f8fa;
  border: 1px solid var(--q8-border);
}

/* ========================= */
/* (8) الصفحة الرئيسية (Hero + عناوين) */
/* ========================= */
.q8-hero{
  background: linear-gradient(135deg,#2b6cb0,#63b3ed); /* خلفية */
  color: #fff;
  padding: 32px 20px;
  border-radius: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.q8-hero h1{ margin: 0 0 8px; font-size: 22px; }
.q8-hero p{ margin: 0 0 16px; opacity: .95; }

.q8-btn{
  display: inline-block;
  background: #fff;
  color: #111;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 700;
  text-decoration: none;
}

.q8-section{ margin-bottom: 28px; }
.q8-title{ margin-bottom: 14px; font-size: 18px; }

/* ========================= */
/* (9) الأقسام: كروت صغيرة مثل التطبيق (أيقونة + عنوان) */
/* ========================= */
.q8-categories{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr)); /* 4 كروت */
  gap: 14px;
}

.q8-cat{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background: var(--q8-card);
  border: 1px solid var(--q8-border);
  border-radius: 18px;
  padding: 14px 10px;
  min-height: 96px;

  text-decoration: none;
  color: #111;
}

.q8-cat-icon{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f3f5f7;
  border: 1px solid var(--q8-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.q8-cat-title{
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  line-height: 1.2;
}

@media (max-width: 700px){
  .q8-categories{
    grid-template-columns: repeat(2, minmax(0,1fr)); /* موبايل: 2×2 */
    gap: 12px;
  }
  .q8-cat{ min-height: 104px; }
  .q8-cat-title{ font-size: 14px; }
}

/* ========================= */
/* (10) ✅ سلايدر المنتجات الحقيقي بالسحب + مسافات */
/* ========================= */
.q8-home .q8-slider{
  display: flex !important;              /* صف أفقي */
  flex-wrap: nowrap !important;          /* لا ينزل تحت */
  overflow-x: auto !important;           /* سحب يمين/يسار */
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-snap-type: x mandatory !important;

  gap: 24px !important;                  /* ✅ المسافة بين المنتجات */
  padding: 0 10px 14px !important;
}

.q8-home .q8-slider::-webkit-scrollbar{ display:none; }

/* كل عنصر داخل السلايدر */
.q8-home .q8-slide{
  flex: 0 0 78% !important;              /* حجم الكرت بالموبايل */
  max-width: 78% !important;
  scroll-snap-align: start !important;
}

/* الكرت الأبيض (يشمل الصورة + العنوان + السعر + زر السلة) */
.q8-home .q8-product-card{
  background: #fff !important;
  border: 1px solid var(--q8-border) !important;
  border-radius: 22px !important;
  padding: 16px !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* رابط المنتج (الصورة + العنوان) */
.q8-home .q8-product-card > a{
  text-decoration: none !important;
  color: #111 !important;
  display: block !important;
}

/* صورة المنتج */
.q8-home .q8-product-card img{
  width: 100% !important;
  height: auto !important;
  border-radius: 18px !important;
  display: block !important;
}

/* عنوان المنتج */
.q8-home .q8-product-card h3{
  font-size: 15px;
  margin: 0;
}

/* السعر */
.q8-home .q8-price{
  font-weight: 800;
  color: var(--q8-primary);
}

/* زر أضف للسلة داخل الكرت */
.q8-home .q8-card-actions{
  margin-top: 6px !important;
}

/* الزر نفسه */
.q8-home .q8-card-actions .add_to_cart_button,
.q8-home .q8-card-actions a.button{
  display: block !important;
  width: 100% !important;
  padding: 12px 14px !important;
  border-radius: 16px !important;
  background: var(--q8-primary) !important;
  color: #fff !important;
  border: 0 !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;           /* ✅ يشيل المربع الرمادي */
}

/* إذا ووكومرس يلف الزر داخل add_to_cart_inline ويسبب إطار */
.q8-home .q8-card-actions .add_to_cart_inline,
.q8-home .q8-card-actions .add_to_cart_inline *{
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* شاشات كبيرة: نخلي الكرت ثابت */
@media (min-width: 900px){
  .q8-home .q8-slide{
    flex: 0 0 340px !important;
    max-width: 340px !important;
  }
}

/* ========================= */
/* (11) الفوتر */
/* ========================= */
.q8-footer{
  padding: 20px;
  text-align: center;
  color: #666;
}