/* ===================================
   MEUS PEDIDOS SECTION
   =================================== */

.orders-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 24px 0;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.order-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.order-number {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-number strong {
  font-size: 16px;
  color: #111827;
}

.order-date {
  font-size: 14px;
  color: #6b7280;
}

.order-status {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.order-status.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.order-status.status-processing {
  background-color: #dbeafe;
  color: #1e40af;
}

.order-status.status-on-hold {
  background-color: #fce7f3;
  color: #9f1239;
}

.order-status.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.order-status.status-cancelled {
  background-color: #f3f4f6;
  color: #6b7280;
}

.order-status.status-refunded {
  background-color: #fce7f3;
  color: #9f1239;
}

.order-status.status-failed {
  background-color: #fee2e2;
  color: #991b1b;
}

.order-status.status-shipped {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Hide pre-rendered order details content */
.order-details-content {
  display: none !important;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-details {
  flex: 1;
}

.item-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.item-quantity {
  font-size: 13px;
  color: #6b7280;
}

.more-items {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
  margin-top: 8px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.order-total {
  font-size: 16px;
  color: #111827;
}

.order-total strong {
  font-weight: 700;
}

.view-order-btn {
  background-color: #004F6B;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.view-order-btn:hover {
  background-color: #e6a708;
  color: #000000;
}

.no-orders {
  text-align: center;
  padding: 60px 20px;
}

.no-orders i {
  font-size: 64px;
  color: #d1d5db;
  margin-bottom: 20px;
}

.no-orders p {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 24px;
}

.start-shopping-btn {
  display: inline-block;
  background-color: #004F6B;
  color: #ffffff;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.start-shopping-btn:hover {
  background-color: #2563eb;
  color: #ffffff;
}

/* ===================================
   ORDER DETAIL VIEW
   =================================== */

.order-detail-header {
  margin-bottom: 24px;
}

.back-to-orders-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.back-to-orders-btn:hover {
  color: #2563eb;
}

.back-to-orders-btn i {
  font-size: 14px;
}

.order-detail-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
}

.order-detail-title-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.order-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.order-detail-date {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.order-detail-status-badge {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.order-detail-status-badge.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.order-detail-status-badge.status-processing {
  background-color: #dbeafe;
  color: #1e40af;
}

.order-detail-status-badge.status-on-hold {
  background-color: #fce7f3;
  color: #9f1239;
}

.order-detail-status-badge.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.order-detail-status-badge.status-cancelled {
  background-color: #f3f4f6;
  color: #6b7280;
}

.order-detail-status-badge.status-refunded {
  background-color: #fce7f3;
  color: #9f1239;
}

.order-detail-status-badge.status-failed {
  background-color: #fee2e2;
  color: #991b1b;
}

.order-detail-status-badge.status-shipped {
  background-color: #e0f2fe;
  color: #0369a1;
}

.order-detail-section {
  margin-bottom: 32px;
}

.order-detail-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-detail-section-title i {
  color: #3b82f6;
  font-size: 18px;
}

.order-detail-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-detail-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: box-shadow 0.2s;
}

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

.order-detail-item-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.order-detail-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-detail-item-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-detail-item-name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  transition: color 0.2s;
}

.order-detail-item-name:hover {
  color: #3b82f6;
}

.order-detail-item-meta {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-detail-item-meta-line {
  line-height: 1.35;
}

.order-detail-item-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-item-price-regular {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: line-through;
}

.order-item-price-total {
  font-size: 18px;
  font-weight: 700;
  color: #00a650;
}

.order-detail-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.order-summary-row:last-child {
  border-bottom: none;
}

.order-summary-label {
  font-size: 15px;
  color: #6b7280;
}

.order-summary-value {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.order-discount {
  color: #00a650 !important;
}

.order-summary-total {
  padding-top: 16px;
  margin-top: 8px;
  border-top: 2px solid #e5e7eb;
}

.order-summary-total .order-summary-label {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.order-summary-total .order-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: #00a650;
}

.order-detail-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.order-detail-address {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.order-detail-contact {
  font-size: 14px;
  color: #374151;
  margin-top: 8px;
}

.order-detail-contact strong {
  font-weight: 600;
  color: #111827;
}

.order-detail-info-text {
  font-size: 15px;
  color: #374151;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.order-detail-tracking {
  margin-top: 12px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-detail-tracking-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.order-detail-tracking-code {
  font-size: 16px;
  color: #111827;
  word-break: break-word;
}

.order-pay-now-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 24px;
  background-color: #22c55e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.order-pay-now-btn:hover {
  background-color: #16a34a;
  color: #ffffff;
}

.order-pay-now-btn i {
  font-size: 16px;
}

.order-detail-note {
  font-size: 14px;
  color: #374151;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  line-height: 1.6;
}

.order-detail-note p {
  margin: 0;
}

.order-detail-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

.order-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.order-detail-btn i {
  font-size: 14px;
}

.order-detail-btn.btn-primary {
  background-color: #3b82f6;
  color: #ffffff;
  border: 2px solid #3b82f6;
}

.order-detail-btn.btn-primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.order-detail-btn.btn-secondary {
  background-color: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.order-detail-btn.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.order-error {
  padding: 20px;
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .order-detail-container {
    padding: 20px;
  }

  .order-detail-title-section {
    flex-direction: column;
    gap: 16px;
  }

  .order-detail-title {
    font-size: 22px;
  }

  .order-detail-item {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }

  .order-detail-item-image {
    width: 80px;
    height: 80px;
  }

  .order-detail-item-price {
    grid-column: 2;
    text-align: left;
    margin-top: 8px;
  }

  .order-detail-two-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .order-detail-actions {
    flex-direction: column;
  }

  .order-detail-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===================================
   ORDER MODAL
   =================================== */

.order-modal-overlay {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 999999;
  padding: 20px;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
  visibility: hidden;
  opacity: 0;
}

.order-modal-overlay.active {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  visibility: visible;
  opacity: 1;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.order-modal-container {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease;
  position: relative;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.order-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 2px solid #e5e7eb;
}

.order-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.order-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #6b7280;
  font-size: 20px;
}

.order-modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.order-modal-content {
  padding: 32px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.order-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.order-modal-loading i {
  font-size: 48px;
  color: #3b82f6;
}

.order-modal-loading p {
  font-size: 16px;
  color: #6b7280;
  margin: 0;
}

/* Override button styles for modal context */
.order-modal-overlay .view-order-btn {
  cursor: pointer;
  border: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .order-modal-overlay {
    padding: 0;
  }

  .order-modal-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    max-width: 100%;
  }

  .order-modal-header {
    padding: 20px;
  }

  .order-modal-title {
    font-size: 20px;
  }

  .order-modal-content {
    padding: 20px;
    max-height: none;
  }

  .order-modal-close {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* ── Detalhes de Pagamento (BACS / Multibanco) ── */
.order-payment-details {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.order-payment-details .payment-description {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.5;
}

.payment-bacs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.payment-bacs-table th,
.payment-bacs-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid #e8edf2;
}

.payment-bacs-table th {
    width: 110px;
    color: #64748b;
    font-weight: 500;
}

.payment-bacs-table td strong {
    color: #1e293b;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.payment-bacs-table tr:last-child th,
.payment-bacs-table tr:last-child td {
    border-bottom: none;
}

.order-payment-multibanco .payment-bacs-table td strong {
    font-size: 16px;
    letter-spacing: 0.05em;
}

.payment-instructions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.payment-instructions h2 {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}
