/**
 * Order Confirmation Styles
 */

.seecommerce-confirmation {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 20px;
}

@media (max-width: 640px) {
  .seecommerce-confirmation {
    margin: 16px auto;
    padding: 0 16px;
  }
}

.confirmation-wrapper {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 32px;
}

@media (max-width: 1024px) {
  .confirmation-wrapper {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .confirmation-wrapper {
    padding: 20px;
  }
}

.confirmation-wrapper.loading,
.confirmation-wrapper.error {
  text-align: center;
  padding: 80px 20px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

/* Header */
.confirmation-header {
  text-align: center;
  padding: 48px 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 48px;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: #059669;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: bold;
}

.confirmation-header h1 {
  margin: 0 0 16px;
  font-size: 36px;
  font-weight: 700;
  color: #111827;
}

.confirmation-message {
  margin: 0;
  font-size: 18px;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
}

/* Content Layout */
.confirmation-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 1024px) {
  .confirmation-content {
    grid-template-columns: 1fr;
  }

  .order-summary {
    order: -1;
  }
}

/* Info Section */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
}

.info-card h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item .label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

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

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

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

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

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

.status-badge.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Address */
.address p {
  margin: 0 0 4px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.address p strong {
  color: #111827;
}

/* Order Summary */
.order-summary {
  position: sticky;
  top: 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  height: fit-content;
}

.order-summary h2 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

/* Order Items */
.order-items {
  margin-bottom: 24px;
}

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

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

.item-info {
  flex: 1;
}

.item-info h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.item-meta {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.item-total {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

/* Order Totals */
.order-totals {
  padding-top: 16px;
  border-top: 2px solid #e5e7eb;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #6b7280;
}

.total-row.grand-total {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* Actions */
.confirmation-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 32px 0;
  border-top: 2px solid #e5e7eb;
}

.seecommerce-btn-outline {
  background: #fff;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.seecommerce-btn-outline:hover {
  background: #eff6ff;
}

/* =====================================================
   PRINT STYLES - FRONTEND ORDER CONFIRMATION
   ===================================================== */
@media print {
  /* Hide all non-content elements */
  #wpadminbar,
  #adminmenumain,
  #wpfooter,
  .confirmation-actions,
  .seecommerce-btn,
  .seecommerce-btn-outline,
  nav,
  header.site-header,
  footer.site-footer {
    display: none !important;
  }

  /* Page setup */
  @page {
    margin: 1cm;
  }

  /* Complete reset */
  * {
    box-sizing: border-box !important;
  }

  html,
  body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide all, show only confirmation */
  body * {
    visibility: hidden;
  }

  .seecommerce-confirmation,
  .seecommerce-confirmation * {
    visibility: visible;
  }

  /* Main container */
  .seecommerce-confirmation {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
  }

  /* Header */
  .confirmation-header {
    text-align: center !important;
    padding: 0 0 10px 0 !important;
    margin: 0 0 20px 0 !important;
    border-bottom: 2px solid #000 !important;
  }

  .confirmation-header h1 {
    font-size: 24px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #000 !important;
  }

  .confirmation-message,
  .success-icon {
    display: none !important;
  }

  /* Content wrapper - Use Grid */
  .confirmation-content {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 0 !important;
    width: 100% !important;
  }

  /* Info section - Use display: contents to make cards direct grid children */
  .info-section {
    display: contents !important;
  }

  /* Card 1: Order Details - Position: Row 1, Col 1 */
  .info-section .info-card:nth-child(1) {
    grid-row: 1 !important;
    grid-column: 1 !important;
    margin: 0 0.75rem 0 0 !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  /* Rename "Order Details" to "Order Detail" */
  .info-section .info-card:nth-child(1) h2 {
    font-size: 0 !important;
  }

  .info-section .info-card:nth-child(1) h2::after {
    content: "Order Detail" !important;
    font-size: 14px !important;
  }

  /* Card 2: Shipping Address - Position: Row 1, Col 3 (Right) */
  .info-section .info-card:nth-child(2) {
    grid-row: 1 !important;
    grid-column: 3 !important;
    margin: 0 0 0 0.75rem !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  /* Card 3: Billing Address - Position: Row 1, Col 2 (Middle) */
  .info-section .info-card:nth-child(3) {
    grid-row: 1 !important;
    grid-column: 2 !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  /* Order Summary - Position: Row 2, Span all 3 columns */
  .order-summary {
    grid-row: 2 !important;
    grid-column: 1 / 4 !important;
    margin: 15px 0 0 0 !important;
    padding: 15px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    position: static !important;
  }

  /* Card titles */
  .info-card h2,
  .order-summary h2 {
    margin: 0 0 10px 0 !important;
    padding: 0 0 6px 0 !important;
    border-bottom: 2px solid #000 !important;
    color: #000 !important;
    font-weight: 600 !important;
  }

  .info-card h2 {
    font-size: 14px !important;
  }

  .order-summary h2 {
    font-size: 16px !important;
  }

  /* Info items */
  .info-grid {
    display: block !important;
  }

  .info-item {
    margin: 0 0 10px 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid #ddd !important;
  }

  .info-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }

  .info-item .label {
    display: block !important;
    font-size: 11px !important;
    color: #666 !important;
    margin: 0 0 3px 0 !important;
  }

  .info-item .value {
    display: block !important;
    font-size: 13px !important;
    color: #000 !important;
    font-weight: 600 !important;
  }

  /* Address */
  .address p {
    margin: 0 0 4px 0 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    color: #000 !important;
  }

  /* Order items table */
  .order-items {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 15px !important;
  }

  .order-item {
    display: table-row !important;
  }

  .order-item .item-info,
  .order-item .item-total {
    display: table-cell !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    vertical-align: top !important;
  }

  .order-item .item-info h3 {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 0 4px 0 !important;
    color: #000 !important;
  }

  .order-item .item-meta {
    font-size: 12px !important;
    color: #666 !important;
    margin: 0 !important;
  }

  .order-item .item-total {
    text-align: right !important;
    font-weight: 600 !important;
    width: 120px !important;
    white-space: nowrap !important;
    color: #000 !important;
  }

  /* Order totals */
  .order-totals {
    border-top: 2px solid #000 !important;
    padding-top: 8px !important;
  }

  .total-row {
    display: flex !important;
    justify-content: space-between !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    color: #000 !important;
  }

  .total-row span {
    color: #000 !important;
  }

  .total-row span:last-child {
    min-width: 120px !important;
    text-align: right !important;
  }

  .total-row.grand-total {
    border-top: 2px solid #000 !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  /* Status badges */
  .status-badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Customer Notes */
.customer-note {
  background: #f9fafb;
  border-left: 4px solid #2563eb;
  padding: 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.customer-note p {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}
