/* ==============================================================================
   Roopb / Kito Super App - Customer Purchases Styles
   Matches iOS PurchaseList.swift & PurchaseCardView.swift
   ============================================================================== */

.pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1020;
  background: var(--surface, #FAF9F6);
  color: var(--text, #1E2022);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .pc-overlay {
  background: #0D0F12;
  color: #F1F5F9;
}

/* Sticky Navigation Bar */
.pc-nav-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pc-nav-bar {
  background: rgba(13, 15, 18, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pc-nav-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pc-container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Purchase Card matching iOS PurchaseCardView */
.pc-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="dark"] .pc-card {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.35);
}

/* Header */
.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pc-store-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-store-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pc-store-meta {
  display: flex;
  flex-direction: column;
}

.pc-store-name {
  font-size: 15px;
  font-weight: 700;
}

.pc-order-sub {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status Badges matching iOS Purchase */
.pc-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pc-badge.badge-preparing {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.pc-badge.badge-transit {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.pc-badge.badge-delivered {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.pc-badge.badge-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Main Item Row */
.pc-main-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 14px;
}

[data-theme="dark"] .pc-main-row {
  background: rgba(255, 255, 255, 0.03);
}

.pc-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.pc-main-details {
  flex: 1;
}

.pc-main-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.pc-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .pc-total-row {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.pc-total-amount {
  font-size: 16px;
  font-weight: 800;
}

/* Expanded Sub-Items List */
.pc-sub-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .pc-sub-items {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.pc-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

/* Track Pill Button on Purchase Card (matches iOS Liquid Glass Pill) */
.pc-track-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pc-track-pill:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-1px);
}

[data-theme="dark"] .pc-track-pill {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Help / Support & Return Button */
.pc-help-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.pc-help-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

[data-theme="dark"] .pc-help-btn {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

/* ==============================================================================
   ORDER TRACKING FULL SCREEN MODAL & CARDS (Matches iOS PurchaseTracking.swift)
   ============================================================================== */

.pc-tracking-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: var(--surface, #FAF9F6);
  color: var(--text, #1E2022);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .pc-tracking-overlay {
  background: #0D0F12;
  color: #F1F5F9;
}

.pc-tracking-container {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 1. Hero Map Ambient Glow Card (PurchaseHeroMapView.swift) */
.pt-hero-card {
  position: relative;
  height: 140px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14) 0%, rgba(59, 130, 246, 0.10) 50%, rgba(20, 184, 166, 0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.15);
  box-shadow: 0 4px 20px -4px rgba(168, 85, 247, 0.08);
}

[data-theme="dark"] .pt-hero-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(59, 130, 246, 0.14) 50%, rgba(20, 184, 166, 0.12) 100%);
  border-color: rgba(168, 85, 247, 0.25);
}

.pt-glow-orb {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(59, 130, 246, 0) 70%);
  filter: blur(28px);
  animation: ptOrbPulse 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ptOrbPulse {
  0% { transform: scale(0.9) translate(-20px, -10px); opacity: 0.7; }
  100% { transform: scale(1.15) translate(10px, 10px); opacity: 1; }
}

.pt-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  max-width: 90%;
  width: 100%;
}

[data-theme="dark"] .pt-hero-inner {
  background: rgba(21, 24, 30, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
}

.pt-hero-pin-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.pt-hero-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.35;
}

/* 2. Glass Cards (Package Card & Timeline Card) */
.pt-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

[data-theme="dark"] .pt-card {
  background: #15181E;
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.35);
}

/* Package Card Header */
.pt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.pt-card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #10b981;
  text-transform: uppercase;
}

.pt-chevron {
  color: #64748b;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pt-chevron.expanded {
  transform: rotate(0deg);
}

.pt-chevron:not(.expanded) {
  transform: rotate(180deg);
}

/* Package Items List */
.pt-package-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.pt-package-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pt-item-thumb-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .pt-item-thumb-box {
  background: rgba(255, 255, 255, 0.05);
}

.pt-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pt-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pt-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-item-variant {
  font-size: 11.5px;
  font-weight: 600;
  color: #10b981;
}

.pt-item-qty {
  font-size: 12px;
  color: #64748b;
}

.pt-item-price {
  font-size: 14px;
  font-weight: 700;
}

.pt-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

[data-theme="dark"] .pt-divider {
  background: rgba(255, 255, 255, 0.07);
}

/* Meta Rows (Tracking number, Shipping method) */
.pt-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.pt-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.pt-meta-label {
  color: #64748b;
}

.pt-meta-value-group {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pt-meta-value {
  font-weight: 600;
  color: var(--text);
}

.pt-copy-btn {
  background: none;
  border: none;
  padding: 2px;
  color: #10b981;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* 3. Timeline Card Styles */
.pt-timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pt-timeline-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #10b981;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pt-timeline-headline {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pt-shipping-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pt-shipping-badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

/* Timeline Vertical Steps */
.pt-timeline-steps {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.pt-step-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.pt-step-indicator-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
}

.pt-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  transition: all 0.3s ease;
  z-index: 2;
}

[data-theme="dark"] .pt-step-circle {
  background: #1e2430;
  color: #64748b;
}

.pt-step-circle.completed {
  background: #10b981;
  color: #ffffff;
}

.pt-step-circle.current {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.pt-step-line {
  width: 3px;
  height: 52px;
  background: #e2e8f0;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 2px;
}

[data-theme="dark"] .pt-step-line {
  background: #2a3241;
}

.pt-step-line.completed {
  background: #10b981;
}

.pt-step-content {
  flex: 1;
  padding-top: 4px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pt-step-headline-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pt-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #94a3b8;
}

.pt-step-title.active {
  color: var(--text);
}

.pt-step-date {
  font-size: 11.5px;
  color: #64748b;
}

.pt-step-location {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.pt-step-location.highlight {
  color: #10b981;
}

.pt-step-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  margin-top: 1px;
}

.pt-step-desc.dimmed {
  opacity: 0.55;
}


