/* Typography Defaults */

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4) }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-4) }
h3 { font-size: var(--text-xl);  margin-bottom: var(--space-3) }
h4 { font-size: var(--text-lg);  margin-bottom: var(--space-2) }
h5 { font-size: var(--text-md);  margin-bottom: var(--space-2) }
h6 { font-size: var(--text-base); margin-bottom: var(--space-1) }

p { margin-bottom: var(--space-4); line-height: var(--leading-relaxed); }
p:last-child { margin-bottom: 0 }

a { transition: color var(--ease-fast) }
a:hover { color: var(--color-primary-hover); text-decoration: none }

strong, b { font-weight: var(--font-semibold); color: var(--color-gray-900) }
small      { font-size: var(--text-sm); color: var(--color-gray-500) }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-gray-100);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-gray-800);
}

/* Text utilities */
.text-xs      { font-size: var(--text-xs) }
.text-sm      { font-size: var(--text-sm) }
.text-base    { font-size: var(--text-base) }
.text-md      { font-size: var(--text-md) }
.text-lg      { font-size: var(--text-lg) }
.text-xl      { font-size: var(--text-xl) }
.text-2xl     { font-size: var(--text-2xl) }
.text-3xl     { font-size: var(--text-3xl) }
.text-4xl     { font-size: var(--text-4xl) }
.text-primary { color: var(--color-primary) }
.text-success { color: var(--color-success) }
.text-danger  { color: var(--color-danger) }
.text-warning { color: var(--color-warning) }
.text-muted   { color: var(--color-gray-500) }
.text-dark    { color: var(--color-gray-900) }
.text-white   { color: var(--color-white) }

.font-normal   { font-weight: var(--font-normal) }
.font-medium   { font-weight: var(--font-medium) }
.font-semibold { font-weight: var(--font-semibold) }
.font-bold     { font-weight: var(--font-bold) }

.uppercase  { text-transform: uppercase }
.tracking-wide { letter-spacing: 0.05em }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.line-through { text-decoration: line-through }
.leading-tight   { line-height: var(--leading-tight) }
.leading-normal  { line-height: var(--leading-normal) }
.leading-relaxed { line-height: var(--leading-relaxed) }

/* ============================================
   AUTH PAGES
   ============================================ */

/* ============================================
   AUTH — SPLIT SCREEN LAYOUT
   ============================================ */

.auth-split {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left brand panel ── */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  color: #fff;
}

.auth-brand__deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.auth-brand__deco--1 { width: 340px; height: 340px; top: -80px; right: -80px; }
.auth-brand__deco--2 { width: 220px; height: 220px; bottom: 40px; left: -60px; }
.auth-brand__deco--3 { width: 120px; height: 120px; bottom: 160px; right: 60px; background: rgba(255,255,255,0.04); }

.auth-brand__inner {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.auth-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  text-decoration: none;
}

.auth-brand__logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

.auth-brand__logo span {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.auth-brand__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}

.auth-brand__sub {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.75);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.auth-brand__perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-brand__perks li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.9);
}

.auth-brand__perk-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Right form panel ── */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-8);
  background: var(--color-bg);
  overflow-y: auto;
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 20px 40px rgba(0,0,0,0.08);
  padding: var(--space-10);
  border: 1px solid var(--color-border-light);
  border-top: 4px solid var(--color-primary);
  position: relative;
}

/* Badge icon above heading */
.auth-card-badge {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto var(--space-4);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

/* Small colored label above heading */
.auth-card-eyebrow {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-5);
}

.auth-logo img { height: 36px; width: auto; }

.auth-logo__text {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.auth-heading {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.auth-subheading {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* Decorative divider between header and form */
.auth-form-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: 0 0 var(--space-6);
}

/* ── Form ── */
.auth-form { }
.auth-form .form-group { margin-bottom: var(--space-4); }

.auth-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

/* Input with leading icon */
.auth-input-icon-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-gray-50);
  outline: none;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
  appearance: none;
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
  background: var(--color-surface);
}

.auth-input:hover:not(:focus) { border-color: var(--color-gray-400); }
.auth-input::placeholder { color: var(--color-gray-400); }
.auth-input.is-invalid { border-color: var(--color-danger); box-shadow: 0 0 0 3px var(--color-danger-light); }

/* Input with left icon — double-class for specificity (beats input[type] in components.css) */
.auth-input.auth-input--has-icon { padding-left: 40px; }

/* Input with eye toggle */
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 44px; }
/* Both icon + toggle */
.auth-input-wrap.auth-input-icon-wrap .auth-input { padding-left: 40px; padding-right: 44px; }

.auth-input-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 44px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-400);
  transition: color var(--ease-fast);
}
.auth-input-toggle:hover { color: var(--color-text); }

.auth-field-action {
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-field-action:hover { text-decoration: underline; }

.auth-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.auth-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Submit button */
.auth-submit {
  width: 100%;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease-fast), box-shadow var(--ease-fast), transform var(--ease-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.auth-submit:hover { background: var(--color-primary-dark); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.auth-submit:active { transform: scale(0.99); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--color-text-light);
  font-size: var(--text-xs);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

/* Footer link */
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* Remember / checkbox */
.auth-check-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.auth-check-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--color-primary);
}
.auth-check-wrap label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1.5;
}
.auth-check-wrap label a { color: var(--color-primary); text-decoration: none; }
.auth-check-wrap label a:hover { text-decoration: underline; }

/* Alert banners */
.auth-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.auth-alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.auth-alert--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Email verification icon */
.auth-icon {
  width: 64px;
  height: 64px;
  background: var(--color-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  color: var(--color-primary);
}

/* Back to store */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color var(--ease-fast), background var(--ease-fast);
  margin-bottom: var(--space-6);
}
.auth-back:hover { color: var(--color-text); background: var(--color-border-light); }

/* Responsive */
@media (max-width: 1024px) {
  .auth-brand__title { font-size: var(--text-2xl); }
}

@media (max-width: 768px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand  { display: none; }
  .auth-form-panel { padding: var(--space-8) var(--space-4); min-height: calc(100vh - 64px); }
  .auth-card { padding: var(--space-6) var(--space-5); }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: var(--space-6) var(--space-3); }
  .auth-card { padding: var(--space-5); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
}

/* Legacy .auth-page kept for forgot/reset/verify pages */
.auth-page {
  min-height: calc(100vh - 64px);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-4);
}

/* ============================================
   ACCOUNT PAGES
   ============================================ */

.account-page {
  padding: var(--space-8) 0 var(--space-16);
}

.account-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* Account Sidebar */
.account-sidebar {
  position: sticky;
  top: 72px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.account-sidebar__user {
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.account-sidebar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-md);
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.account-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-sidebar__name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-sidebar__email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-nav { padding: var(--space-2) 0; }

.account-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--ease-fast);
  cursor: pointer;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}

.account-nav__item:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.account-nav__item.active,
.account-nav__item--active {
  color: var(--color-primary);
  background: rgba(26, 86, 219, 0.05);
  border-left-color: var(--color-primary);
}

.account-nav__item--danger { color: var(--color-text-muted); }
.account-nav__item--danger:hover { color: var(--color-danger); background: #fef2f2; }

.account-nav__divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-2) 0;
}

/* Account Content */
.account-content { min-width: 0; }

.account-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.account-section:last-child { margin-bottom: 0; }

.account-section__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-section__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text);
}

.account-section__body { padding: var(--space-5); }

/* Stat Cards */
.account-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.account-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.account-stat__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(26, 86, 219, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-stat__value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.account-stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Order Status Badges */
.order-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
}

.order-status--pending   { background: #fff7ed; color: #9a3412; }
.order-status--processing { background: #eff6ff; color: #1e40af; }
.order-status--shipped   { background: #f5f3ff; color: #6b21a8; }
.order-status--delivered { background: #f0fdf4; color: #166534; }
.order-status--cancelled { background: #fef2f2; color: #991b1b; }
.order-status--refunded  { background: #f9fafb; color: #374151; }

/* Orders Table */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.orders-table td {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.orders-table tr:last-child td { border-bottom: none; }

.orders-table tr:hover td { background: var(--color-bg); }

/* Order Detail */
.order-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.order-info-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.order-info-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.order-info-card__value {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.7;
}

/* Order Timeline */
.order-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 80px;
}

.timeline-step__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-2);
  color: var(--color-text-light);
  transition: all var(--ease-base);
  position: relative;
  z-index: 1;
}

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

.timeline-step--active .timeline-step__dot {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.timeline-step__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

.timeline-step--done .timeline-step__label,
.timeline-step--active .timeline-step__label { color: var(--color-text); }

.timeline-step__date {
  font-size: 10px;
  color: var(--color-text-light);
  margin-top: 2px;
}

.timeline-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 2px;
  background: var(--color-border-light);
  z-index: 0;
}

.timeline-step:first-child::before { display: none; }

.timeline-step--done::before { background: var(--color-success); }

/* Address Cards */
.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.address-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
  background: var(--color-surface);
}

.address-card--default {
  border-color: var(--color-primary);
}

.address-card__badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.address-card__name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.address-card__line {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.address-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

.address-add-card {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--ease-fast);
  text-decoration: none;
  min-height: 140px;
  background: var(--color-surface);
}

.address-add-card:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(26, 86, 219, 0.02);
}

.address-add-card span {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Address Modal + Form */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1100);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal__box {
  position: relative;
  width: min(100%, 640px);
  max-height: calc(100vh - var(--space-8));
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-address-modal__box {
  width: min(100%, 560px);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast);
}

.modal__close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modal__body {
  padding: var(--space-5);
  overflow-y: auto;
}

.modal.modal--open .modal__box {
  animation: scaleIn var(--ease-base) both;
}

.address-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.address-form__grid {
  display: grid;
  gap: var(--space-3);
}

.address-form__grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.address-form__grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.address-form__field {
  min-width: 0;
}

.address-form__label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.address-form__required {
  color: var(--color-danger);
}

.address-form__optional {
  font-weight: 400;
  color: var(--color-text-light);
}

.address-form__select {
  cursor: pointer;
}

.address-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-light);
}

.address-form__actions .btn {
  min-height: 44px;
}

/* Profile Form */
.profile-avatar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}

.profile-avatar__img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border-light);
  background: var(--color-bg);
}

.profile-avatar__placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  flex-shrink: 0;
}

/* Wishlist page uses product grid — no extra styles needed */

/* Account empty state */
.account-empty {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}

.account-empty__icon {
  width: 48px;
  height: 48px;
  color: var(--color-border);
  margin: 0 auto var(--space-4);
}

.account-empty__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

/* Responsive */
@media (max-width: 1024px) {
  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .order-info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
    border-radius: var(--radius-lg);
  }

  /* Compact user block on mobile */
  .account-sidebar__user {
    padding: var(--space-3) var(--space-4);
  }
  .account-sidebar__avatar {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm);
  }
  .account-sidebar__email {
    display: none;
  }
  .account-sidebar__name {
    font-size: var(--text-sm);
  }

  /* Nav: horizontal pill-tabs with scroll hint */
  .account-nav {
    display: flex;
    overflow-x: auto;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-1);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* right-fade gradient to hint at scrollability */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  }
  .account-nav::-webkit-scrollbar { display: none; }

  .account-nav__item {
    flex-shrink: 0;
    white-space: nowrap;
    border: 1.5px solid var(--color-border-light);
    border-radius: 99px;
    padding: 6px 14px;
    font-size: var(--text-xs);
    height: auto;
    min-height: 34px;
  }

  .account-nav__item:hover {
    background: var(--color-bg);
    border-color: var(--color-border);
  }

  /* Active: filled primary pill — clearly visible */
  .account-nav__item.active,
  .account-nav__item--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    border-left-color: var(--color-primary);
  }

  .account-nav__item.active:hover,
  .account-nav__item--active:hover {
    background: var(--color-primary);
    color: #fff;
  }

  /* Hide dividers in horizontal layout */
  .account-nav__divider {
    display: none;
  }

  .account-stats { grid-template-columns: repeat(2, 1fr); }
  .order-info-grid { grid-template-columns: 1fr; }
  .address-grid { grid-template-columns: 1fr; }
  .address-form__grid--2,
  .address-form__grid--3 {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: var(--space-2);
  }

  .modal__box {
    max-height: calc(100vh - var(--space-4));
    border-radius: var(--radius-lg);
  }

  .modal__body {
    padding: var(--space-4);
  }

  .address-form__actions {
    flex-direction: column-reverse;
  }

  .address-form__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .account-stats { grid-template-columns: 1fr; }
}
