/**
 * HSE Market — Üye Paneli, Sipariş Takibi & Auth Stilleri
 * Modern E-Ticaret Arayüzü
 */

:root {
  --hse-primary: #0f172a;
  --hse-primary-hover: #1e293b;
  --hse-accent: #c9a227;
  --hse-accent-hover: #b08d20;
  --hse-success: #16a34a;
  --hse-warning: #d97706;
  --hse-danger: #dc2626;
  --hse-purple: #7c3aed;
  --hse-info: #0284c7;
  --hse-bg: #f8fafc;
  --hse-border: #e2e8f0;
  --hse-card-bg: #ffffff;
  --hse-text-main: #1e293b;
  --hse-text-muted: #64748b;
  --hse-radius-sm: 8px;
  --hse-radius-md: 12px;
  --hse-radius-lg: 16px;
  --hse-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
}

.hse-member-area {
  background-color: var(--hse-bg);
  min-height: 500px;
}

/* ── Sidebar & Navigasyon ─────────────────────────────────────── */
.hse-member-sidebar {
  position: sticky;
  top: 90px;
}

.hse-member-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--hse-card-bg);
  padding: 20px;
  border-radius: var(--hse-radius-md);
  box-shadow: var(--hse-shadow);
  margin-bottom: 16px;
  border: 1px solid var(--hse-border);
}

.hse-user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hse-primary), #334155);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.hse-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hse-user-greeting {
  font-size: 12px;
  color: var(--hse-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hse-user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--hse-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hse-user-email {
  font-size: 13px;
  color: var(--hse-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hse-member-nav {
  list-style: none;
  padding: 8px;
  margin: 0 0 16px;
  background: var(--hse-card-bg);
  border-radius: var(--hse-radius-md);
  box-shadow: var(--hse-shadow);
  border: 1px solid var(--hse-border);
}

.hse-member-nav li {
  margin-bottom: 4px;
}

.hse-member-nav li:last-child {
  margin-bottom: 0;
}

.hse-member-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--hse-text-main);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: var(--hse-radius-sm);
  transition: all 0.2s ease;
}

.hse-member-nav li a i {
  font-size: 18px;
  color: var(--hse-text-muted);
  transition: color 0.2s ease;
}

.hse-member-nav li a .hse-nav-active-arrow {
  margin-left: auto;
  font-size: 16px;
  color: var(--hse-accent);
}

.hse-member-nav li a:hover {
  background: #f1f5f9;
  color: var(--hse-primary);
}

.hse-member-nav li a:hover i {
  color: var(--hse-accent);
}

.hse-member-nav li a.active {
  background: #fffbeb;
  color: #92400e;
  font-weight: 600;
}

.hse-member-nav li a.active i {
  color: var(--hse-accent);
}

.hse-member-nav li a.hse-nav-logout {
  color: #b91c1c;
}

.hse-member-nav li a.hse-nav-logout:hover {
  background: #fef2f2;
}

.hse-sidebar-support {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 14px 18px;
  border-radius: var(--hse-radius-sm);
  font-size: 13px;
}

.hse-sidebar-support i {
  font-size: 24px;
  color: var(--hse-accent);
}

.hse-sidebar-support span {
  display: block;
  color: var(--hse-text-muted);
}

.hse-sidebar-support a {
  font-weight: 600;
  color: var(--hse-primary);
}

/* ── Kartlar & İçerik ─────────────────────────────────────────── */
.hse-member-card {
  background: var(--hse-card-bg);
  border-radius: var(--hse-radius-md);
  padding: 28px;
  box-shadow: var(--hse-shadow);
  border: 1px solid var(--hse-border);
  margin-bottom: 24px;
}

.hse-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.hse-card-header h2,
.hse-card-header h3,
.hse-card-header h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--hse-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hse-card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--hse-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hse-card-link:hover {
  color: var(--hse-accent-hover);
  text-decoration: underline;
}

.hse-card-link-sm {
  font-size: 13px;
  color: var(--hse-accent);
  font-weight: 600;
}

/* ── Hoş Geldiniz Afişi & İstatistikler ────────────────────────── */
.hse-welcome-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: var(--hse-radius-md);
  padding: 24px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
}

.hse-welcome-text h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.hse-welcome-text p {
  color: #cbd5e1;
  font-size: 14px;
  margin: 0;
  max-width: 540px;
}

.hse-member-type-badge {
  background: rgba(201, 162, 39, 0.2);
  border: 1px solid var(--hse-accent);
  color: #fef08a;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hse-stat-card {
  background: var(--hse-card-bg);
  border: 1px solid var(--hse-border);
  border-radius: var(--hse-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--hse-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hse-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -3px rgba(15, 23, 42, 0.08);
}

.hse-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.hse-stat-icon--primary { background: #eff6ff; color: #2563eb; }
.hse-stat-icon--warning { background: #fffbeb; color: #d97706; }
.hse-stat-icon--success { background: #f0fdf4; color: #16a34a; }

.hse-stat-info {
  display: flex;
  flex-direction: column;
}

.hse-stat-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--hse-primary);
  line-height: 1.1;
}

.hse-stat-label {
  font-size: 13px;
  color: var(--hse-text-muted);
  font-weight: 500;
}

/* ── Rozetler (Badges) ────────────────────────────────────────── */
.hse-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.hse-badge-primary  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.hse-badge-success  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.hse-badge-warning  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.hse-badge-danger   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.hse-badge-purple   { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.hse-badge-info     { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.hse-badge-default  { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ── Tablolar & Sipariş Listesi ───────────────────────────────── */
.hse-orders-table {
  width: 100%;
  margin-bottom: 0;
  vertical-align: middle;
}

.hse-orders-table thead th {
  background: #f8fafc;
  color: var(--hse-text-muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--hse-border);
  padding: 12px 14px;
}

.hse-orders-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.hse-order-code {
  font-family: monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--hse-primary);
  text-decoration: none;
}

.hse-order-code:hover {
  color: var(--hse-accent);
  text-decoration: underline;
}

.hse-date-cell {
  font-weight: 500;
  color: var(--hse-primary);
}

.hse-price-cell {
  font-weight: 700;
  color: var(--hse-primary);
}

.hse-btn-table {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #f1f5f9;
  color: var(--hse-primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--hse-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

/* ── Sipariş Detay Görünümü ──────────────────────────────────── */
.hse-order-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.hse-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--hse-text-muted);
  font-size: 14px;
  text-decoration: none;
}

.hse-back-link:hover {
  color: var(--hse-primary);
}

.hse-order-actions {
  display: flex;
  gap: 8px;
}

.hse-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--hse-border);
  background: #fff;
  border-radius: var(--hse-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--hse-text-main);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.hse-btn-action:hover {
  background: #f8fafc;
  color: var(--hse-primary);
}

.hse-btn-invoice {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.hse-btn-invoice:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

.hse-order-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: #f8fafc;
  border-radius: var(--hse-radius-sm);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.hse-order-header-box h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}

/* ── Sipariş Timeline ────────────────────────────────────────── */
.hse-order-timeline {
  display: flex;
  justify-content: space-between;
  margin: 28px 0;
  position: relative;
  padding: 0 20px;
}

.hse-order-timeline::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.hse-timeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90px;
}

.hse-timeline-bullet {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #cbd5e1;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.hse-timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hse-text-muted);
}

.hse-timeline-step.is-done .hse-timeline-bullet {
  background: var(--hse-success);
  border-color: var(--hse-success);
  color: #fff;
}

.hse-timeline-step.is-done .hse-timeline-title {
  color: var(--hse-primary);
}

.hse-timeline-step.is-current .hse-timeline-bullet {
  background: var(--hse-accent);
  border-color: var(--hse-accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2);
}

.hse-timeline-step.is-current .hse-timeline-title {
  color: var(--hse-accent);
  font-weight: 700;
}

/* ── Kargo Takip Kartı ───────────────────────────────────────── */
.hse-shipping-track-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--hse-radius-sm);
  padding: 18px 22px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hse-track-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.hse-track-body {
  flex: 1;
  min-width: 200px;
}

.hse-track-body strong {
  display: block;
  font-size: 15px;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.hse-track-body p {
  margin: 0;
  font-size: 14px;
  color: #1e40af;
}

.hse-track-body code {
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #1e3a8a;
}

.hse-track-btn-wrap .default-btn {
  padding: 10px 18px;
  font-size: 13.5px;
}

/* ── Sipariş Kalemleri Tablosu ───────────────────────────────── */
.hse-order-items-wrap {
  margin-bottom: 28px;
}

.hse-order-items-wrap h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hse-order-items-table {
  vertical-align: middle;
}

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

.hse-item-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--hse-border);
}

.hse-item-thumb-placeholder {
  width: 50px;
  height: 50px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 20px;
}

.hse-item-title {
  font-weight: 600;
  color: var(--hse-primary);
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.hse-item-variant {
  display: block;
  font-size: 12px;
  color: var(--hse-text-muted);
  margin-top: 2px;
}

.hse-address-box,
.hse-summary-box {
  background: #f8fafc;
  border: 1px solid var(--hse-border);
  border-radius: var(--hse-radius-sm);
  padding: 20px;
  height: 100%;
}

.hse-address-box h4,
.hse-summary-box h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hse-primary);
  border-bottom: 1px solid var(--hse-border);
  padding-bottom: 8px;
}

.hse-summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.hse-summary-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--hse-primary);
  border-top: 2px solid var(--hse-border);
  padding-top: 10px;
  margin-top: 12px;
}

/* ── Formlar & Fatura / Adres ────────────────────────────────── */
.hse-billing-type-box {
  background: #f8fafc;
  border: 1px solid var(--hse-border);
  border-radius: var(--hse-radius-sm);
  padding: 16px;
}

.hse-radio-group {
  display: flex;
  gap: 16px;
}

.hse-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 2px solid var(--hse-border);
  border-radius: var(--hse-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  user-select: none;
  flex: 1;
}

.hse-radio-label:has(input:checked) {
  border-color: var(--hse-accent);
  background: #fffbeb;
  color: #92400e;
}

.hse-member-notice {
  padding: 14px 18px;
  border-radius: var(--hse-radius-sm);
  font-size: 14.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hse-member-notice.hse-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.hse-member-notice.hse-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.hse-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--hse-text-muted);
}

.hse-empty-state i {
  font-size: 54px;
  color: #cbd5e1;
  margin-bottom: 12px;
  display: block;
}

/* ── Auth Sayfaları (Giriş / Kayıt) ──────────────────────────── */
.hse-auth-section {
  background: var(--hse-bg);
  min-height: calc(100vh - 280px);
}

.hse-auth-card {
  padding: 36px;
}

.hse-auth-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--hse-accent);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.hse-forgot-pw {
  font-size: 13px;
  color: var(--hse-accent);
  font-weight: 600;
}

@media (max-width: 991px) {
  .hse-member-sidebar {
    position: static;
    margin-bottom: 24px;
  }
}

@media (max-width: 767px) {
  .hse-order-timeline {
    flex-direction: column;
    gap: 16px;
    padding: 0;
  }
  .hse-order-timeline::before {
    display: none;
  }
  .hse-timeline-step {
    flex-direction: row;
    width: auto;
    gap: 12px;
    text-align: left;
  }
  .hse-timeline-bullet {
    margin-bottom: 0;
  }
  .hse-welcome-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hse-radio-group {
    flex-direction: column;
  }
}

/* ── Yazdırma (Print) Stilleri: Sadece Sipariş Fişi Yazdırılır ── */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body, html {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Bütün sayfayı gizle */
  body * {
    visibility: hidden !important;
  }

  /* Sadece sipariş detay kartı ve içindekiler görünsün */
  .hse-order-detail-card,
  .hse-order-detail-card * {
    visibility: visible !important;
  }

  .hse-order-detail-card {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  /* Kart içindeki aksiyon ve gezinti butonlarını gizle */
  .hse-order-detail-top,
  .hse-order-actions,
  .hse-back-link,
  .hse-order-timeline,
  .hse-track-btn-wrap,
  .hse-sidebar-support,
  #scroll-top {
    display: none !important;
    visibility: hidden !important;
  }

  /* Dış sayfa alanlarını tamamen kaldır */
  header,
  footer,
  .header-area,
  .top-header,
  .middle-header,
  .navbar-area,
  .footer-area,
  .copy-right-area,
  .page-title-area,
  .hse-member-sidebar,
  .col-lg-4,
  .col-md-5,
  .mobile-responsive-nav,
  .modal,
  nav,
  aside {
    display: none !important;
    visibility: hidden !important;
  }

  .hse-member-area,
  .dashboard-area {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .col-lg-8, .col-md-7, .col-lg-4, .col-md-5 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
  }

  .hse-member-card.hse-order-detail-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .hse-order-header-box {
    border: 1px solid #ccc !important;
    background: #fdfdfd !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
  }

  .hse-shipping-track-card {
    border: 1px solid #ddd !important;
    background: #fafafa !important;
    color: #000 !important;
    padding: 10px !important;
  }

  .hse-shipping-track-card strong,
  .hse-shipping-track-card p,
  .hse-shipping-track-card code {
    color: #000 !important;
  }

  .table-bordered,
  .table-bordered th,
  .table-bordered td {
    border: 1px solid #ddd !important;
  }

  .hse-order-items-table th {
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  .hse-address-box,
  .hse-summary-box {
    border: 1px solid #ddd !important;
    background: #fff !important;
    padding: 12px !important;
  }

  .hse-status-badge {
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    padding: 2px 8px !important;
    font-size: 10pt !important;
  }

  .table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  /* Sayfa kesilmesi önleme */
  .hse-order-items-wrap,
  .hse-order-footer-row {
    page-break-inside: avoid;
  }

  /* Yazdırma başlığı */
  .hse-order-header-box::before {
    content: 'HSE MARKET SİPARİŞ BİLGİ FORMU';
    display: block;
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
  }
}
