:root {
  --primary-color: #0c241c;
  --primary-light: #163832;
  --primary-dark: #081610;
  --text-light: #ffffff;
  --text-dark: #333333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Tajawal", sans-serif;
}

a {
  text-decoration: none;
}

body {
  background-color: #f5f5f5;
}

.header {
  background: var(--primary-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.store-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.store-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-light);
}

.cart-icon {
  font-size: 24px;
  color: var(--text-light);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4444;
  color: white;
  font-size: 12px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* نبدأ مباشرة بأنماط المنتجات */
.products-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 كاردز في الشاشات الكبيرة */
  gap: 20px;
}

@media (max-width: 930px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    /* كاردين في الشاشات المتوسطة والصغيرة */
  }
}

.product-card {
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 450px;
  /* ارتفاع ثابت للبطاقة */
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  /* إضافة مؤشر اليد */
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px;
}

.product-details {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.product-name {
  font-weight: 500;
  color: var(--primary-color);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* Add standard property */
  -webkit-box-orient: vertical;
  line-height: 1.4;
  min-height: 2.8em;
  direction: rtl;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.product-subcategory {
  color: #666;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 8px;
}

.product-price {
  direction: rtl;
  font-size: 18px;
  color: var(--primary-color);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 15px;
  margin-bottom: 15px;
  border-top: 1px solid #eee;
}

.price-original {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9em;
  margin-left: 5px;
}

.price-discount {
  color: #e74c3c;
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.product-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 40px;
  /* ارتفاع ثابت للزر */
  display: flex;
  align-items: center;
  justify-content: center;
}

.details-btn {
  background: var(--primary-light);
  color: white;
}

.details-btn:hover {
  background: var(--primary-color);
}

.add-to-cart-btn {
  background: #28a745;
  color: white;
}

.add-to-cart-btn:hover {
  background: #218838;
}

.no-products {
  text-align: center;
  padding: 40px;
  color: #666;
  background: white;
  border-radius: 12px;
}

.product-sizes {
  margin-top: 10px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.size-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  font-family: "Tajawal", sans-serif;
  direction: rtl;
}

.size-select option {
  direction: rtl;
}

.price-strike {
  text-decoration: line-through;
  color: #999;
  margin-right: 5px;
}

.price-discount-value {
  color: #e74c3c;
}

.size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.size-button {
  flex: 1;
  min-width: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
  text-align: center;
  transition: all 0.3s ease;
}

.size-button:hover {
  border-color: var(--primary-color);
}

.size-button.selected {
  border-color: var(--primary-color);
  background: var(--primary-light);
  color: white;
}

.size-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-item {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.size-item:hover {
  border-color: var(--primary-color);
}

.size-value {
  font-weight: bold;
  color: var(--primary-color);
  display: block;
}

.size-price {
  display: block;
  margin-top: 5px;
  font-size: 0.9em;
  direction: ltr;
}

.size-price-original {
  text-decoration: line-through;
  color: #999;
  margin-left: 5px;
}

.size-price-discount {
  color: #e74c3c;
  font-weight: bold;
}

.size-circle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.3s ease;
  margin: 3px;
  cursor: default;
  /* إزالة مؤشر اليد */
  user-select: none;
  -webkit-user-select: none;
  font-size: 11px;
}

.size-text {
  font-size: 10px;
  /* تصغير من 14px */
  font-weight: 800;
}

.product-unavailable {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  /* السماح بالنقر على العناصر تحت الطبقة */
}

.unavailable-message {
  background: #ff4444;
  color: white;
  padding: 8px 25px;
  border-radius: 20px;
  font-weight: 700;
  /* جعل الخط أكثر سماكة */
  font-size: 16px;
  /* زيادة حجم الخط */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.categories {
  max-width: 1200px;
  margin: 10px auto;
  padding: 15px;
  display: flex;
  justify-content: center;
  gap: 35px;
  overflow-x: auto;
  white-space: nowrap;
  flex-direction: row-reverse;
}

.category {
  position: relative;
  width: 140px;
  text-align: center;
  transition: transform 0.3s ease;
}

.category-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  cursor: pointer;
}

.category-circle i {
  font-size: 50px;
  /* تصغير من 60px */
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.category:hover .category-circle {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-light);
}

.category:hover i {
  color: var(--primary-light);
  transform: scale(1.2);
}

.category-name {
  margin-top: 12px;
  /* تقليل من 15px */
  font-size: 16px;
  /* تصغير من 18px */
  font-weight: 600;
  color: var(--primary-color);
}

.subcategories {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  z-index: 2;
}

.subcategories.active {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.subcategory {
  background: white;
  padding: 8px 20px;
  border-radius: 25px;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.subcategory:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.subcategory.selected {
  background: var(--primary-color);
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Remove all search-related styles from here */
.divider {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  position: relative;
  border-bottom: 1px solid rgba(12, 36, 28, 0.1);
}

.products-counter {
  display: none;
}

.counter-number {
  font-weight: 700;
  font-size: 16px;
}

.counter-text {
  color: #666;
}

.phone-link {
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.phone-link:hover {
  color: #ffffff;
  transform: scale(1.05);
}

.phone-link i {
  margin-left: 10px;
  color: #ffffff8c;
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 15px;
  }

  .store-logo {
    width: 50px;
    height: 50px;
  }

  .store-name {
    font-size: 20px;
  }
}

@media (max-width: 992px) {
  .product-image {
    height: 200px;
    /* تصغير من 250px */
  }

  .product-card {
    min-height: 400px;
    /* تصغير من 450px */
  }
}

@media (max-width: 768px) {
  .product-image {
    height: 180px;
  }

  .product-card {
    min-height: 380px;
  }
}

@media (max-width: 480px) {
  .product-image {
    height: 160px;
  }

  .product-subcategory {
    font-size: 10px;
  }

  .product-card {
    min-height: 360px;
  }

  .category-circle {
    width: 140px;
    height: 140px;
  }

  .fa-spray-can:before {
    font-size: 40px;
    /* تصغير من 50px */
  }

  .subcategories.active {
    gap: 5px;
    flex-direction: column;
    align-content: center;
    flex-wrap: wrap;
  }
}

/* Footer Styles */
.footer {
  background: var(--primary-color);
  color: var(--text-light);
  padding: 40px 0 0;
  margin-top: 50px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 0 20px;
}

.footer-section h3 {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 2px;
  background: #ffffff3d;
}

.footer-section p {
  line-height: 1.8;
  margin-bottom: 10px;
}

.footer-section.contact i {
  margin-left: 10px;
  color: #ffffff8c;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-link {
  width: 40px;
  height: 40px;
  background: #ffffff1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--text-light);
  color: var(--primary-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background: var(--primary-dark);
  font-size: 14px;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-section h3::after {
    right: 50%;
    transform: translateX(50%);
  }

  .social-links {
    justify-content: center;
  }
}

.sizes-wrapper {
  flex: 1;
  flex-wrap: wrap;
  align-content: flex-start;
  font-size: 18px;
  color: var(--primary-color);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-top: 15px;
  margin-bottom: 5px;
  border-top: 1px solid #eee;
}

.product-name {
  font-weight: 500;
  color: var(--primary-color);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  /* Add standard property */
  -webkit-box-orient: vertical;
  line-height: 1.4;
  min-height: 2.8em;
  direction: rtl;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* للنصوص الإنجليزية */
.product-name[dir="ltr"] {
  direction: ltr;
  text-align: left;
  width: 100%;
  word-break: break-word;
}

@media (max-width: 500px) {
  .product-subcategory {
    font-size: 10px;
  }

  .sizes-wrapper {
    gap: 2px;
  }

  .size-circle {
    margin: 0;
  }

  .size-text {
    font-size: 10px;
  }
}

/* أضف هذه الأنماط في قسم style */
.subcategories-container {
  max-width: 1200px;
  margin: 0 auto 15px;
  padding: 15px;
  overflow: hidden;
  display: none;
}

.subcategories-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.subcategory-item {
  background: white;
  padding: 8px 20px;
  border-radius: 20px;
  color: var(--primary-color);
  font-weight: 500;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.subcategory-item:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

.subcategory-item.active {
  background: var(--primary-color);
  color: white;
}

@media (max-width: 768px) {
  .subcategories-container {
    padding: 10px;
  }

  .subcategory-item {
    padding: 6px 15px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .subcategory-item {
    padding: 5px 12px;
    font-size: 13px;
  }
}

.category-circle {
  position: relative;
}

.promotions-section {
  margin: 20px auto 40px;
  max-width: 1000px;
  /* تغيير من 1200px إلى 1000px */
  overflow: hidden;
  position: relative;
  padding: 0 20px;
  direction: ltr;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

.promotions-slider {
  display: flex;
  scroll-snap-type: x mandatory;
  overflow-x: hidden;
  /* تغيير من auto إلى hidden */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  width: 100%;
}

.promo-slide {
  min-width: 100%;
  width: 100%;
  flex-shrink: 0;
  scroll-snap-align: center;
}

.promo-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  /* نسبة 1200:600 */
  object-fit: contain;
  /* لضمان عرض الصورة كاملة */
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: #fff;
  /* خلفية بيضاء للصور */
}

.promotion-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
}

.dot {
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solidrgb(0, 86, 19);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(20, 119, 43);
  transform: scale(0);
  transition: transform 0.3s ease;
  border-radius: 50%;
}

.dot.active::after {
  transform: scale(1);
}

.dot:hover {
  transform: scale(1.2);
}

.search-container {
  max-width: 600px;
  margin: 20px auto;
  padding: 0 15px;
  position: relative;
}

.search-box {
  position: relative;
  width: 100%;
}

#searchInput {
  width: 100%;
  padding: 12px 40px 12px 15px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  transition: all 0.3s ease;
  direction: rtl;
}

#searchInput:focus {
  border-color: #0c241c;
  box-shadow: 0 0 0 3px rgba(12, 36, 28, 0.1);
  outline: none;
}

.clear-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 5px;
  display: none;
}

.clear-search:hover {
  color: #000;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  right: 15px;
  left: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
  max-height: 320px;
  /* ارتفاع 4 عناصر تقريباً */
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #0c241c #f0f0f0;
}

.search-suggestions::-webkit-scrollbar {
  width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background-color: #0c241c;
  border-radius: 3px;
}

.suggestion-item {
  height: 70px;
  /* ارتفاع ثابت لكل عنصر */
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggestion-item:last-child {
  margin-bottom: 0;
}

.suggestion-item:hover {
  background: #f5f5f5;
}

.suggestion-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-left: 15px;
  border-radius: 8px;
}

.suggestion-info {
  flex: 1;
}

.suggestion-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.suggestion-price {
  color: #666;
  font-size: 14px;
}

.no-suggestions {
  padding: 20px;
  text-align: center;
  color: #666;
}

.no-suggestions i {
  font-size: 40px;
  color: #ddd;
  margin-bottom: 10px;
  display: block;
}

.suggestion-sizes {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.size-badge {
  background-color: #f5f5f5;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #666;
}

@keyframes slideProgress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.slide-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(52, 152, 219, 0.2);
}

.slide-progress-bar {
  height: 100%;
  background: #3498db;
  transform-origin: left;
  transform: scaleX(0);
}

.no-products {
  width: 100%;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
}

.no-products i {
  font-size: 50px;
  color: #ddd;
  margin-bottom: 15px;
}

.no-products .message {
  font-size: 18px;
  margin-bottom: 10px;
}

.no-products .sub-message {
  font-size: 14px;
  color: #999;
}

/* إزالة تأثيرات الانتقال من product-card */
.product-card {
  opacity: 1;
  transform: none;
  animation: none;
}

/* الإبقاء على تأثيرات الانتقال للإعلانات فقط */
.promotions-section {
  margin: 20px auto 40px;
  max-width: 1200px;
  overflow: hidden;
  position: relative;
  padding: 0 20px;
  direction: ltr;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* إزالة تأثيرات الانتقال من products-grid */
.products-grid {
  transition: none;
}

.products-grid.loading {
  opacity: 1;
}

@media (max-width: 768px) {
  .promotions-section {
    margin: 15px auto 30px;
    padding: 0 10px;
  }

  .promo-image {
    border-radius: 8px;
    aspect-ratio: 16/9;
    /* الحفاظ على نفس النسبة */
  }

  .promotion-dots {
    bottom: 10px;
    gap: 8px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }

  .no-products {
    height: 250px;
    margin: 15px 0;
  }

  .no-products i {
    font-size: 40px;
  }

  .no-products .message {
    font-size: 16px;
  }

  .suggestion-item:hover {
    background: #fff;
  }
}

.category-circle.active {
  background: var(--primary-light);
  border-color: var(--text-light);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.category-circle.active i {
  color: var(--text-light);
}

.subcategory-item {
  background: white;
  padding: 8px 20px;
  border-radius: 20px;
  color: var(--primary-color);
  font-weight: 500;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.subcategory-item:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

.subcategory-item.active {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.subcategories-container {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 20px;
  display: none;
}

.subcategories-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
