/* ============================================
   WALK Sportswear Returns & Exchanges
   Design system matching iOS app dark theme
   ============================================ */

:root {
  /* Colors — matching ThemeManager.swift */
  --bg-primary: #0D0D0D;
  --bg-secondary: #1A1A1A;
  --bg-tertiary: #2A2A2A;
  --text-primary: #FFFFFF;
  --text-secondary: #AAAAAA;
  --text-tertiary: #666666;
  --accent: #007AFF;
  --accent-pressed: #0051D5;
  --danger: #FF3B30;
  --success: #34C759;
  --warning: #FF9500;
  --separator: rgba(255, 255, 255, 0.08);
  --card-bg: #1A1A1A;
  --input-bg: #2A2A2A;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* RTL support */
[dir="rtl"] {
  --rtl-flip: scaleX(-1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ============================================
   SCREENS
   ============================================ */

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--safe-top) 0 var(--safe-bottom);
  animation: fadeIn 0.25s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

[dir="rtl"] .screen.active {
  animation: fadeInRTL 0.25s ease;
}

@keyframes fadeInRTL {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.logo {
  text-align: center;
  margin-bottom: 48px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 36px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
}

.logo-icon .logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 4px;
}

/* ============================================
   FORMS
   ============================================ */

.form {
  width: 100%;
  max-width: 360px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-group input,
.form-content input,
.form-content textarea,
.form-content select {
  width: 100%;
  padding: 16px;
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 17px;
  font-family: inherit;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.input-group input:focus,
.form-content input:focus,
.form-content textarea:focus,
.form-content select:focus {
  outline: none;
  border-color: var(--accent);
}

.input-group input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
}

.btn-primary:active {
  background: var(--accent-pressed);
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:active {
  background: var(--bg-secondary);
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 8px;
}

.text-btn:disabled {
  color: var(--text-tertiary);
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

/* Spinner */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.hidden {
  display: none !important;
}

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

/* ============================================
   OTP SCREEN
   ============================================ */

.otp-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.otp-container .back-btn {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  padding: 8px;
  cursor: pointer;
}

[dir="rtl"] .otp-container .back-btn {
  left: auto;
  right: 16px;
}

[dir="rtl"] .otp-container .back-btn svg {
  transform: scaleX(-1);
}

.otp-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.otp-inputs {
  display: flex;
  gap: 10px;
  margin: 32px 0;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: var(--input-bg);
  border: 2px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  -webkit-appearance: none;
  appearance: none;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--accent);
}

.otp-digit.filled {
  border-color: var(--accent);
}

/* ============================================
   NAV HEADER
   ============================================ */

.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.nav-header-left,
.nav-header-right {
  flex: 0 0 auto;
  min-width: 44px;
  display: flex;
  align-items: center;
}

.nav-header-right {
  justify-content: flex-end;
}

.nav-header h2 {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

[dir="rtl"] .nav-header h2 {
  direction: rtl;
}

.nav-header .back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
}

.nav-header .back-btn svg {
  flex: 0 0 auto;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.icon-btn:active {
  opacity: 0.6;
}

/* ============================================
   ORDERS LIST
   ============================================ */

.orders-list {
  padding: 16px;
}

.order-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid var(--separator);
}

.order-card:active {
  transform: scale(0.98);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.order-card-title {
  font-size: 16px;
  font-weight: 700;
}

.order-card-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.order-card-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.order-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
}

.order-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-tertiary);
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.return-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent);
}

.return-badge.expired {
  background: rgba(102, 102, 102, 0.15);
  color: var(--text-tertiary);
}

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

.order-detail-content {
  padding: 16px;
}

.detail-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--separator);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--separator);
}

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

.detail-label {
  color: var(--text-secondary);
  font-size: 15px;
}

.detail-value {
  font-size: 15px;
  font-weight: 500;
}

.detail-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.detail-item-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
  flex-shrink: 0;
}

.detail-item-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.detail-item-info {
  flex: 1;
}

.detail-item-title {
  font-size: 15px;
  font-weight: 600;
}

.detail-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-item-price {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================
   ACTION CARDS
   ============================================ */

.action-container {
  padding: 24px 16px;
}

.action-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 20px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
}

[dir="rtl"] .action-card {
  text-align: right;
}

.action-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-info {
  flex: 1;
}

.action-info h3 {
  font-size: 18px;
  font-weight: 700;
}

.action-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

.action-arrow {
  font-size: 22px;
  color: var(--text-tertiary);
  transform: var(--rtl-flip, none);
}

/* ============================================
   SELECT ITEMS
   ============================================ */

.select-items-content {
  padding: 16px;
  padding-bottom: 100px;
}

.selectable-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.selectable-item.selected {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.08);
}

.selectable-item:active {
  transform: scale(0.98);
}

.selectable-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.selectable-item.selected .selectable-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.selectable-checkbox::after {
  content: '\2713';
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
}

.selectable-item.selected .selectable-checkbox::after {
  opacity: 1;
}

.selectable-item-image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
  flex-shrink: 0;
}

.selectable-item-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.selectable-item-info {
  flex: 1;
}

.selectable-item-title {
  font-size: 15px;
  font-weight: 600;
}

.selectable-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.selectable-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:disabled {
  opacity: 0.3;
}

.qty-value {
  font-size: 15px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

/* ============================================
   FORM CONTENT
   ============================================ */

.form-content {
  padding: 16px;
  padding-bottom: 120px;
}

.form-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--separator);
}

.form-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.reason-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reason-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s;
}

.reason-option.selected {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.08);
}

.reason-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-tertiary);
  flex-shrink: 0;
  transition: all 0.15s;
}

.reason-option.selected .reason-radio {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg-primary);
}

.reason-label {
  font-size: 15px;
}

.form-content textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.form-content select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23AAAAAA' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

[dir="rtl"] .form-content select {
  background-position: left 16px center;
  padding-right: 16px;
  padding-left: 40px;
}

/* Exchange variant selector */
.exchange-item {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.exchange-item-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.exchange-item-image {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
}

.exchange-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-tertiary);
}

.exchange-item-title {
  font-size: 14px;
  font-weight: 600;
}

.exchange-item-current {
  font-size: 12px;
  color: var(--text-secondary);
}

.exchange-selector-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ============================================
   BOTTOM BAR
   ============================================ */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--separator);
  z-index: 100;
}

.delivery-fee-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.delivery-fee-info span:last-child {
  font-weight: 700;
  color: var(--text-primary);
}

.exchange-bar-info {
  margin-bottom: 8px;
}

.exchange-bar-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

.exchange-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 2px 0;
}

.exchange-bar-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 0.5px solid var(--separator);
  margin-top: 4px;
  padding-top: 6px;
}

/* ============================================
   SUCCESS SCREEN
   ============================================ */

.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  color: var(--bg-primary);
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.success-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-container p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 320px;
}

.success-details {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--separator);
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.success-detail-row .label {
  color: var(--text-secondary);
}

.success-detail-row .value {
  font-weight: 600;
}

.success-container .btn-primary {
  max-width: 360px;
}

/* ============================================
   REQUESTS LIST
   ============================================ */

.requests-list {
  padding: 16px;
}

.request-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--separator);
}

.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.request-type-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.request-type-badge.return {
  background: rgba(255, 59, 48, 0.15);
  color: var(--danger);
}

.request-type-badge.exchange {
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent);
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-badge.pending, .status-badge.submitted {
  background: rgba(255, 149, 0, 0.15);
  color: var(--warning);
}

.status-badge.completed, .status-badge.approved {
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
}

.status-badge.rejected {
  background: rgba(255, 59, 48, 0.15);
  color: var(--danger);
}

.request-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.request-card-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.request-card-items {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid var(--separator);
}

.request-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}

.request-item-name {
  color: var(--text-secondary);
}

.request-item-reason {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 40px auto;
}

.loading-spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 15px;
}

/* Processing screen */
.processing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
}

.processing-container h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 8px;
}

.processing-container p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow);
  max-width: 90%;
  text-align: center;
  animation: toastIn 0.3s ease;
  border: 1px solid var(--separator);
}

.toast.error {
  background: rgba(255, 59, 48, 0.9);
}

.toast.success {
  background: rgba(52, 199, 89, 0.9);
  color: var(--bg-primary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   ACTION BUTTONS (order detail)
   ============================================ */

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ============================================
   UNIFIED ITEMS (return/exchange screens)
   ============================================ */

.unified-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unified-item {
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s;
}

.unified-item.selected {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.06);
}

.unified-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.unified-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.unified-item.selected .unified-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.unified-checkbox::after {
  content: '\2713';
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
}

.unified-item.selected .unified-checkbox::after {
  opacity: 1;
}

.unified-item-info {
  flex: 1;
  min-width: 0;
}

.unified-item-title {
  font-size: 15px;
  font-weight: 600;
}

.unified-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.unified-item-price {
  font-size: 13px;
  color: var(--text-tertiary);
}

.unified-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.unified-reasons,
.unified-details {
  padding: 0 12px 12px;
  border-top: 0.5px solid var(--separator);
  margin-top: 4px;
}

.unified-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0 8px;
  font-weight: 600;
}

/* Reason dropdown */
.form-content .reason-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background-color: var(--bg-tertiary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23AAAAAA' d='M5 7.5L0.5 3h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
}

.form-content .reason-select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-content .reason-select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
}

[dir="rtl"] .form-content .reason-select {
  background-position: left 14px center;
  padding-right: 14px;
  padding-left: 36px;
}

/* Reason chips */
.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-chip {
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.reason-chip.selected {
  background: rgba(0, 122, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Option chips (size/color pickers) */
.option-group {
  margin-bottom: 4px;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  min-width: 35px;
  justify-content: center;
}

.option-chip.selected {
  background: rgba(0, 122, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.option-chip.selected .color-swatch {
  box-shadow: inset 0 0 0 2px var(--bg-primary), 0 0 0 1px var(--accent);
}

.option-chip.color-chip {
  padding: 4px;
  min-width: auto;
  gap: 0;
}

.option-chip.color-chip::after {
  content: attr(data-option-value);
  font-size: 12px;
  margin-left: 6px;
  display: none;
}

.option-chip.color-chip.selected::after {
  display: inline;
}

/* ============================================
   NEW ITEM SEARCH (exchange screen)
   ============================================ */

.text-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.text-input::placeholder {
  color: var(--text-tertiary);
}

.new-item-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-item-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s;
}

.new-item-result:active {
  border-color: var(--accent);
}

.new-item-image {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
  flex-shrink: 0;
}

.new-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.new-item-info {
  flex: 1;
  min-width: 0;
}

.new-item-title {
  font-size: 14px;
  font-weight: 600;
}

.new-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.new-item-price {
  font-size: 13px;
  color: var(--text-tertiary);
}

.new-item-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 16px;
}

.new-item-picker {
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 14px;
}

.new-item-picker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.new-item-picker-header .new-item-title {
  font-size: 15px;
}

.new-item-qty {
  margin-top: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.new-items-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-item-added {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.3);
  border-radius: var(--radius-md);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

/* ============================================
   EXCHANGE SUMMARY MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--separator);
  border-bottom: none;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 0.5px solid var(--separator);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.summary-section {
  margin-bottom: 16px;
}

.summary-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--input-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
}

.summary-item-image {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  object-fit: cover;
  flex-shrink: 0;
}

.summary-item-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.summary-item-info {
  flex: 1;
  min-width: 0;
}

.summary-item-title {
  font-size: 14px;
  font-weight: 600;
}

.summary-item-variant {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.summary-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 16px;
  background: var(--input-bg);
  border: 1px dashed var(--separator);
  border-radius: var(--radius-md);
}

.summary-totals {
  border-top: 0.5px solid var(--separator);
  padding-top: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.summary-row.total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 0.5px solid var(--separator);
  margin-top: 6px;
  padding-top: 12px;
}

.summary-row.total span:last-child {
  color: var(--accent);
}

.modal-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  border-top: 0.5px solid var(--separator);
}

/* ============================================
   FOOTER NOTE
   ============================================ */

.footer-note {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  margin-top: 24px;
  max-width: 320px;
}

/* ============================================
   VARIANT IMAGE PREVIEW (exchange items)
   ============================================ */

.variant-image-preview {
  margin-top: 12px;
  text-align: center;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-preview-image {
  width: 100%;
  max-width: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  transition: opacity 0.15s ease;
}

/* ============================================
   PRODUCT BROWSER MODAL
   ============================================ */

.pb-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.pb-categories::-webkit-scrollbar {
  height: 3px;
}

.pb-categories::-webkit-scrollbar-thumb {
  background: var(--separator);
  border-radius: 2px;
}

.pb-cat-card {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.pb-cat-card:active {
  transform: scale(0.96);
}

.pb-cat-card.active {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.1);
}

.pb-cat-image {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.pb-cat-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.pb-cat-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-browser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pb-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.pb-card-image-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.pb-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s;
}

.pb-card-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.pb-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pb-card-price {
  font-size: 12px;
  color: var(--text-secondary);
}

.pb-card-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pb-card-options .option-group {
  margin-bottom: 0;
}

.pb-card-options .option-chips {
  gap: 5px;
}

.pb-card-qty {
  display: flex;
  justify-content: center;
}

.pb-card-add {
  padding: 10px;
  font-size: 13px;
  min-height: auto;
}

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */

.lang-toggle-inline {
  background: rgba(255,255,255,0.1);
  border: 0.5px solid var(--separator);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.lang-toggle-inline:active {
  opacity: 0.7;
}

.lang-toggle-floating {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: 16px;
  z-index: 200;
  background: rgba(255,255,255,0.1);
  border: 0.5px solid var(--separator);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
}

.lang-toggle-floating:active {
  opacity: 0.7;
}

.lang-toggle-right {
  left: auto;
  right: 16px;
}

/* ============================================
   RTL OVERRIDES
   ============================================ */

/* Keep all inputs LTR — emails, codes, and search queries are always LTR */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] .otp-inputs {
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .lang-toggle-floating {
  left: auto;
  right: 16px;
}

[dir="rtl"] .lang-toggle-right {
  right: auto;
  left: 16px;
}

[dir="rtl"] .order-card-footer {
  flex-direction: row-reverse;
}

[dir="rtl"] .detail-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .summary-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .summary-row.total {
  flex-direction: row-reverse;
}

[dir="rtl"] .exchange-bar-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .unified-item-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .unified-item-info {
  text-align: right;
}

[dir="rtl"] .detail-item-info {
  text-align: right;
}

[dir="rtl"] .new-item-info {
  text-align: right;
}

[dir="rtl"] .summary-item-info {
  text-align: right;
}

[dir="rtl"] .success-detail-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .request-card-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .request-item-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .qty-control {
  flex-direction: row-reverse;
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}

[dir="rtl"] .remove-item-btn {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .pb-cat-card {
  text-align: right;
}

[dir="rtl"] .pb-card {
  text-align: right;
}

[dir="rtl"] .toast {
  direction: rtl;
}
