/* ------------------ RESET ------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background-color: #fff;
  color: #333;
  transition: background-color 0.4s, color 0.4s;
}

/* ------------------ LOADER ------------------ */
#loader {
  position: fixed;
  background: white;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-text {
  font-size: 1.5rem;
  color: #e91e63;
}

/* ------------------ DARK MODE ------------------ */
body.dark {
  background-color: #111;
  color: #eee;
}
body.dark .navbar,
body.dark .filters,
body.dark .footer,
body.dark .contact {
  background-color: #222;
  color: #fff;
}

body.dark #modeToggle {
  background: #333;
  color: #fff;
}
body.dark .subtitle {
  color: #ccc;
}

/* ------------------ MODE BUTTON ------------------ */
#modeToggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px;
  border: none;
  background-color: #eee;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s;
}
#modeToggle:hover {
  background-color: #e91e63;
  color: #fff;
}

/* ------------------ NAVBAR ------------------ */
.navbar {
  background-color: #ffe4ec;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.site-title {
  font-size: 2.2rem;
  color: #e91e63;
  font-weight: bold;
}
.subtitle {
  font-size: 1.2rem;
  color: #555;
  margin-top: 8px;
  font-style: italic;
}

/* ------------------ SEARCH ------------------ */
.search-bar {
  text-align: center;
  margin: 20px 10px;
}
.search-bar input {
  padding: 10px 15px;
  width: 60%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 25px;
  font-size: 1rem;
  transition: border-color 0.3s;
}
.search-bar input:focus {
  outline: none;
  border-color: #e91e63;
}

/* ------------------ FILTERS ------------------ */
.filters {
  text-align: center;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 10px 20px;
  margin: 5px 8px;
  background-color: #ffc0cb;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s;
}
.filter-btn.active,
.filter-btn:hover {
  background-color: #e91e63;
  color: white;
}

/* ------------------ GRID PRODUCTS ------------------ */
.products {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 30px 20px;
}
.product {
  flex: 1 1 250px;
  max-width: 300px;
  min-width: 200px;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.product img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  margin-bottom: 10px;
  background: #fafafa;
  padding: 10px;
  border-radius: 12px;
  transition: transform 0.3s ease;
}
.product:hover {
  transform: scale(1.03);
}
.product:hover img {
  transform: scale(1.05);
}
.stars {
  color: gold;
  font-size: 1rem;
  margin: 5px 0;
}

/* ------------------ SHOW MORE BUTTON ------------------ */
.show-more-container {
  text-align: center;
  margin-bottom: 30px;
}
#showMoreBtn {
  padding: 12px 30px;
  font-size: 1.1rem;
  background-color: #e91e63;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#showMoreBtn:hover {
  background-color: #ad1457;
}

/* ------------------ NO RESULTS ------------------ */
#noResults {
  font-weight: bold;
  color: #e91e63;
  margin: 20px auto;
  font-size: 1.2rem;
}

/* ------------------ MODAL ------------------ */
.modal {

  display: none;
  position: fixed;
  z-index: 1500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  padding: 40px 10px;
}

.modal-content {
  background-color: #fff;
  margin: auto;
  border-radius: 15px;
  padding: 20px;
  max-width: 600px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: #e91e63;
  cursor: pointer;
  transition: color 0.3s;
}
.close-btn:hover {
  color: #ad1457;
}

/* Modal Images */
.modal-images {
  text-align: center;
}
#mainModalImg {
  max-width: 100%;
  height: 380px;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}
.thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.thumbnails .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}
.thumbnails .thumb.active,
.thumbnails .thumb:hover {
  border-color: #e91e63;
}

/* Add to Cart Button */
#addToCartBtn {
  margin-top: 15px;
  padding: 10px 25px;
  background-color: #e91e63;
  border: none;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#addToCartBtn:hover {
  background-color: #ad1457;
}

/* ------------------ CONTACT ------------------ */
.contact {
  text-align: center;
  padding: 40px 20px;
  background: #ffe4ec;
}
.contact h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #e91e63;
}
.contact-icons a {
  font-size: 1.5rem;
  margin: 0 10px;
  color: #e91e63;
  transition: 0.3s;
}
.contact-icons a:hover {
  color: #ad1457;
}

/* ------------------ FOOTER ------------------ */
.footer {
  background-color: #ffe4ec;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: #800040;
  border-top: 1px solid #f3cfd9;
}

/* ------------------ RESPONSIVE ------------------ */
@media (max-width: 768px) {
  .products {
    gap: 15px;
  }
  .product {
    flex: 1 1 45%;
    max-width: none;
    min-width: auto;
  }
  .search-bar input {
    width: 90%;
  }
  #modeToggle {
    top: 15px;
    right: 15px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .product {
    flex: 1 1 100%;
    max-width: none;
  }
  .filter-btn {
    padding: 8px 15px;
    margin: 4px 6px;
    font-size: 0.9rem;
  }
  #showMoreBtn {
    width: 80%;
    padding: 12px 0;
    font-size: 1rem;
  }
}


/* تسجيل الدخول */
.auth-container {
  position: fixed;
  top: 20px;
  right: 80px;
  z-index: 1000;
  text-align: right;
}

#googleSignInBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #444;
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  position: static;
  
}

#googleSignInBtn:hover {
  background: #f7f7f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  color: #000;
}

#signOutBtn {
  background: #f44336;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-left: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
}

#signOutBtn:hover {
  background: #d32f2f;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
  transform: translateY(-2px);
}

/* سلة التسوق */
.cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #e91e63;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

.cart-item {
  display: flex;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.remove-item {
  margin-left: auto;
  background: #ff5252;
  color: white;
  border: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
}

.cart-total {
  font-weight: bold;
  font-size: 1.2rem;
  margin: 20px 0;
  text-align: right;
}

/* أزرار الطلب */
.order-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

#buyNowBtn {
  background: #4CAF50;
  color: white;
  border: none;
  margin-top: 15px;
  padding: 10px 25px;
  border-radius: 50px;
  cursor: pointer;
  flex: 1;
}

/* زر سلة التسوق */
.cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #e91e63;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}

.cart-icon:hover {
  transform: scale(1.1);
}

.cart-icon i {
  font-size: 1.2rem;
}

#cartCount {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffeb3b;
  color: #333;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* مودال سلة التسوق */
#cartModal .modal-content {
  max-width: 600px;
  width: 90%;
}

.cart-item {
  display: flex;
  align-items: center;
  margin: 15px 0;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-right: 15px;
  border-radius: 8px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h4 {
  margin: 0 0 5px 0;
  color: #333;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item {
  background: none;
  border: none;
  color: #e91e63;
  cursor: pointer;
  font-size: 1rem;
}

.cart-total {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: right;
  margin: 20px 0;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

#checkoutBtn {
  width: 100%;
  padding: 12px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#checkoutBtn:hover {
  background: #388E3C;
}

/* رسائل التنبيه */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #4CAF50;
}

.toast.error {
  background: #f44336;
}

/* أزرار المودال */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#addToCartBtn {
  background: #e91e63;
  color: white;
}

#addToCartBtn:hover {
  background: #c2185b;
}

#buyNowBtn {
  background: #2196F3;
  color: white;
}

#buyNowBtn:hover {
  background: #1976D2;
}

/* أنماط سلة التسوق */
.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background-color: #f9f9f9;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #eee;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  margin: 0 0 5px 0;
  font-size: 1rem;
  color: #333;
}

.cart-item-price {
  margin: 0;
  color: #e91e63;
  font-weight: bold;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background-color: #f0f0f0;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background-color: #e91e63;
  color: white;
}

.quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quantity-display {
  min-width: 20px;
  text-align: center;
  font-weight: bold;
}

.remove-item {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
  transition: all 0.2s ease;
}

.remove-item:hover {
  transform: scale(1.1);
}

.empty-cart {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

/* تأثيرات الحركة */
#cartCount.animate {
  animation: bounce 0.3s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* إشعارات التوست */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 2000;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #4CAF50;
}

.toast.error {
  background: #f44336;
}

.toast.info {
  background: #2196F3;
}

.toast i {
  font-size: 1.2rem;
}

/* أنماط نموذج إتمام الطلب */
#checkoutModal .modal-content {
  max-width: 600px;
  width: 90%;
  direction: rtl;
  text-align: right;
}

#checkoutForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group small {
  color: #666;
  font-size: 0.8rem;
}

.submit-order-btn {
  background-color: #e91e63;
  color: white;
  border: none;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s;
}

.submit-order-btn:hover {
  background-color: #c2185b;
}

/* تخصيص للعربية */
[dir="rtl"] .form-group {
  text-align: right;
}

/* أنماط للهواتف */
@media (max-width: 768px) {
  #checkoutForm {
    gap: 10px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 8px 12px;
  }
}

/* تخصيص لخيار الدفع الوحيد */
#paymentMethod {
  background-color: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}

#paymentMethod option {
  color: #333;
}


/* تسجيل الدخول - الإصدار المعدل للجانب الأيسر */
.auth-container {
  position: fixed;
  top: 15px;
  left: 15px; /* تغيير من right إلى left */
  z-index: 1000;
  display: flex;
  flex-direction: column; /* يجعل الأزرار عمودية */
  align-items: flex-start; /* تغيير إلى flex-start لمحاذاة لليسار */
}

#googleSignInBtn {
  background: #4285F4;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 5px;
  width: auto;
  text-align: left; /* تغيير إلى left */
}

#signOutBtn {
  background: #e91e63;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  width: auto;
  text-align: left; /* تغيير إلى left */
}

/* تعديلات للأجهزة الصغيرة */
@media only screen and (max-width: 768px) {
  .auth-container {
    top: 10px;
    left: 10px; /* تغيير من right إلى left */
  }
  
  #googleSignInBtn, 
  #signOutBtn {
    padding: 6px 10px;
    font-size: 9px;
    white-space: nowrap;
  }
}

/* للأجهزة الصغيرة جدًا */
@media only screen and (max-width: 480px) {
  .auth-container {
    flex-direction: row; /* الأزرار في صف واحد */
    gap: 3px;
  }
  
  #googleSignInBtn, 
  #signOutBtn {
    padding: 3px 3px;
    font-size: 11px;
  }
}

/* أنماط حالة التوفر */
.product-image-container {
  position: relative;
}

.out-of-stock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.out-of-stock-overlay span {
  background-color: #f44336;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
}

.availability-warning {
  background-color: #ffebee;
  color: #f44336;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: bold;
}

/* تعديل أزرار غير النشطة */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #9e9e9e !important;
}

/* تنبيه عدم التوفر */
.availability-alert {
  background-color: #fff3e0;
  color: #e65100;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.availability-alert i {
  font-size: 1.2rem;
}

/* أزرار النافذة */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-actions button:disabled {
  background-color: #e0e0e0 !important;
  color: #9e9e9e !important;
  cursor: not-allowed;
}

#addToCartBtn {
  background-color: #e91e63;
  color: white;
}

#addToCartBtn:hover:not(:disabled) {
  background-color: #c2185b;
}

#buyNowBtn {
  background-color: #4caf50;
  color: white;
}

#buyNowBtn:hover:not(:disabled) {
  background-color: #388e3c;
}

/* تفاصيل المنتج */
.product-details {
  margin: 15px 0;
}

.product-details p {
  margin: 10px 0;
  color: #333;
}

.product-details strong {
  color: #666;
}
  