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

:root {
  --wheat-clr:#c64a4a;
  --light-blue-clr:#a3cef1;
  --dark-blue-clr:#05396b;
  --dark-clr:#000000;
  --light-clr:#f0f3bd;
  --primary-text:rgb(206, 213, 214);
  --secondary-text:var(--light-blue-clr);

  /* ارتفاع موحد لصور البطاقات (يمكن تغييره مرة واحدة ليؤثر في كل الأماكن) */
  --card-image-height: 220px;
}
 html{
  scroll-behavior:smooth;
  scroll-padding-top: 120px; /* This accounts for the fixed header */
 }
 body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color:var(--dark-clr);
  color:var(--primary-text);
  overflow-x: hidden;
  overflow-y: auto;
 }
 h1 h2 h3 h4 h5 h6 {
  text-transform: capitalize;
  margin: 0;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.5;
  color:var(--secondary-text);
 }
 
 ul {
  list-style: none;
 }
 a {
    text-decoration: none;
    color:inherit;
    text-transform: capitalize;
  }
  img {
    object-fit: cover;
    width: 100%;
  }
  .container{
    width: 100%;
    max-width:1200px;
    padding:0 20px;
    margin: 0 auto;
  }
  .section-container{
    padding: 80px 0;
  }  
  .nav-icons a{
    cursor: pointer;
    transition:0.5s;
  }
 .nav-icons:hover{
    color:var(--wheat-clr);
    transform:translateY(-2px);
    transition:0.2s;
  }

  .nav-icons:not(:hover){
    transition:0.2s;
  }

  .nav-icons a i{
    font-size:1.2rem;
  }
  /*top text*******************************/
  
/*header********************************/
header{
  margin-bottom: 20px;
}


.header-container{
    position: fixed;
    top:0;
    left:0;
    width: 100%;
    background-color:var(--dark-clr);
    z-index: 1000;
    transition: 0.5s;
}
.nav-bar{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position:relative;
    background: #8b1212;
    border-radius:12px;
}
.logo{
  display:grid;
  place-items:center;
  margin-right:10px;
}
.logo img{
  width:140px;
}
.mob-nav-menu{
  position:absolute;
width:100%;
height:auto;
background:inherit;
top: -150px;
left:0;
opacity:0;
visibility: hidden;
padding:20px 30px;
border-radius:0 0 12px 12px;
transition: 0.5s;

}
.nav-bar.active .mob-nav-menu{
  top:100px;
  opacity:1;
  visibility: visible;
}
.nav-bar.active {
  border-radius:12px 12px 0 0;
}
.nav-links:not(.mob-nav-menu .nav-links),
.nav-icons:not(.mob-nav-menu .nav-icons){
  display:none;
}
.nav-links a{
  display:block;
  position: relative;
  padding-block:10px;
  margin-block:10px;
  text-align:center;
flex-wrap:wrap;
}
.nav-links a::after{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:0px;
  height:2px;
  background:var(--wheat-clr);
  transition: 0.5s;
}
.nav-links a:hover::after,
.nav-links a.active-links::after
{
  width:100%;
}
.nav-icons{
  display:flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap:15px;
  margin-top:10px;
}
.nav-icons a{
  display:inline-block;
  padding:14px;
  border-radius:50%;
  margin-top: -25px;
}
.nav-icons a:hover{
  color: #de5207;
}
/*icons*/
.icons{
  display:inline-block;
  padding:8px 15px;
}
 .nav-icons button{
  padding-block:4px;
 }
 .nav-icons .log-in{
  background-color: #942d2d;
 }
 .nav-icons .log-in:hover{
  background-color: #de5207;
 }
.nav-icons .sign-up{
  background-color: #942d2d;
 }
 .nav-icons .sign-up:hover{
  background-color: #de5207;
 }
 .menu-toggle-btn{
background-color:transparent;
border:0;
outline:0;
color:inherit;
font-size:1.5rem;
cursor:pointer;
transition:0.5s;
 }
 .menu-toggle-btn:hover{
  color: #74e2ab;
 }
 @media (min-width:800px){
  .nav-links:not(.mob-nav-menu .nav-links),
  .nav-icons:not(.mob-nav-menu .nav-icons){
    display:flex;
  }
  .mob-nav-menu{
    display:none;
  }
  .nav-links a{
    margin:0;
    padding:6;
    margin-right:20px;
  }
  .menu-toggle-btn{
    display:none;
  }
 }

header .header-container {
  display: flex;
  flex-wrap: wrap;       /* يسمح للعنصر بالالتفاف على الشاشات الصغيرة */
  align-items: center;   /* محاذاة عمودية للـ logo والروابط */
  justify-content: space-between;
  padding: 15px 20px;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-icons {
  display: flex;
  gap: 15px;
}

/* Media Query للهواتف */
@media (max-width: 780px) {
  .header-container {
    flex-direction: column; /* اللوغو فوق الروابط */
    align-items: center;    /* وضعهم في المنتصف */
    text-align: center;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
  }

  .nav-icons {
    margin-top: 10px;
  }
}
@media (max-width: 780px) {
  #hero {
    padding: 30px 15px;
    min-height: 400px;
    display: flex;
    flex-direction: column; 
    align-items: center;    
    justify-content: center;
    text-align: center;
  }
                       /*==================Hero Section==================*/

  #hero h1 { font-size: 2rem; }
  #hero h1 span { font-size: 2.5rem; }
  #hero p { font-size: 1rem; }
  .shop-now-btn { width: 100%; text-align: center; }
}
 

#hero .container.hero-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;   
  justify-content: space-between; 
  position: relative;
  min-height: 400px; 
  padding: 0 20px;
}#hero {
  padding: 50px 20px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
  position: relative;
  margin-bottom: 30px;
}

/* القسم الأيسر (أو الأيمن حسب الترتيب في HTML) */
.hero-text {
  grid-column: 1;
  justify-self: start; /* خله يلزم اليسار */
}

/* القسم الآخر (الصورة) */
.hero-img {
  grid-column: 2;
  justify-self: start; /* خله يلزم اليمين */
}

/* الصورة نفسها */
.hero-img {
  
  width: 100%;
  max-width: 1050px;
  border-radius: 10px;
  animation: fadeUp 1s ease forwards;
  min-width: 600px;
  object-fit: cover;
  object-position: center;
}


/* ✅ جعلها Responsive */
@media (max-width: 768px) {
  #hero {
    grid-template-columns: 1fr; /* عمود واحد */
    text-align: center;
  }

  .hero-text {
    justify-self: center;
  }

  .hero-img {
    justify-self: center;
  }

  .hero-img {
    max-width: 300px; /* تصغير الصورة بالموبايل */
    
    
  }
}
 .hero-content{
  display:grid;
  place-items:center;
  gap:10px;

 }
  .hero-text h1{
    font-family: fantasy;
    font-size:clamp(2.5rem,5vw,3rem);
    margin-bottom:10px;
  }
  .hero-text h1 span{
    color:var(--wheat-clr);
    display:block;
     font-size:clamp(3.5rem,5vw,4rem);
  }
  .shop-now-btn{
    display:inline-block;
    padding:12px 30px;
    background-color:var(--wheat-clr);
    color:var(--dark-clr);
    border-radius:30px;
    font-weight:600;
    margin-top:10px;
    transition:0.5s;
  }
  .shop-now-btn:hover{
    background-color:#de5207;
    color:var(--dark-clr);
    transform:translateY(-3px);
  }
  
                /*--------- animation for hero text getting down-------- */
.hero-text {
  max-width: 500px;
  text-align: center;
  margin: 0 auto;
  flex: 1; 
  opacity: 0; 
  transform: translateY(-40px); 
  animation: fadeDown 2s ease forwards;
  z-index: 2;
}

@keyframes fadeDown {
  0% {
    opacity: 0;
    transform: translateY(-40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

 


@keyframes fadeUp{
  0% {
    opacity: 0;
    transform: translateY(-40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

                      /*------------section styles------------*/
 
html, body {
  height: 100%;
  overflow-x: hidden; 
  overflow-y: auto;   
  direction: rtl; 
}
body {
  -ms-overflow-style: none;  
  /* scrollbar-width: none;  Removed for better browser compatibility */
  overflow-y: scroll;        
}

body::-webkit-scrollbar {
  display: none;             /* Chrome, Safari, Edge */
}

.cards-section {
  width: 100%;
  padding: 50px 20px;
  background-color: #000000;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  direction: rtl;
  border-top: 2px solid #ddd;
  border-bottom: 2px solid #ddd;
  -ms-overflow-style: none;  /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.cards-section::-webkit-scrollbar {
  display: none;
}

.section-title {
  font-size: 2rem;
  text-align: right;
  margin-bottom: 20px;
  color: #dd3d28;
}

.cards-container {
  display: flex;
  gap: 20px;
  width: fit-content; /* حتى ما يلتف المحتوى */
  padding-bottom: 10px;
}

.card {
  max-width: 300px;
  min-width: 250px;
  background-color: rgb(0, 0, 0);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(114, 30, 30, 0.1);
  overflow: hidden;
  transition: transform 0.5s ease, box-shadow 0.3s ease;
  text-align: center;
  cursor: pointer;
  border: 1px solid #ddd;
  height:fit-content;
}

.card img {
  width: 100%;
  height: var(--card-image-height);
  object-fit: fill; /* استخدم fill كما طُلب — الصورة تمتد لملء الحاوية */
}

/* وصف البطاقات: اقتطاع بعد سطر واحد مع نقاط عند التجاوز */
.card p {
  padding: 0 10px 15px;
  font-size: 0.9rem;
  color: #bdb9b9;

  display: -webkit-box;
  -webkit-line-clamp: 1;       /* إظهار سطر واحد ثم ... */
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal; /* fallback */
  text-overflow: ellipsis;

  /* ضمان أن الارتفاع لا يسمح بظهور نصف السطر التالي */
  line-height: 1.4;      /* اضبط حسب ذوقك */
  max-height: 1.4em;     /* يساوي سطر واحد (line-height) */
}

/* وصف البطاقات - سطر واحد مع "..." */
.card-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* تأثير hover */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.popup-right::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, #0a0a0a);
  pointer-events: none;
}

/* 📱 ريسبونسف */
@media (max-width: 1080px) {
  .card {
    min-width: 200px;
  }
}
  .section-title {
    text-align: center;
  }                  

/*=======slider-section========*/
.carousel{
  margin: 100px auto;
  width:90%;
  border:5px solid rgb(0, 0, 0);
  display:flex;
  overflow-x: auto;
  scroll-behavior: smooth;
}
.carousel::-webkit-scrollbar{
  display:none;
}
.group{
  display:flex;
  align-items: center;
  justify-content: center;
  gap:1em;
  animation: spin 55s infinite linear;
  padding-right: 1em;
}
@keyframes spin{
  from{translate:0%;}
  to{translate: 100%;}
}

.slide-card{
  flex: 0 0 5em;
  width: 5em;
  background-color: rgb(0, 0, 0);
  border-radius:10px;
  box-shadow: 0 4px 10px rgba(114, 30,
    30, 0.1);
    font-size: 3rem;
  transition: transform 0.5s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border:5px solid #ddd;
  height:5em;
}
.slide-card img{
  width:100%;
  height:100%;
  object-fit: fill;
}


/*========footer-section========*/
.footer-sec {
  width: 100%;
  padding: 50px 20px;
  background-color: #31100c;
  margin: 0 auto;
  border-top: 1px solid #5e5b5b;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.contact-info {
  flex: 1;
  min-width: 300px;
  text-align: right;
}

.contact-info h1 {
  margin-bottom: 20px;
  color: var(--wheat-clr);
  font-size: 1.8rem;
}

.contact-info p {
  color: var(--primary-text);
  margin-bottom: 30px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-text);
}

.contact-item i {
  color: var(--wheat-clr);
  font-size: 1.2rem;
  width: 24px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  color: var(--primary-text);
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--wheat-clr);
}

.map-container {
  flex: 1;
  min-width: 300px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  height: 300px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.popup-content {
    max-width: 90%;
    max-height: 90vh;
  }

  

  .popup-right h2 {
    font-size: 1.5rem;
  }

  .main-image-container {
    height: 300px;
  }

/* Responsive adjustments */

@media (width:768){
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .contact-info {
    text-align: center;
  }
  
  .contact-item {
    justify-content: center;
  }

  .contact-item:nth-child(3) i {
    transform: translate(-15px, -10px);
}
  
  .social-links {
    justify-content: center;
  }
  
  .map-container {
    width: 100%;
  }

  .card{
    scroll-snap-align: start;
    width: 30px !important;
  }
}

/* ====================================================================
   🔄 استجابة للشاشات الأفقية (Landscape)
==================================================================== */

@media (max-height: 600px) and (orientation: landscape) {
  .popup-content {
    flex-direction: row;
    max-height: 95vh;
  }

  .popup-body {
    flex-direction: row;
  }

  .popup-left {
    max-height: none;
    border-radius: 15px 0 0 15px;
  }

  .popup-right {
    max-height: none;
    border-radius: 0 15px 15px 0;
    
  }

  .main-image-container {
    height: 280px;
  }
}


@media (max-width: 767px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .contact-info {
    text-align: center;
  }
  
  .contact-item {
    justify-content: center;
  }

  .contact-item:nth-child(3) i {
    transform: translate(-15px, -10px);
}
  
  .social-links {
    justify-content: center;
  }
  
  .map-container {
    width: 100%;
  }

  .popup-overlay {
    padding: 10px;
  }

  .popup-content {
    flex-direction: column;
    max-height: 95vh;
    max-width: 95%;
  }

  .popup-body {
    flex-direction: column;
  }

  /* القسم الأيسر - الصور */
  .popup-left {
    border-radius: 15px 15px 0 0;
    padding: 15px;
    max-height: 45vh;
  }

  .main-image-container {
    height: 250px;
  }

  /* القسم الأيمن - النصوص */
  .popup-right {
    border-radius: 0 0 15px 15px;
    padding: 20px;
    max-height: 50vh;
  }

  .popup-right h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  .popup-right p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  #popupSize {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .btn.btn-primary {
    width: 100%;
    text-align: center;
  }

  .close-btn {
    width: 35px;
    height: 35px;
    font-size: 24px;
    top: 10px;
    right: 10px;
  }

  .thumbnail {
    min-width: 60px;
    height: 60px;
  }
}
/* ====================================================================
   🪟 Popup Overlay - النافذة المنبثقة
==================================================================== */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

/* المحتوى الرئيسي */
.popup-content {
  background: #020202;
  border-radius: 15px;
  max-width: 900px;
  width: 100%;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 3px solid #6e6c6c;
  display: flex;
  flex-direction: row;
  max-height: 85vh;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* زر الإغلاق */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
  color: #f70202;
  background: rgba(0, 0, 0, 0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border: 2px solid #f70202;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #f70202;
  color: #fff;
  transform: rotate(90deg);
}

/* الجسم الداخلي */
.popup-body {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
}

/* ====================================================================
   📱 القسم الأيسر - الصور
==================================================================== */

.popup-left {
  flex: 1;
  background: #000000;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  overflow-y: auto;
}

.popup-left::-webkit-scrollbar {
  width: 6px;
}

.popup-left::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}

.popup-left::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 10px;
}

/* الصورة الرئيسية */
.main-image-container {
  width: 100%;
  height: 350px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

#popupMainImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* الصور المصغرة */
.thumbnail-container {
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding: 5px 0;
}

.thumbnail-container::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-container::-webkit-scrollbar-track {
  background: #333;
  border-radius: 10px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 10px;
}

.thumbnail {
  min-width: 70px;
  height: 70px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.7;
  object-fit: cover;
}

.thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: var(--wheat-clr);
  opacity: 1;
}

/* ====================================================================
   📝 القسم الأيمن - النصوص
==================================================================== */

.popup-right {
  flex: 1;
  padding: 30px;
  padding-top: 60px; /* مساحة لزر الإغلاق */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: right;
  
  /* ✅ السماح بالتمرير */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  
  background: #0a0a0a;
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  max-height: 600px;
}

.popup-right::-webkit-scrollbar {
  width: 8px;
}

.popup-right::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 8px;
}

.popup-right::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #444, #666);
  border-radius: 8px;
}

.popup-right::-webkit-scrollbar-thumb:hover {
  background: #7a7a7a;
}

/* العنوان */
.popup-right h2 {
  font-size: 1.8rem;
  color: var(--wheat-clr);
  margin-bottom: 15px;
  line-height: 1.3;
}

/* الوصف */
.popup-right p {
  color: var(--primary-text);
  line-height: 1.8;
  margin-bottom: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  direction: rtl;
}

/* القياس */
#popupSize {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.05); /* خلفية خفيفة جداً */
  border-radius: 20px; /* شكل بيضاوي أنيق */
  border: 1px solid rgba(198, 74, 74, 0.3); /* حدود حمراء خفيفة */
  font-size: 0.85rem;
  color: var(--primary-text);
  margin-bottom: 15px;
  align-self: flex-end;
  direction: rtl;
}

#popupSize::before {
  content: "القياس:";
  font-weight: 600;
}

#popupSize i {
  color: var(--wheat-clr);
}

/* زر الطلب */
.btn.btn-primary {
  background-color: var(--wheat-clr);
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 20px;
  align-self: flex-end;
}

.btn.btn-primary:hover {
  background-color: #de5207;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(222, 82, 7, 0.4);
}

/* تصغير المساحات على الشاشات الصغيرة لضمان رؤية النص */
@media (max-width: 600px) {
  .popup-content {
    max-height: 98vh;
    margin: 8px;
    padding: 8px;
  }
  .popup-left, .popup-right {
    padding: 12px;
  }
  .main-image-container { max-height: 40vh; min-height: 120px; }
  .popup-right { padding-right: 12px; }
}

/* popup size styling (displayed before description inside popup) */
#popupSize {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--primary-text);
  font-weight: 600;
  gap: 8px;
}

.btn.btn-primary {
  background-color: var(--wheat-clr);
  color: var(--dark-clr);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn.btn-primary:hover {
  background-color: #de5207;
}
.quick-view-btn {
  margin-top: 15px;
  display: inline-block;
  padding: 10px 15px;
  background-color: var(--wheat-clr);
  color: var(--dark-clr);
  border-radius: 30px;
  font-weight: 600;
  transition: 0.5s;
  cursor: pointer;
}
.quick-view-btn:hover {
  background-color: #de5207;
  color: var(--dark-clr);
  transform: translateY(-3px);
}
.quick-view-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(222, 82, 7, 0.5);
}
/*==================footer Section==================*/



/* ==================================================================== */
/* 📢 تنسيقات قسم الإعلانات (#gallery) - شريط التمرير الأفقي اللانهائي */
/* ==================================================================== */

/* ==================================================================== */
/* 📢 تنسيقات شريط الإعلانات (Infinity Scroll Slider) */
/* ==================================================================== */

#gallery {
    /* الخلفية والتظليل لقسم المعرض */
    padding: 20px 0;
    margin-bottom: 40px;
    background-color: #1A1A1A; 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.ads-slider-wrapper {
    overflow: hidden; 
    white-space: nowrap; 
}

.ads-slider-container {
    display: flex; 
    width: fit-content; 
    
    /* تطبيق الحركة اللانهائية (يمكنك تغيير المدة حسب الحاجة) */
    animation: scroll-ads var(--animation-duration, 40s) linear infinite; 
}

.ads-slider-container:active {
    animation-play-state: paused;
}

.ad-slide {
    flex-shrink: 0; 
    width: 240px; /* زيادة العرض قليلاً لاستيعاب البوردر */
    height: 220px; /* زيادة الارتفاع قليلاً */
    margin: 0 15px; /* زيادة المسافة بين الإعلانات */
    border-radius: 12px; /* زوايا دائرية أكثر نعومة */
    overflow: hidden;
    
    /* 💡 التعديل: إضافة ظل خارجي ناعم لجعل البطاقة تبرز */
    box-shadow: 0 0 15px rgba(180, 3, 3, 0.729), /* توهج خفيف من الخلف */
                0 4px 10px rgba(0, 0, 0, 0.5); /* ظل داكن للعمق */

    /* 💡 التعديل: تطبيق البوردر الأبيض على مستوى البطاقة نفسها */
    border: 2px solid rgb(205, 4, 4); 
    
    /* خلفية احتياطية */
    background-color: #000;
}

.ad-slide img {
    width: 100%;
    height: 100%;
    object-fit: fill; 
    display: block;
    /* إزالة أي بوردر داخلي قد يتعارض مع البوردر الخارجي */
    border-radius: 7px; /* زوايا داخلية أقل قليلاً */
    transition: transform 0.4s ease;
}

.ad-slide img:hover {
    transform: scale(1.03); /* تقليل التكبير قليلاً ليتناسب مع البوردر */
}

/* ---------------------------------------------------------------------- */
/* 🔑 الحركة اللانهائية (Keyframes) - لا تغيير */
/* ---------------------------------------------------------------------- */

@keyframes scroll-ads {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(+33.3333%); 
    }
}


/* ============================================= */
/* تعديلات على .cards-section للتصفح الأفقي */
/* ============================================= */

.cards-section {
  width: 100%;
  padding: 50px 20px;
  background-color: #000000;
  overflow-x: hidden; /* إخفاء التمرير من القسم الرئيسي */
  overflow-y: hidden;
  direction: rtl;
  border-top: 2px solid #ddd;
  border-bottom: 2px solid #ddd;
  position: relative;
}

.section-title {
  font-size: 2rem;
  text-align: center; /* توسيط العنوان */
  margin-bottom: 25px;
  color: #dd3d28;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* حاوية جديدة للبطاقات مع التصفح */
.cards-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  padding-bottom: 10px;
}

/* إخفاء شريط التمرير في Chrome, Safari and Opera */
.cards-wrapper::-webkit-scrollbar {
display: none;          /* إخفاء في Chrome/Safari */
}

.cards-wrapper::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}

.cards-wrapper::-webkit-scrollbar-thumb {
  background: #c64a4a;
  border-radius: 10px;
}

.cards-wrapper::-webkit-scrollbar-thumb:hover {
  background: #de5207;
}

.cards-container {
  display: flex;
  gap: 20px;
  width: fit-content; /* لمنع التفاف المحتوى */
  padding-bottom: 10px;
  min-width: 100%; /* للتأكد من امتداد الحاوية */
}

.card {
  flex-shrink: 0; /* منع الانكماش */
  background-color: rgb(0, 0, 0);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(114, 30, 30, 0.1);
  overflow: hidden;
  transition: transform 0.5s ease, box-shadow 0.3s ease;
  text-align: center;
  cursor: pointer;
  border: 1px solid #ddd;
  height: fit-content;
}

.card img {
  width: 100%;
  height: var(--card-image-height);
  object-fit: fill; /* استخدم fill كما طُلب — الصورة تمتد لملء الحاوية */
}

/* وصف البطاقات: اقتطاع بعد سطر واحد مع نقاط عند التجاوز */
.card p {
  padding: 0 10px 15px;
  font-size: 0.9rem;
  color: #bdb9b9;

  display: -webkit-box;
  -webkit-line-clamp: 1;       /* إظهار سطر واحد ثم ... */
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal; /* fallback */
  text-overflow: ellipsis;

  /* ضمان أن الارتفاع لا يسمح بظهور نصف السطر التالي */
  line-height: 1.4;      /* اضبط حسب ذوقك */
  max-height: 1.4em;     /* يساوي سطر واحد (line-height) */
}

/* وصف البطاقات - سطر واحد مع "..." */
.card-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* تأثير hover */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================= */
/* 💻 شاشات اللابتوب (أكثر من 1024px) - 5 منتجات */
/* ============================================= */
@media (min-width: 1025px) {
  .card {
    width: calc((100% - 80px) / 5); /* 5 منتجات مع مسافات 20px */
    min-width: 220px;
    max-width: 280px;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

/* ============================================= */
/* 📱 شاشات التابلت (768px - 1024px) - 4 منتجات */
/* ============================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .card {
    width: calc((100% - 60px) / 4); /* 4 منتجات مع مسافات 20px */
    min-width: 200px;
    max-width: 250px;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  .card p {
    font-size: 0.85rem;
  }
}

/* ============================================= */
/* 📱 شاشات الموبايل (أقل من 768px) - منتج واحد */
/* ============================================= */
@media (max-width: 767px) {
  .cards-section {
    padding: 30px 15px;
  }
  
  .card {
    width: calc(100% - 40px); /* منتج واحد */
    min-width: 280px;
    max-width: 350px;
  }
  
  .section-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 15px;
  }
  
  .card img {
    height: calc(var(--card-image-height) * 0.9);
  }
  
  .card h3 {
    font-size: 1.15rem;
  }
  
  .card p {
    font-size: 0.9rem;
    padding: 0 15px 15px;
  }
  
  /* زيادة حجم شريط التمرير قليلاً على الموبايل */
  .cards-section::-webkit-scrollbar {
    height: 6px;
  }
}

/* ============================================= */
/* 📱 شاشات الموبايل الصغيرة جداً (أقل من 480px) */
/* ============================================= */
@media (max-width: 480px) {
  /* البطاقات */
  .card {
    min-width: 260px;
    max-width: 320px;
  }
  
  .section-title {
    font-size: 1.3rem;
  }

  /* ✅ تعديلات النافذة المنبثقة */
  .popup-overlay {
    padding: 5px;
    padding-top: 10px;
  }

  .popup-content {
    max-width: 98%;
    max-height: 98vh;
    border-radius: 10px;
    
    /* ✅ جعل الصور فوق والنص تحت */
    flex-direction: column;
  }

  .popup-body {
    /* ✅ ترتيب عمودي: الصور أولاً ثم النص */
    flex-direction: column;
  }

  /* ✅ قسم الصور - في الأعلى */
  .popup-left {
    padding: 10px;
    max-height: 40vh;
    border-bottom: 2px solid #6e6c6c;
    border-radius: 10px 10px 0 0;
    border-bottom-left-radius: 0;
  }

  .main-image-container {
    height: 200px;
  }

  /* ✅ قسم النص - في الأسفل */
  .popup-right {
    padding: 15px;
    max-height: 55vh;
    
    /* ✅ تغيير الحواف للأسفل */
    border-radius: 0 0 10px 10px;
    border-top-right-radius: 0;
  }

  .popup-right h2 {
    font-size: 1.2rem;
  }

  .popup-right p {
    font-size: 0.9rem;
  }

  .btn.btn-primary {
    padding: 10px 20px;
    font-size: 0.95rem;
    width: 100%;
  }

  .close-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  /* الصور المصغرة */
  .thumbnail {
    min-width: 35px;
    height: 35px;
  }

  /* القياس */
  #popupSize {
    padding: 5px 10px;
    font-size: 0.8rem;
    transform: translateX(14px);
  }

  /* ============================================= */
  /* تحسينات البطاقات */
  /* ============================================= */

  .cards-container {
    scroll-snap-type: x proximity;
  }

  .card {
    scroll-snap-align: start;
  }

  /* تنسيق القياس داخل البطاقة */
  .product-size {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px !important;
    min-height: 28px !important;
    padding-top: 2px !important;
    width: 100%;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(198, 74, 74, 0.3);
    font-size: 0.85rem;
    color: var(--primary-text);
  }

  .product-size strong {
    color: var(--wheat-clr);
    font-weight: 600;
  }

  .product-size::before {
    content: "القياس:";
    font-size: 0.9rem;
  }

  .desc-html {
    color: var(--primary-text);
    line-height: 1.6;
    font-size: 16px;
    margin-top: 12.5px;
  }

  .card h3 {
    color: var(--wheat-clr);
    margin: 0px 0 0px 0;
    font-size: 1.2rem;
    min-height: 10px;
  }

  /* Lazy image transition */
  img.lazy {
    opacity: 0;
    filter: blur(1px);
    transition: opacity 0.25s linear, filter 0.25s linear;
  }
  
  img.lazy.loaded {
    opacity: 1;
    filter: blur(0);
  }

  /* Reduce animations */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation: none !important;
      transition: none !important;
    }
  }

  .map-container {
    border: 2px solid var(--wheat-clr);
    border-radius: 15px;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .popup-left .main-image-container {
    height: 180px;
  }
  
  .popup-left {
    max-height: 35vh;
  }
  
  .popup-right {
    max-height: 60vh;
  }
}

#stand-by{
  justify-content:center;
  align-items:center;
  font-size:0.7rem;
  font-family:fancy, sans-serif;
  color:var(--wheat-clr);
  margin-top: 30px;
}