/* Orders Modal Styles */
.orders-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.orders-modal.active {
  opacity: 1;
  visibility: visible;
}

.orders-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.orders-modal__content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.orders-modal.active .orders-modal__content {
  transform: translateY(0);
}

.orders-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 10;
  font-size: 16px;
  line-height: 1;
  color: #333;
}

.orders-modal__close:hover {
  background: #e0e0e0;
}

.orders-modal__title {
  padding: 20px 50px 20px 20px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

.orders-modal__list {
  padding: 15px;
  overflow-y: auto;
  flex: 1;
}

.orders-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
}

.orders-modal__loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #5a4a7f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.orders-modal__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #999;
  text-align: center;
}

.orders-modal__empty .icon {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.orders-modal__error {
  text-align: center;
  padding: 40px 20px;
  color: #e74c3c;
}

/* Order Item */
.order-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
}

.order-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-item:last-child {
  margin-bottom: 0;
}

.order-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.order-item__number {
  font-weight: 600;
  color: #333;
}

.order-item__date {
  font-size: 13px;
  color: #888;
}

.order-item__product {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}

.order-item__product:hover .order-item__name {
  color: #5a4a7f;
}

.order-item__image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.order-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item__info {
  flex: 1;
  min-width: 0;
}

.order-item__name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0;
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-item__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-item__status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.order-item__status--new {
  background: #d4edda;
  color: #155724;
}

.order-item__status--contacted {
  background: #cce5ff;
  color: #004085;
}

.order-item__status--converted {
  background: #fff3cd;
  color: #856404;
}

.order-item__status--cancelled {
  background: #f8d7da;
  color: #721c24;
}

.order-item__price {
  font-size: 16px;
  font-weight: 600;
  color: #5a4a7f;
}

.order-item__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.order-item__cancel {
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #e74c3c;
  background: transparent;
  color: #e74c3c;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.order-item__cancel:hover {
  background: #e74c3c;
  color: #fff;
}

.order-item__export {
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #5a4a7f;
  background: transparent;
  color: #5a4a7f;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.order-item__export:hover {
  background: #5a4a7f;
  color: #fff;
}

/* Order Details Panel */
.order-item__details-panel {
  background: #fff;
  border-radius: 6px;
  padding: 15px;
  margin-top: 12px;
  border: 1px solid #e0e0e0;
}

.order-details h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
}

.order-details h5 {
  margin: 15px 0 10px 0;
  font-size: 14px;
  color: #333;
}

.order-details__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.order-details__table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.order-details__table td:first-child {
  width: 40%;
  color: #666;
}

.order-details__table a {
  color: #5a4a7f;
  text-decoration: none;
}

.order-details__table a:hover {
  text-decoration: underline;
}

.order-details__options {
  margin: 0;
  padding: 0 0 0 20px;
  font-size: 13px;
}

.order-details__options li {
  margin-bottom: 5px;
}

.order-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status--new {
  background: #d4edda;
  color: #155724;
}

.order-status--contacted {
  background: #cce5ff;
  color: #004085;
}

.order-status--converted {
  background: #fff3cd;
  color: #856404;
}

.order-status--cancelled {
  background: #f8d7da;
  color: #721c24;
}

.order-item__details.btn--primary {
  background: #5a4a7f;
  color: #fff;
  border-color: #5a4a7f;
}

.order-item__details.btn--primary:hover {
  background: #4a3a6f;
}

/* Responsive */
@media (max-width: 576px) {
  .orders-modal__content {
    width: 95%;
    max-height: 90vh;
  }

  .order-item__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .order-item__actions {
    flex-direction: column;
  }
  
  .order-details__table td:first-child {
    width: 35%;
  }
}
