/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #0c3560;
  --primary-dark: #082747;
  --primary-light: #dbeafe;
  --accent: #ff8c1a;
  --accent-light: #fff3e6;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --header-h: 44px;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

/* ===== App Structure ===== */
#app { min-height: 100vh; position: relative; }

.page { display: none; min-height: 100vh; }
.page.active { display: block; }

.view { display: none; padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 20px); }
.view.active { display: block; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
}

.header-left { flex: 1; display: flex; align-items: center; min-width: 0; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-shrink: 0; }
.logo-mini {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.logo-mini-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.header-brand {
  font-weight: 600;
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  position: relative;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { background: var(--border-light); }

/* ===== Language Switcher (top-right corner) ===== */
.lang-switcher { position: relative; z-index: 60; }
.lang-btn {
  display: flex; align-items: center; gap: 4px;
  height: 34px; padding: 0 8px;
  border-radius: 17px;
  background: var(--border-light);
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.lang-btn .lang-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
}
.lang-btn .lang-name { display: none; }
@media (min-width: 480px) { .lang-btn .lang-name { display: inline; } }
.lang-btn:active { background: var(--border); }

/* Backdrop behind the dropdown for clearer mobile interaction */
.lang-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 150;
  display: none;
}
.lang-backdrop.show { display: block; }

/* Dropdown: compact popover anchored right below the language button.
   Position is set inline by JS (position: fixed) so it escapes any
   parent stacking context and always appears neatly under the button. */
.lang-dropdown {
  position: fixed;
  min-width: 180px;
  width: max-content;
  max-width: calc(100vw - 20px);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 10000;
  /* Only scroll internally if the screen is really tiny */
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  display: none;
}
.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: #fff; color: var(--ink);
  font-size: 14px; text-align: left;
  border-bottom: 1px solid var(--bg);
}
.lang-option:last-child { border-bottom: none; }
.lang-option:active, .lang-option:hover { background: var(--bg); }
.lang-option.active { background: #eff6ff; color: var(--primary); }
.lang-option .lang-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.lang-option .lang-name { flex: 1; }
.lang-option .lang-check { color: var(--primary); font-weight: 700; }

/* RTL support for Hebrew */
html[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
html[dir="rtl"] .header-left { text-align: right; }
html[dir="rtl"] .header-right { justify-content: flex-start; }
html[dir="rtl"] .back-btn svg { transform: scaleX(-1); }

.notification-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 14px; height: 14px;
  background: var(--danger);
  color: white;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.app-content { min-height: calc(100vh - var(--header-h)); }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding-bottom: 8px;
  height: 100%;
  transition: color 0.2s;
}
.nav-btn.active { color: var(--primary); }
.nav-btn:active { opacity: 0.7; }

.nav-btn.nav-center {
  position: relative;
  padding-bottom: 0;
}
.nav-center-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  margin-bottom: 4px;
  position: relative;
  top: -20px;
}
.nav-btn.nav-center span {
  position: relative;
  top: -16px;
}

/* ===== Login Page ===== */
#page-login {
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 100%);
  min-height: 100vh;
  padding: 20px;
}
#page-login.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page {
  background: #ffffff;
  min-height: 100vh;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
}
.login-logo-img {
  width: 160px;
  height: auto;
  mix-blend-mode: multiply;
  display: block;
}

.login-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.form-group label .required { color: var(--danger); }
.form-group label .hint { color: var(--muted); font-weight: 400; font-size: 12px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}
.form-group textarea { resize: vertical; min-height: 60px; }

.login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 18px;
}

.login-demo {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:active { opacity: 0.9; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.link-btn {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
}

/* ===== Home Page ===== */
.welcome-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px 20px;
  margin: 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.welcome-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.welcome-card h2 span { font-weight: 700; }
.welcome-card p {
  opacity: 0.9;
  font-size: 13px;
}

.quick-actions {
  padding: 0 16px 8px;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  transition: transform 0.15s;
}
.action-card:active { transform: scale(0.95); }

.action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-green { background: #d1fae5; color: #059669; }
.icon-orange { background: #fef3c7; color: #d97706; }
.icon-purple { background: #ede9fe; color: #7c3aed; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 16px 16px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.stat-card.clickable {
  cursor: pointer;
}
.stat-card.clickable:active {
  transform: scale(0.95);
}
.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 12px;
}
.section-header h3 {
  font-size: 16px;
  font-weight: 700;
}

/* ===== Orders List ===== */
.orders-list {
  padding: 0 16px;
}

.order-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.order-no {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.order-date {
  font-size: 12px;
  color: var(--muted);
}

.order-card-body {
  display: flex;
  gap: 12px;
}
.order-product-img {
  width: 60px; height: 60px;
  border-radius: 8px;
  background: var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.order-product-info {
  flex: 1;
  min-width: 0;
}
.order-product-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.order-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #d1fae5; color: #065f46; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
}
.page-header h2 {
  font-size: 17px;
  font-weight: 700;
}
.back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
}
.back-btn:active { background: var(--border-light); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state p { font-size: 14px; }

/* ===== Inquiry Types ===== */
.inquiry-limit-bar {
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inquiry-limit-bar strong {
  color: var(--primary);
  font-weight: 600;
}

.inquiry-types {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}
.type-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== Forms ===== */
.form-card {
  padding: 16px;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.upload-area:active { border-color: var(--primary); }
.upload-placeholder {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-placeholder p { font-size: 13px; }

.upload-preview {
  position: relative;
  display: inline-block;
}
.upload-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
}
.remove-img {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

/* ===== Search & Filters ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  outline: none;
  font-size: 14px;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar svg { color: var(--muted); flex-shrink: 0; }

/* Product type tabs (Exclusive / Recommended) */
.product-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.type-tab {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 2px solid transparent;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.type-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
}
.type-tab-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.type-tab.active .type-tab-label {
  color: var(--primary);
}
.type-tab-desc {
  font-size: 11px;
  color: var(--muted);
}

.category-tabs,
.status-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar,
.status-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tab-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.page-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.page-btn:active { background: var(--border-light); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info {
  font-size: 13px;
  color: var(--muted);
}

.country-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.country-selector label { color: var(--muted); }
.country-selector select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
  outline: none;
}

/* ===== Products Grid ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.product-card:active { transform: scale(0.97); }

.product-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border-light);
  object-fit: cover;
  /* allow vertical scroll to start immediately even when gesture begins on the image */
  touch-action: pan-y;
  pointer-events: none;
}
.product-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}

.product-info {
  padding: 10px;
}
.product-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 38px;
}
.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.product-price-range {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.product-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ===== Product Detail ===== */
.product-detail-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border-light);
  object-fit: cover;
  /* allow the page to scroll smoothly past the large image on mobile */
  touch-action: pan-y;
  pointer-events: none;
}

.product-detail-body {
  padding: 16px;
}
.product-detail-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.product-detail-desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.price-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.country-price-list {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.country-price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}
.country-price-item:last-child { border-bottom: none; }
.country-name { font-weight: 500; font-size: 14px; }
.country-price-amount { font-weight: 700; color: var(--primary); }

.product-material-note {
  background: #eff6ff;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.product-material-note strong { display: block; margin-bottom: 4px; }

.order-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}
.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-value {
  font-size: 16px;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.total-label { font-weight: 600; }
.total-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.bottom-action-bar {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 90;
  display: flex;
  gap: 10px;
}
.bottom-action-bar .btn { flex: 1; }

/* Extra bottom padding for views with bottom action bar */
.view.has-action-bar {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 80px);
}

/* ===== Order Detail ===== */
.order-detail-status {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 20px 16px;
}
.order-detail-status h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.order-detail-status p {
  opacity: 0.9;
  font-size: 13px;
}

.detail-section {
  background: var(--bg-card);
  margin: 12px 16px;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.detail-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.detail-row .label { color: var(--muted); }
.detail-row .value { font-weight: 500; text-align: right; }

.tracking-info {
  background: #d1fae5;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}
.tracking-info strong { color: #065f46; display: block; margin-bottom: 4px; }
.tracking-number { font-family: monospace; font-size: 16px; font-weight: 700; color: #065f46; }

.order-item-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.order-item-row:last-child { border-bottom: none; }
.order-item-img {
  width: 50px; height: 50px;
  border-radius: 6px;
  background: var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.order-item-info { flex: 1; }
.order-item-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.order-item-price { font-size: 13px; color: var(--primary); font-weight: 600; }
.order-item-qty { font-size: 12px; color: var(--muted); }

/* ===== Invoices ===== */
.invoices-list { padding: 12px 16px; }

.invoice-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.invoice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.invoice-no { font-size: 14px; font-weight: 700; }
.invoice-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.invoice-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.invoice-status-pending { color: var(--warning) !important; }
.invoice-status-paid { color: var(--success) !important; }
.invoice-status-cancelled { color: var(--danger) !important; }

/* ===== Inquiries List ===== */
.inquiries-list { padding: 12px 16px; }

.inquiry-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.inquiry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.inquiry-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inquiry-card-body {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.inquiry-img {
  width: 60px; height: 60px;
  border-radius: 8px;
  background: var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.inquiry-info { flex: 1; min-width: 0; }
.inquiry-desc {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}
.inquiry-country {
  font-size: 12px;
  color: var(--muted);
}
.inquiry-quote {
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.inquiry-quote-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

/* ===== Inquiry Detail ===== */
.inquiry-detail-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: var(--border-light);
}

.quote-section {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
}
.quote-section h4 {
  color: #065f46;
  font-size: 14px;
  margin-bottom: 10px;
}
.quote-price-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: #065f46;
}
.quote-total {
  font-size: 20px;
  font-weight: 700;
  color: #065f46;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(6, 95, 70, 0.2);
}
.quote-notes {
  font-size: 13px;
  color: #047857;
  margin-top: 8px;
  font-style: italic;
}

.reject-section {
  background: #fee2e2;
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
  color: #991b1b;
}
.reject-section h4 { margin-bottom: 8px; }

/* ===== Notifications ===== */
.notifications-list { padding: 8px 0; }

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}
.notification-item.unread { background: #eff6ff; }
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-content { flex: 1; }
.notif-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.notif-message {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.notif-time {
  font-size: 11px;
  color: var(--muted-2);
}

/* ===== Profile ===== */
.profile-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin: 16px;
  border-radius: var(--radius-lg);
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}
.profile-card h3 { font-size: 18px; margin-bottom: 4px; }
.profile-card p { opacity: 0.9; font-size: 13px; }

.account-manager-card {
  background: var(--bg-card);
  margin: 0 16px 16px;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.am-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.am-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6b00);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.am-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.am-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.am-role {
  font-size: 12px;
  color: var(--muted);
}
.am-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.am-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.am-contact-item svg { color: var(--primary); flex-shrink: 0; }

.menu-list {
  background: var(--bg-card);
  margin: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item.clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item.clickable:active {
  background: var(--border-light);
}
.menu-value { color: var(--muted); }
.menu-arrow {
  color: var(--muted-2);
  font-size: 18px;
  font-weight: 300;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== Modal ===== */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-container.show { display: flex; }

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-overlay .modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-overlay .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-overlay .modal-header h3 { margin: 0; font-size: 16px; }
.modal-overlay .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal-overlay .modal-body { padding: 16px 20px 20px; }

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 16px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ===== Image Lightbox ===== */
.image-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.image-lightbox.show {
  display: flex;
}
.image-lightbox img {
  max-width: 92%;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ===== Clickable Image ===== */
.clickable {
  cursor: pointer;
  transition: opacity 0.2s;
}
.clickable:hover {
  opacity: 0.85;
}

/* ===== WhatsApp Floating Button ===== */
.wa-fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.5);
  z-index: 90;
  transition: transform 0.2s;
}
.wa-fab:active { transform: scale(0.92); }
