/* css/style.css */

/* --- الخطوط وأساسيات الصفحة --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;

}

body {
  margin: 0;
  background: #f9f9f9;
  color: #333;
  direction: rtl;
  line-height: 1.6;
}

/* --- الهيدر --- */
.header {
  background-color: #009688;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header h3 {
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0;
}

#cart-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  position: relative;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.2s ease;
}

#cart-btn:hover {
  transform: scale(1.1);
}

#cart-count {
  background: #ff3b3b;
  border-radius: 50%;
  padding: 0px 7px;
  font-size: 0.75rem;
  position: absolute;
  top: -8px;
  left: -8px;
  font-weight: 700;
  box-shadow: 0 0 4px #ff3b3b;
}

/* --- شريط الأقسام --- */
.categories {
  padding: 10px 20px;
  background: white;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-bottom: 1px solid #ddd;
  scroll-behavior: smooth;
}

.categories button {
  background-color: #e0e7ff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.categories button:hover,
.categories button:focus {
  background-color: #00685d;
  color: white;
  outline: none;
}

/* --- قائمة المنتجات --- */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 15px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.product-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  height: 140px;
  margin-bottom: 12px;
}

.product-card h4 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #222;
  flex-grow: 1;
}

.product-card p {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #444;
}

.product-card p del {
  color: #999;
  margin-right: 10px;
}

.product-card p strong {
  color: #009688;
  font-weight: 700;
}

.product-card button {
  padding: 8px;
  background-color: #009688;
  border: none;
  color: white;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 20px;
}

.product-card button:hover {
  background-color: #00796b;
}

/* --- مودال المنتج --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 15px;
  max-width: 650px;
  width: 100%;
  padding: 15px 20px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  max-height: 90vh;
  height: 90vh;
}

.modal-content h2 {
  font-size: 1.6rem;
  color: #009688;
  margin: 20px 0 15px;
}

.modal-content p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 18px;
}

.modal-content p#modal-prices {
  font-weight: 700;
  font-size: 1.2rem;
  color: #333;
}

.modal-content p#modal-prices del {
  color: #999;
  margin-left: 10px;
  font-weight: 400;
}

.modal-content .close-btn {
  position: absolute;
  top: 12px;
  left: 15px;
  font-size: 1.8rem;
  cursor: pointer;
  font-weight: 700;
  color: #999;
  transition: color 0.2s ease;
}

.modal-content .close-btn:hover {
  color: #009688;
}

/* --- معرض الصور داخل المودال --- */
.gallery,
#modal-gallery.gallery {
  display: flex;
  gap: 10px;

  margin-bottom: 20px;
  justify-content: center;
}

.gallery img,
#modal-gallery.gallery img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s, box-shadow 0.2s;
}

.gallery img:hover,
#modal-gallery.gallery img:hover {
  border-color: #009688;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#main-image-wrapper {
  text-align: center;
  margin-bottom: 15px;
}

#main-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: 0.3s ease-in-out;
}

/* --- أزرار المودال --- */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.modal-actions button,
.modal-actions a {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.modal-actions a.whatsapp-btn {
  background-color: #25D366;
  color: white;
}

/* --- مودال العربة --- */
.cart-modal {
  position: fixed;
  top: 80px;
  right: 0;
  width: 350px;
  height: 85vh;
  background: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.459);
  z-index: 3000;
  display: none;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.cart-modal.show {
  transform: translateX(0);
}

.cart-content {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 1s forwards;
  animation: fade-in 0.5s forwards;
  opacity: 0;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-btn {
  align-self: flex-start;
  font-size: 1.8rem;
  cursor: pointer;
  font-weight: 700;
  color: #666;
  margin-bottom: 15px;
  user-select: none;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #009688;
}

#cart-items > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

#cart-items > div > div button {
  background: #009688;
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  margin: 0 2px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.3s ease;
  padding: 2px !important;
  
}

#cart-items > div > div button:hover {
  background: #00796b;
}
.cart-content input {
  padding: 8px 10px;
  font-size: 1rem;
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  margin-bottom: 6px;
}
.cart-content input:focus {
  border-color: #009688;
  outline: none;
}
.cart-content textarea {
  padding: 8px 10px;
  font-size: 1rem;
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  margin-bottom: 6px;
  height: 100px;
}
.cart-content textarea:focus {
  border-color: #009688;
  outline: none;
}
#cart-total {
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 15px;
  margin-bottom: 10px;
  color: #009688;
}

#coupon-input {
  padding: 8px 10px;
  font-size: 1rem;
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  margin-bottom: 6px;
}

#coupon-input:focus {
  border-color: #009688;
  outline: none;
}

#coupon-msg {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: #d93025;
}

button.checkout-btn {
  background-color: #009688;
  color: white;
  font-weight: 700;
  border: none;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

button.checkout-btn:hover {
  background-color: #00796b;
}

/* --- استجابة للجوال --- */
@media (max-width: 600px) {
  .products {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 10px;
  }

  .cart-modal {
    width: 100%;
  }
}
.coupon-btn {
  background-color: #009688;
  color: white;
  font-weight: 700;
  border: none;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}
.coupon-btn:hover {
  background-color: #00796b;
}
.cart-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.cart-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 10px;
  padding: 7px;
}

.cart-info {
  flex: 1;
}


.discount-badge {
  position: absolute;
  top: 10px;
  left: 5px;
  background-color: red;
  color: white;
  padding: 2px 15px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 1;
}
.qty-controls {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
}
.qty-controls button {
  background: #009688;
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  margin: 0 2px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;

}
.div1{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.div1 img{

  border-radius: 50%;
  margin: 0 auto;
  display: block;
  margin-top: -40px;
  margin-bottom: 10px;
  border: 2px solid #fff;
  z-index: 9999;
}

.div2{
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 10px;
}
.div2 input{
  padding: 8px 10px;
  font-size: 1rem;
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  margin-bottom: 6px;

}
.div2 input:focus {
  border-color: #009688;
  outline: none;
}
.div2 i{
  background-color: #009688;
  color: white;
  position: relative;
  top: -45px;
  right:  93%;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}
@media screen and (max-width: 600px) {
  .div2 i{
    top: -45px;
    right:  87%;
  }
  
}

.cart-modal label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  width: 100%;
  text-align: right;
  font-size: 1rem
}

.cart-modal select {
  padding: 8px 10px;
  font-size: 1rem;
  width: 100%;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  margin-bottom: 6px;
}

.load{
  width: 55px;
  height: 55px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #009688;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 5px auto;
  display: none;
}
.load2{
  width: 55px;
  height: 55px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #009688;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 5px auto;
  position: relative;
  top:50%;
  left: -50%;
  transform: translate(-50%, -50%);
  margin-bottom: 100px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
footer{
  width: 100%;
  background-color: black;
  color: white;
  padding: 10px;
  text-align: center;

}
.fdiv1{
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin-bottom: 10px;
}
.fdiv2{
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}
footer p{
  margin-bottom: 0px !important;
  font-size: 14px;
  display: none !important;
}
footer a{
  text-decoration: none;
  color: white;
}
footer a:hover{
  color:#00dfc8;
}