/* Auth */
.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 40px; border-radius: var(--radius); }
.auth-form label { display: block; margin: 12px 0 6px; font-size: 0.9rem; color: var(--text-muted); }
.auth-form input { width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--input-bg); color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); outline: none; }

.auth-form-error { margin-bottom: 12px; }

.oauth-block { margin-bottom: 20px; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.btn-oauth:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.btn-oauth-google .oauth-icon {
  color: #ea4335;
  font-weight: 700;
}

.btn-oauth-yandex .oauth-icon {
  color: #fc3f1d;
  font-weight: 700;
}

.btn.is-loading {
  opacity: 0.75;
  pointer-events: none;
}
.captcha-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.captcha-row input { flex: 1; min-width: 80px; }
.captcha-img { border-radius: 8px; border: 1px solid var(--border); }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); }
.animate-in { animation: fadeInUp 0.5s ease; }
.animate-shake { animation: shake 0.4s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* Header extras */
.header-mobile-user {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.header-mobile-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.header-mobile-user-info strong {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.header-mobile-user-info small {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}
.profile-name-wrap { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }

.online-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

.online-counter strong {
  color: var(--text);
  font-weight: 700;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(46, 158, 74, 0.25);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.delivery-zone-compact {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 0.85rem;
}
.profile-balance { font-size: 0.72rem; color: var(--accent); font-weight: 600; }
.icon { width: 22px; height: 22px; display: block; }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.18s var(--spring), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px) scale(1.04);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.icon-btn:active {
  transform: scale(0.96);
}
.notif-badge, .cart-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.65rem; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.nav-profile { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); cursor: pointer; color: var(--text); }
.profile-name { font-size: 0.9rem; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; padding: 8px; border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 200; }
.profile-dropdown a, .profile-dropdown .link-btn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; width: 100%; border: none; background: none; cursor: pointer; font-size: 0.95rem; }
.profile-dropdown a:hover { background: var(--accent-soft); }
.lang-switcher { display: flex; gap: 4px; }
.lang-btn { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; font-weight: 600; }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }

/* Account */
.account-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.account-sidebar { padding: 20px; position: sticky; top: 90px; }
.account-sidebar nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.account-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; color: var(--text); text-decoration: none; transition: background 0.2s; }
.account-sidebar nav a.active { background: var(--accent); color: #fff; }
.account-sidebar nav a.active .icon { stroke: #fff; }
.account-user-mini { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.account-content { padding: 32px; border-radius: var(--radius); }

/* Orders */
.order-card { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 16px 20px; margin-bottom: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: transform 0.2s, box-shadow 0.2s; }
.order-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.order-status { padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-pending { background: rgba(255,149,0,0.15); color: #ff9500; }
.status-accepted { background: rgba(0,122,255,0.15); color: #007aff; }
.status-processing { background: rgba(88,86,214,0.15); color: #5856d6; }
.status-shipping { background: rgba(90,200,250,0.15); color: #5ac8fa; }
.status-delivered { background: rgba(52,199,89,0.15); color: #34c759; }
.status-cancelled { background: rgba(255,59,48,0.15); color: #ff3b30; }

/* Notifications */
.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s var(--spring), box-shadow 0.2s;
}
.notif-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.notif-item.unread { background: var(--accent-soft); border-color: rgba(0, 122, 255, 0.2); }
.notif-chevron { font-size: 1.4rem; color: var(--text-muted); }
.notif-modal-msg { margin: 16px 0; line-height: 1.55; }
.notif-modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Order detail */
.order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.order-number { font-size: 1.5rem; margin: 8px 0 4px; }
.order-meta { color: var(--text-muted); font-size: 0.9rem; }
.order-back { margin-bottom: 8px; }
.order-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.order-info-block h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.order-items-wrap h3 { margin-bottom: 12px; }
.order-items-table { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.order-items-head,
.order-items-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.6fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
}
.order-items-head { background: rgba(0, 0, 0, 0.04); font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.order-items-row { border-top: 1px solid var(--border); font-size: 0.92rem; }
.order-totals { padding: 20px; margin-top: 20px; }
.order-totals-row { display: flex; justify-content: space-between; padding: 8px 0; }
.order-totals-row.discount { color: var(--success); }
.order-totals-row.total { font-size: 1.15rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }

/* Order success */
.order-success-page { display: flex; justify-content: center; padding: 24px 0; }
.order-success-card { max-width: 480px; width: 100%; padding: 48px 32px; text-align: center; }
.success-icon {
  width: 72px; height: 72px; margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.15);
  color: var(--success);
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  animation: popIn 0.5s var(--spring);
}
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.order-success-number { margin: 16px 0 8px; }
.order-success-total { font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.order-success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* Contacts */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.contact-card { padding: 28px; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.contact-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.contact-value { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.contact-address { font-size: 1.1rem; margin-bottom: 12px; line-height: 1.5; }
.contact-hours { color: var(--text-muted); }
.contact-map { padding: 0; overflow: hidden; min-height: 220px; }
.map-embed iframe { width: 100%; min-height: 280px; border: 0; display: block; }
.contact-map-placeholder { padding: 40px; text-align: center; color: var(--text-muted); }
.contact-map-placeholder strong { display: block; margin-top: 12px; color: var(--text); font-size: 1.1rem; }

/* Product image loading */
.product-card-image { position: relative; }
.img-skeleton { position: absolute; inset: 0; background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.product-img { opacity: 0; transition: opacity 0.3s; width: 100%; height: 100%; object-fit: cover; }
.product-img.loaded { opacity: 1; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

[data-theme="dark"] {
  --input-bg: rgba(44, 36, 28, 0.9);
  --accent-soft: rgba(255, 167, 38, 0.18);
  --accent-glow: rgba(255, 167, 38, 0.28);
  --skeleton-a: #2c2c2e;
  --skeleton-b: #3a3a3c;
}
[data-theme="light"] {
  --input-bg: rgba(255, 255, 255, 0.95);
  --accent-soft: rgba(245, 124, 0, 0.1);
  --accent-glow: rgba(245, 124, 0, 0.2);
  --skeleton-a: #e8e8ed;
  --skeleton-b: #f2f2f7;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.badge-soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.status-new { background: rgba(255, 149, 0, 0.15); color: #ff9500; }
.status-in_progress { background: rgba(245, 124, 0, 0.15); color: #f57c00; }
.status-awaiting_client { background: rgba(88, 86, 214, 0.15); color: #5856d6; }
.status-closed { background: rgba(142, 142, 147, 0.2); color: var(--text-muted); }

/* Support */
.support-head { margin-bottom: 20px; }
.support-create-panel {
  padding: 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  animation: fadeInUp 0.35s ease;
}
.support-create-panel label,
.support-reply-form label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.support-create-panel input,
.support-create-panel select,
.support-create-panel textarea,
.support-reply-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}
.support-ticket-list { display: flex; flex-direction: column; gap: 10px; }
.support-ticket-card {
  display: block;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}
.support-ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.support-ticket-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.support-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.support-ticket-preview {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.support-chat-page { display: flex; flex-direction: column; min-height: 420px; }
.support-chat-header { margin-bottom: 16px; }
.support-back { margin-bottom: 12px; }
.support-chat-title h1 { font-size: 1.25rem; margin: 0 0 8px; word-break: break-word; }
.support-chat-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.support-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  scroll-behavior: smooth;
}
.support-msg { display: flex; max-width: 88%; }
.support-msg-client { align-self: flex-end; }
.support-msg-admin { align-self: flex-start; }
.support-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  word-break: break-word;
}
.support-msg-client .support-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.support-msg-client .support-msg-bubble small { color: rgba(255, 255, 255, 0.85); }
.support-msg-bubble p { margin: 0 0 6px; line-height: 1.45; }
.support-msg-bubble small { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.support-attachment img,
.support-attachment-img {
  max-width: 200px;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
}
.support-reply-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.support-reply-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.file-label-inline { cursor: pointer; position: relative; overflow: hidden; }
.file-label-inline input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.support-closed-hint {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-muted);
  text-align: center;
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.is-loading { opacity: 0.7; pointer-events: none; }

/* Admin support */
.support-admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.support-admin-info { padding: 20px; }
.support-chat-admin { max-height: min(50vh, 480px); }
.admin-status-form { margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.admin-status-form select { padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.admin-reply-status { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.admin-notif-link {
  margin-left: auto;
  text-decoration: none;
  color: var(--text);
  position: relative;
  padding: 8px 12px;
}
.admin-notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #ff3b30;
  color: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-notif-badge.hidden { display: none; }
.admin-flash.success { color: #34c759; margin-bottom: 12px; }
.admin-flash.error { color: #ff3b30; margin-bottom: 12px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-filters input,
.admin-filters select { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }

/* Balance */
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  margin: 20px 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
}
.balance-amount { font-size: 2rem; font-weight: 700; color: var(--accent); }
.balance-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.balance-currency { font-size: 0.85rem; color: var(--text-muted); margin-left: 6px; }
.balance-history { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.balance-tx {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.balance-tx-main { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.balance-tx-amount.positive { color: #34c759; font-weight: 700; }
.balance-tx-amount.negative { color: #ff3b30; font-weight: 700; }
.balance-tx-comment { margin: 6px 0 4px; font-size: 0.9rem; color: var(--text-muted); }
.account-sidebar-balance {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.account-sidebar-balance strong { display: block; color: var(--accent); font-size: 1.1rem; }
.profile-balance-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin: 12px 0 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.topup-providers { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.topup-provider-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.topup-provider-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.payment-options { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.payment-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.contact-user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.contact-user-balance { margin: 6px 0 0; font-size: 0.9rem; }
.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  margin-bottom: 16px;
  align-items: center;
}
.admin-filter-bar input { flex: 1; min-width: 140px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); }
.admin-balance-history { margin-top: 16px; max-height: 200px; overflow-y: auto; font-size: 0.85rem; }

/* Mobile/tablet: see assets/css/responsive.css */
