/* ===============================
   پاپ‌آپ / مودال
   ============================== */
.demo-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* My Code */
button.demo-add-cart-btn {
  display: none;
}
button.demo-close-btn {
  border-radius: 50px;
}
button.device-btn {
  background: #ada7a7;
  border-radius: 50px;
  color: #333;
}

.demo-modal-wrapper {
  width: 100%;
  max-width: 1400px;
  height: 97vh;
  max-height: 900px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================
   نوار ابزار
   ============================== */
.demo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.demo-toolbar-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-toolbar-right {
  flex: 1;
  justify-content: flex-start;
}

.demo-toolbar-center {
  flex: 0 0 auto;
}

.demo-toolbar-left {
  flex: 1;
  justify-content: flex-end;
}

.demo-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.demo-new-tab {
  color: #aaa;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.3s;
}

.demo-new-tab:hover {
  color: #fff;
}

/* ===============================
   دکمه‌های دستگاه
   ============================== */
.device-btn {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-btn .device-label {
  font-size: 12px;
}

.device-btn:hover {
  background: #444;
  color: #fff;
}

.device-btn.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #3971fc;
  border-radius: 50px;
}

/* ===============================
   دکمه‌های خرید
   ============================== */
.demo-add-cart-btn {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.demo-add-cart-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: scale(1.05);
}

.demo-add-cart-btn.added {
  background: #2196f3;
}

.demo-view-cart-btn {
  background: #2196f3;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.demo-buy-link {
  background: linear-gradient(135deg, #3971fc 0%, #9913ab 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.3s;
}

.demo-buy-link:hover {
  background: linear-gradient(135deg, #9913ab 0%, #3971fc 100%);
  color: #fff;
  transform: scale(1.05);
}

/* ===============================
   دکمه بستن
   ============================== */
.demo-close-btn {
  background: transparent;
  border: 1px solid #555;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-close-btn:hover {
  background: #ff4444;
  border-color: #ff4444;
}

/* ===============================
   لودینگ
   ============================== */
.demo-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 16px;
}

.demo-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.demo-loading p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* ===============================
   فریم دمو
   ============================== */
.demo-frame-container {
  flex: 1;
  width: 100%;
  background: #f5f5f5;
  transition: all 0.4s ease;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  position: relative;
}

.demo-iframe {
  border: none;
  background: #fff;
  transition: all 0.4s ease;
}

/* سایز دسکتاپ */
.demo-frame-container.desktop {
  padding: 0;
}

.demo-frame-container.desktop .demo-iframe {
  width: 100%;
  height: 100%;
  min-height: 555px;
}

/* سایز تبلت - وسط‌چین */
.demo-frame-container.tablet {
  padding: 20px;
  align-items: center;
}

.demo-frame-container.tablet .demo-iframe {
  width: 768px;
  height: 1024px;
  max-height: 80vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

/* سایز موبایل - وسط‌چین */
.demo-frame-container.mobile {
  padding: 20px;
  align-items: center;
}

.demo-frame-container.mobile .demo-iframe {
  width: 375px;
  height: 812px;
  max-height: 80vh;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  border: 3px solid #333;
}

/* ===============================
   دکمه پیش‌نمایش در کارت محصول
   ============================== */
.demo-button {
  display: flex;
  align-items: center;
  min-height: 42px;
  width: 149px;
  padding: 8px 24px;
  background: #f4f6f9;
  color: #7e899b;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  justify-content: center;
}

.demo-button:hover {
  background: #eaeef5;
  color: #7e899b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 116, 170, 0.205);
}

.demo-button-icon {
  font-size: 20px;
}

/* ===============================
   ریسپانسیو
   ============================== */
@media (max-width: 768px) {
    .demo-toolbar-section.demo-toolbar-center {
    display: none;
}
a.demo-new-tab {
    display: none;
}
  .demo-modal-overlay {
    padding: 10px;
  }

  .demo-modal-wrapper {
    height: 97vh;
    border-radius: 12px;
  }

  .demo-toolbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .demo-toolbar-section {
    width: 100%;
    justify-content: center !important;
  }

  .demo-toolbar-right,
  .demo-toolbar-left {
    order: 2;
  }

  .demo-toolbar-center {
    order: 1;
    width: 100%;
  }

  .device-btn .device-label {
    display: none;
  }

  .demo-add-cart-btn,
  .demo-buy-link {
    padding: 8px 12px;
    font-size: 12px;
  }

  .demo-frame-container.tablet .demo-iframe,
  .demo-frame-container.mobile .demo-iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 60vh;
  }
}
