/* ==========================================================
   🎨 ByteHub Store — Layout & Product Grid
   ========================================================== */

/* التخطيط العام */
.store-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem 1rem;
  font-family: 'Poppins', sans-serif;
}

/* الإعلانات الجانبية */
.sidebar-ads {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-ads .ad-card,
.ad-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 1rem;
  text-align: center;
  padding: 2rem 1rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}
.ad-card {
  background: #fff;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.sidebar-ads .ad-card:hover {
  transform: translateY(-5px);
}
/* ==========================================================
   🛒 Cart Dropdown
   ========================================================== */

#cartDropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--card-bg, #fff);
  color: var(--text, #222);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow-y: auto;
  z-index: 1000;
  padding: 10px;
  box-sizing: border-box;
}

.cart-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.cart-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item-name {
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.cart-item-price {
  font-size: 13px;
  color: #555;
}

.cart-quantity {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.qty-btn {
  background: #eee;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
}

.qty-value {
  min-width: 20px;
  text-align: center;
}

.cart-footer {
  border-top: 1px solid #ddd;
  padding-top: 10px;
  margin-top: 10px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.cart-actions button {
  padding: 6px 12px;
  border: none;
  background: var(--primary, #0b2545);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
/* شبكة المنتجات */
.products-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* البطاقة */
.product-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* الشارات */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ff4d4f;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.status {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #198754;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}
.status.unavailable {
  background: #6c757d;
}

/* المحتوى داخل البطاقة */
.product-info {
  padding: 1rem;
}
.product-category {
  color: #6c757d;
  font-size: 0.85rem;
}
.product-name {
  display: block;
  font-weight: bold;
  margin: 0.3rem 0;
  color: #111;
  text-decoration: none;
}
.price-row {
  margin-top: 6px;
}
.price {
  color: #198754;
  font-weight: 700;
}
.old-price {
  text-decoration: line-through;
  color: #999;
  margin-left: 8px;
  font-size: 13px;
}
.rating {
  color: #ffc107;
  font-size: 0.9rem;
  margin-top: 6px;
}

/* زر المفضلة */
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: all 0.3s;
}
.wishlist-btn:hover {
  background: #ff3366;
  color: #fff;
  transform: scale(1.1);
}

/* أزرار Add/View */
.rect-btn {
  background: #198754;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background .3s, transform .3s;
}
.rect-btn:hover {
  background: #145c39;
  transform: translateY(-2px);
}
.card-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  opacity: 1;
  position: relative;
  transform: none;
  pointer-events: auto;
}

/* نص التحميل */
.loading {
  text-align: center;
  color: #888;
  font-style: italic;
}

/* ==========================================================
   👁️ Quick View Modal
   ========================================================== */

#quickViewModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  overflow-y: auto;
  padding: 50px 20px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}
.qv-inner {
  display: flex;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  position: relative;
  gap: 20px;
}
.qv-close {
  position: absolute;
  top: 15px; right: 15px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: color 0.2s ease;
}
.qv-close:hover { color: #ff0000; }

.qv-left {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qv-left img#mainProductImage {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  max-height: 400px;
  transition: transform 0.3s ease;
}
.qv-left img#mainProductImage:hover {
  transform: scale(1.02);
}
.thumbnail-slider {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.thumbnail-slider img {
  width: 60px; height: 60px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}
.thumbnail-slider img:hover {
  border: 2px solid #007bff;
  transform: scale(1.1);
}

.qv-right {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qv-right h2 {
  margin: 0;
  font-size: 24px;
  color: #222;
}
.qv-right .category {
  font-size: 14px;
  color: #555;
}
.qv-right .price {
  font-size: 22px;
  font-weight: bold;
  color: #007bff;
}
.qv-right .price span {
  text-decoration: line-through;
  font-size: 16px;
  color: #888;
  margin-left: 10px;
}
.qv-right .short-desc {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}
.qv-right .product-options {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
}
.qv-right .product-options label {
  font-size: 14px;
  margin-right: 5px;
}
.qv-right select,
.qv-right input[type="number"] {
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}
.qv-right .qv-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.qv-right .qv-actions button {
  padding: 10px 14px;
  background: #007bff;
  color: #fff;
  border: none;
   border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qv-right .qv-actions button:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

/* أيقونات المشاركة */
.qv-right .share-icons {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  font-size: 20px;
}
.qv-right .share-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eee;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.qv-right .share-icons a:hover {
  background: #007bff;
  color: #fff;
  transform: scale(1.1);
}

/* ==========================================================
   📱 Responsive Design
   ========================================================== */

@media (max-width: 980px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  #quickViewModal .qv-left img {
    width: 200px;
    height: 200px;
  }

  .product-link img,
  .product-name {
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
  }

  .product-link img:hover {
    transform: scale(1.05);
  }

  .product-name:hover {
    color: #0b2545;
    text-decoration: underline;
  }

  .container {
    margin: 20px 10px;
    padding: 15px;
  }

  #checkoutForm button,
  #orderDetails button {
    width: 100%;
  }
}

/* ==========================================================
   💳 Currency Dropdown
   ========================================================== */

.currency-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 10px;
}

.currency-toggle {
  background: #f0f0f0;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.currency-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 120px;
  display: none;
}

.currency-menu button {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.currency-menu button:hover {
  background: #f5f5f5;
}
