/* =================================================
   HOME PAGE ONLY (Scoped)
   file: assets/css/home.css
================================================= */

/* ✅ STOP MOBILE SHAKE / HORIZONTAL MOVE */
html, body{
  width: 100%;
  overflow-x: hidden !important;
}
section, header, footer{
  overflow-x: hidden;
}
img, video{
  max-width: 100%;
  height: auto;
}

/* ✅ لا تجعلها عامة حتى لا تخرب سلايدرات ثانية */
.heroSwiper{
  overflow: hidden;
}

/* =================================================
   Standards cards
================================================= */
.standards-cards-white{background:#fff;padding:80px 0}
.standards-cards-white .kicker{color:#1e7f4d;font-weight:700;font-size:.9rem}
.standards-cards-white h2{font-weight:900;margin:10px 0}
.standards-cards-white .muted{color:#6c757d}

.std-card{
  display:flex;
  gap:18px;
  background:#f2f2f2;
  border:2px solid #f2c200;
  border-radius:18px;
  padding:24px;
  transition:transform .25s ease, box-shadow .25s ease;
  height:100%;
}
.std-card:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 30px rgba(0,0,0,.08);
}

.std-icon{
  width:56px;height:56px;flex:0 0 56px;
  border-radius:50%;
  background:#fff4cc;
  color:#c89b00;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.35rem;
}

.std-tag{
  display:inline-block;
  font-size:.75rem;
  font-weight:800;
  padding:4px 14px;
  border-radius:20px;
  background:#e8f5ee;
  color:#1e7f4d;
}
.std-tag.protocol{background:#fff1df;color:#c76a00}

.std-body h5{margin:8px 0 6px;font-weight:800}
.std-body p{margin:0;color:#555;line-height:1.7;font-size:.95rem}

.std-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
  justify-content:center
}
@media (max-width: 992px){
  .std-grid{grid-template-columns:1fr}
}

/* =================================================
   VIDEO SHOWCASE
================================================= */
.video-showcase{
  padding:80px 0;
  background: linear-gradient(180deg,#ffffff 0%, #f7fbf9 60%, #ffffff 100%);
}

.video-card{
  background:#fff;
  border-radius:22px;
  overflow:hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.08);
  border:1px solid rgba(0,0,0,.06);
}

.video-cover{
  position:relative;
  width:100%;
  height:360px;
  background:#0b2f1f;
  overflow:hidden;
}

.video-cover video,
.video-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter:saturate(1.05) contrast(1.05);
}

.play-btn{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:84px;
  height:84px;
  border-radius:50%;
  border:none;
  background: rgba(255,255,255,.95);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: transform .2s ease;
}

.play-btn:hover{
  transform:translate(-50%,-50%) scale(1.05);
}

.play-btn i{
  font-size:2.1rem;
  color: var(--brand);
  margin-left:4px;
}

.video-info{
  padding:22px 24px;
}

.video-info h3{
  font-weight:900;
  margin:0 0 10px;
}

.video-info p{
  margin:0;
  color:#6c757d;
  line-height:1.8;
}

/* ✅ Responsive Video Modal */
#videoModal .modal-dialog{
  width: min(1200px, calc(100% - 16px));
  margin: 8px auto;
}
#videoModal .modal-content{
  border-radius: 18px;
  overflow: hidden;
  max-height: 92vh;
}
#videoModal .modal-body{
  padding: 0 !important;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 78vh;
}
#videoModal video{
  width: 100% !important;
  height: auto !important;
  max-height: 78vh !important;
  object-fit: contain !important;
  background: #000;
}
@media (max-width: 576px){
  #videoModal .modal-body{ max-height: 70vh; }
  #videoModal video{ max-height: 70vh !important; }
}

/* =================================================
   HERO SLIDER
================================================= */
/* =================================================
   HERO SLIDER - إصلاح التداخل والظهور الكامل
================================================= */
.hero-slider {
  padding: 18px 0 10px;
  background: transparent;
}

.heroSwiper {
  width: 100%;
  height: 420px;
  border-radius: 26px;
  overflow: hidden; /* الحاوية الأم فقط هي التي تقص */
  position: relative;
  direction: rtl;
  /* منع التداخل عبر عزل العناصر */
  isolation: isolate; 
}

.heroSwiper .swiper-wrapper {
  /* نترك swiper يتحكم بالعرض تلقائياً، مع التأكد من عدم وجود عوائق */
  display: flex !important;
  width: 100%;
  height: 100%;
}

.heroSwiper .swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
  flex-shrink: 0; /* يمنع انكماش الصورة أو تداخلها مع التالية */
  overflow: hidden;
  
  /* تحسينات الأداء ومنع الوميض */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

/* التأكد من أن الصورة تأخذ كامل المساحة ولا تظهر ما خلفها */
.heroSwiper .slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

.heroSwiper .slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    rgba(0,0,0,.72) 0%,
    rgba(0,0,0,.35) 45%,
    rgba(0,0,0,.10) 100%
  );
  z-index: 2;
}

.heroSwiper .slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 22px;
  z-index: 3; /* محتوى النص فوق كل شيء */
}

/* إصلاح الأسهم للتنقل الواضح */
.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev {
  color: #fff;
  z-index: 10;
}

/* ضمان بقاء الشريحة النشطة في المقدمة */
.heroSwiper .swiper-slide-active {
  z-index: 5;
}
.heroSwiper .slide-box {
  max-width: 610px;
  color: #fff;
  padding: 26px 22px 26px 40px;
  border-radius: 22px;
  margin-right: 35px;
  margin-left: 35px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}



/* عكس الأسهم فقط لتناسب الاتجاه العربي */
.heroSwiper .swiper-button-next::after,
.heroSwiper .swiper-button-prev::after {
  font-size: 24px;
}

.heroSwiper .swiper-button-prev {
  right: 10px;
  left: auto;
}

.heroSwiper .swiper-button-next {
  left: 10px;
  right: auto;
}

/* باقي كود الـ Pagination يبقى كما هو لديك */

.heroSwiper .slide-kicker{
  display:inline-flex;
  gap:10px;
  align-items:center;
  font-weight:900;
  font-size:.88rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(47,191,113,.14);
  color: var(--brand);
  border: 1px solid rgba(47,191,113,.22);
}

.heroSwiper .slide-box h2{
  font-weight: 900;
  margin: 14px 0 10px;
  font-size: 2.15rem;
  color: #9caaa4;
}

.heroSwiper .slide-box p{
  margin:0;
  color: #5c6a65;
  line-height: 1.95;
  font-size: 1.05rem;
}



/* ✅ opposite arrows RTL */
.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev{
  transform: scaleX(-1);
}

.heroSwiper .swiper-pagination{
  bottom: 14px !important;
}

.heroSwiper .swiper-pagination-bullet{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  opacity: 1;
  background: rgba(255,255,255,.55);
}

.heroSwiper .swiper-pagination-bullet-active{
  width: 34px;
  background: #fff;
}

@media (max-width: 992px){
  .heroSwiper{ height: 380px; }
  .heroSwiper .slide-box h2{ font-size: 1.65rem; }
}

@media (max-width: 576px){
  .heroSwiper{ height: 340px; }
  .heroSwiper .slide-content{ padding: 14px; }
  .heroSwiper .slide-box{
    max-width: 100%;
    padding: 18px 18px;
    margin: 0;
  }
}

/* =================================================
   ✅ PRODUCTS (MODERN UPGRADE)
   keeps same HTML - فقط CSS
================================================= */
#products .product-list-wrap{
  display:grid;
  gap:16px;
  margin-top: 18px;
}

#products .product-row{
  position:relative;
  display:flex;
  gap:18px;
  border-radius:22px;
  overflow:hidden;
  border:1px solid rgba(15,23,42,.08);
  background: linear-gradient(180deg,#ffffff 0%, #fbfbfb 100%);
  box-shadow:0 18px 55px rgba(2,6,23,.08);
  transition: transform .22s ease, box-shadow .22s ease;
}

#products .product-row:hover{
  transform: translateY(-5px);
  box-shadow:0 26px 85px rgba(2,6,23,.12);
}

/* image */
#products .product-row-img{
  width:240px;
  min-height:170px;
  background-size:cover;
  background-position:center;
  position:relative;
  flex-shrink:0;
}

/* ✅ overlay gradient on image */
#products .product-row-img:after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg,
    rgba(0,0,0,.35) 0%,
    rgba(0,0,0,.06) 70%,
    rgba(0,0,0,0) 100%
  );
}

#products .product-row-body{
  flex:1;
  padding:20px 20px 18px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

#products .product-row-title{
  font-weight:900;
  font-size:1.25rem;
  color:#0f172a;
}

#products .product-row-sub{
  color:#64748b;
  margin-top:6px;
  font-size:.95rem;
}

#products .product-row-rate{
  color:#f2c200;
  font-size:1.05rem;
  white-space:nowrap;
}

#products .product-row-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
  padding-top:14px;
  border-top:1px dashed rgba(15,23,42,.12);
}

#products .product-row-price{
  font-size:1.15rem;
  font-weight:900;
  color:var(--brand);
}

/* ✅ enhance request button */
#products .product-row-bottom .btn{
  border-radius:999px !important;
  padding:.62rem 1.1rem;
  box-shadow:0 14px 30px rgba(47,191,113,.20);
}

/* ✅ mobile version */
@media (max-width: 768px){
  #products .product-row{
    flex-direction:column;
  }
  #products .product-row-img{
    width:100%;
    height:220px;
  }
  #products .product-row-img:after{
    background: linear-gradient(180deg,
      rgba(0,0,0,.35) 0%,
      rgba(0,0,0,.06) 70%,
      rgba(0,0,0,0) 100%
    );
  }
}
