/* ========== نافذة المودال ========== */
.variant-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  max-width: 1000px;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease;
  position: relative;
}

/* ========== زر الإغلاق ========== */
.custom-close {
  /* width: 20px;
  height: 20px; */
  z-index: 1056 !important;
  cursor: pointer;
  font-size: 14px;
  color: red;
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 1; /* الغي تأثير الشفافية الافتراضي */
}

.custom-close:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}


/* ========== الأعمدة بجانب بعض ========== */
.main-container {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 5px 0;
  flex-wrap: wrap;
}

.left-column {
  flex: 0.45;
  /* 45% */
  background-color: #e6f7ff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.right-column {
  flex: 0.55;
  /* 55% */
  background-color: #fffbe6;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  min-width: 300px;
}

/* ========== متغيرات المنتج ========== */
#variant-options {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.detail-variant-viewer,
.variant-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-variant-nav-btn,
.variant-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--main-color, #007bff);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 10;
}

.detail-variant-nav-btn:hover,
.variant-nav-btn:hover {
  background: var(--main-color-dark, #0056b3);
}

.left-btn {
  left: -40px;
}

.right-btn {
  right: -40px;
}

.variant-group {
  border: none;
  padding: 0;
}

.variant-title {
  font-size: 24px;
  font-weight: bold;
}

.qty-lable {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 0.1rem;
}

.variant-option {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease;
  user-select: none;
  position: relative;
}

.variant-option input {
  display: none;
}

.variant-option span {
  display: inline-block;
}

.variant-option .color-box {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-left: 5px;
  margin-right: 5px;
  border: 1px solid #999;
}

.variant-option img.variant-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin-left: 6px;
  border-radius: 6px;
  border: 1px solid #aaa;
}

.variant-option:has(input:checked),
.variant-option input:checked+span {
  background-color: var(--gray-color);
  color: white;
  border-color: var(--gray-color);
}

/* ========== تثبيت حجم صورة المنتج داخل المودال ========== */
.variant-image img {
  width: 100%;
  max-width: 280px;
  height: 280px;
  object-fit: contain;
  display: block;
  margin: 0 auto 5px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.modal-content img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ========== التحكم في الكمية + الأزرار ========== */
#qty_container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ✅ الغلاف الأساسي */
.qty-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  transition: box-shadow 0.2s ease;
}

.qty-controls:hover {
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
}

/* ✅ أزرار الزيادة والنقصان */
.qty-btn {
  background: transparent;
  color: black;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  transform: scale(1.05);
  background: var(--primary-color);
}

/* ✅ حقل الكمية */
.qty-input {
  width: 60px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  outline: none;
  transition: border-color 0.2s;
}

.qty-input:focus {
  border-color: var(--primary-color);
}

/* ✅ تجاوب مع الشاشات الصغيرة */
@media (max-width: 576px) {
  #qty_container {
    gap: 4px;
  }

  .qty-controls {
    padding: 4px 6px;
    border-radius: 6px;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .qty-input {
    width: 48px;
    font-size: 0.9rem;
    padding: 4px;
  }
}


/* 🛒 أزرار الإجراءات */
.btn_container {
  width: 100%;
  margin-top: 20px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}


.btn_container .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-description {
  margin-top: 10px;
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

.variant-sku {
  text-align: center;
  font-weight: bold;
  margin-top: 8px;
}

.variant-stock {
  text-align: center;
  font-weight: bold;
  margin-top: 8px;
}

.btn {
  padding: 12px 25px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: #3a56d4;
}

.btn-secondary {
  background-color: #f0f4ff;
  border: 1px solid var(--primary-color);
  color: #fff;
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fav {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-favorite {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.4rem;
  transition: color 0.3s;
}

.btn-favorite.active {
  color: red;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
}



.review-count {
  color: #718096;
  font-size: 14px;
  margin-right: 10px;
}

.badge {
  /* padding: 4px 10px; */
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-featured {
  background-color: var(--danger-color);
  color: white;
}

.badge-best-selling {
  background-color: var(--warning-color);
  color: white;

}

.badge-new {
  background-color: var(--success-color);
  color: white;
}

/* .price-container {
    margin: 0px 0;
} */

.current-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
}

.original-price {
  font-size: 20px;
  text-decoration: line-through;
  color: #a0aec0;
  margin-right: 10px;
}

.discount-percentage {
  display: inline-block;
  background-color: var(--secondary-color);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.vat-info {
  font-size: 14px;
  color: var(--secondary-color);
  margin-top: 5px;
}

.specifications {
  margin: 25px 0;
}

.product-specifications {
  margin-top: 20px;
  padding: 15px;
  background-color: var(--card-bg, #f9f9f9);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.spec-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark, #333);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.spec-list li:last-child {
  border-bottom: none;
}

.spec-key {
  font-weight: 600;
  color: var(--text-color, #222);
}

.spec-value {
  color: var(--muted-color, #555);
}




/* تأثير التلاشي عند تغيير المتغير */
#detail-variants-container {
  transition: opacity 0.4s ease;
}

#detail-variants-container.fade-out {
  opacity: 0;
}

#detail-variants-container.fade-in {
  opacity: 1;
}


/* 🧩 خيارات المتغيرات */
#variant-options fieldset {
  border: 1px solid var(--gray-color);
  padding: 5px;
  margin-bottom: 5px;
  border-radius: 10px;
}

#variant-options legend {
  font-weight: bold;
  color: var(--dark-color);
}

#variant-options label {
  display: inline-block;
  margin: 5px 8px 5px 0;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#variant-options input[type="radio"]:checked+label,
#variant-options label:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}


/* إخفاء المودال افتراضيًا */
#variant-modal {
  display: none;
}

.btn-icon {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background-color: white;
  border: 1px solid var(--gray-color);
  color: var(--dark-color);
}

.btn-icon:hover {
  background-color: var(--gray-color);
}

/* حركة الخروج */
.slide-out-left {
  animation: slideOutLeft 0.25s ease forwards;
}

.slide-out-right {
  animation: slideOutRight 0.25s ease forwards;
}

/* حركة الدخول */
.slide-in-left {
  animation: slideInLeft 0.4s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.4s ease forwards;
}

/* ==== Keyframes ==== */
@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== تجاوب RESPONSIVE: عمودي في الشاشات الصغيرة ========== */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .left-column,
  .right-column {
    flex: 1 1 100%;
  }

  .variant-image img {
    max-width: 100%;
    height: auto;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}