:root {
  --bg: #f4f7fc;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e6efff;
  --border: #dbe4f0;
  --border-strong: #c9d5e6;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 18px 44px rgba(15, 23, 42, 0.14);
  --radius: 16px;
  --radius-sm: 12px;
  --btn-height: 48px;
  --btn-radius: 14px;
  --btn-pad-x: 20px;
  --btn-font-size: 15px;
  --btn-font-weight: 700;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(60% 38% at 12% -8%, rgba(59, 130, 246, 0.12), transparent 78%),
    radial-gradient(48% 36% at 88% -12%, rgba(147, 197, 253, 0.18), transparent 76%),
    linear-gradient(180deg, #f8fbff 0%, #f2f6fc 42%, #edf2f9 100%);
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

main.container {
  animation: page-enter 360ms ease both;
}

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(219, 228, 240, 0.82);
  background: rgba(249, 252, 255, 0.9);
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.brand-text {
  display: grid;
  line-height: 1.08;
}

.brand-title {
  font-size: 18px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px;
  min-height: 50px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.searchbar:focus-within {
  border-color: #93b7ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.searchbar input {
  border: 0;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 15px;
  color: var(--text);
}

.searchbar input::placeholder {
  color: #8fa0b7;
}

.header-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-search-wrap .searchbar {
  flex: 1;
  min-width: 0;
}

.catalog-trigger {
  width: 50px;
  min-width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #5a6f8e;
}

.catalog-trigger-bars {
  display: grid;
  gap: 4px;
}

.catalog-trigger-bars span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions-minimal {
  justify-self: end;
  gap: 10px;
  flex-wrap: nowrap;
}

.header-icon-link {
  position: relative;
  color: #4c5f79;
}

.header-icon-svg {
  width: 20px;
  height: 20px;
  display: block;
}

.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.profile-dropdown {
  position: relative;
}

.profile-toggle {
  min-width: 170px;
  justify-content: flex-start;
  gap: 10px;
  padding-right: 12px;
}

.profile-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ecf2fc;
  border: 1px solid #d4dff0;
  color: #5f6f86;
  overflow: hidden;
}

.profile-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-mini-avatar-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-mini-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.profile-mini-caret {
  margin-left: auto;
  font-size: 12px;
  color: #6b7f9a;
  transition: transform 0.2s ease;
}

.profile-toggle.is-open .profile-mini-caret {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 250px;
  border-radius: 12px;
  border: 1px solid #d6e1f0;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: grid;
  gap: 2px;
  z-index: 80;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.profile-menu[hidden] {
  display: none !important;
}

.profile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notifications-dropdown {
  position: relative;
}

.notifications-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: min(70vh, 520px);
  border-radius: 12px;
  border: 1px solid #d6e1f0;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: grid;
  gap: 8px;
  z-index: 80;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notifications-menu[hidden] {
  display: none !important;
}

.notifications-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notifications-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
}

.notifications-menu-title {
  font-size: 14px;
  font-weight: 800;
  color: #1f314a;
}

.notifications-read-all-btn {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.notifications-read-all-btn:hover {
  background: #edf4ff;
}

.notifications-list {
  display: grid;
  gap: 4px;
  overflow: auto;
  max-height: min(56vh, 410px);
  padding: 2px;
}

.notifications-empty {
  padding: 10px 8px;
  color: #64748b;
  font-size: 14px;
}

.notification-item {
  width: 100%;
  border: 1px solid #e3ebf6;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover {
  border-color: #cfdcf0;
  background: #f8fbff;
}

.notification-item.is-unread {
  border-color: #bfdbfe;
  background: #f1f7ff;
}

.notification-item-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-item-text {
  color: #1f314a;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.notification-item-time {
  color: #64748b;
  font-size: 12px;
}

.notifications-page-list {
  display: grid;
  gap: 10px;
}

.notification-item-page {
  cursor: default;
}

.notification-mark-read-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}

.catalog-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.catalog-drawer-backdrop[hidden] {
  display: none !important;
}

.catalog-drawer-backdrop.is-open {
  opacity: 1;
}

.catalog-drawer {
  width: min(360px, calc(100vw - 24px));
  height: 100%;
  background: #fff;
  border-right: 1px solid #d6e1f0;
  box-shadow: 18px 0 36px rgba(15, 23, 42, 0.14);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
}

.catalog-drawer-backdrop.is-open .catalog-drawer {
  transform: translateX(0);
}

.catalog-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid #e2e8f3;
  background: linear-gradient(180deg, #f8fbff, #f1f6ff);
}

.catalog-drawer-title {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.catalog-drawer-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
}

.catalog-drawer-list {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 3px;
}

.catalog-drawer-item {
  min-height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #253449;
  font-size: 16px;
  font-weight: 700;
}

.catalog-drawer-item:hover {
  background: #edf4ff;
  color: #1f4ec6;
}

.catalog-drawer-item.is-all {
  color: #1f4ec6;
}

.catalog-drawer-loading,
.catalog-drawer-error {
  padding: 10px 12px;
  color: #64748b;
  font-size: 14px;
}

.menu-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-radius: 10px;
  padding: 0 12px;
  color: #1f314a;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-item:hover {
  background: #f1f6ff;
  color: #0f2f70;
}

.menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: #e3ebf6;
}

.menu-item.danger {
  color: #b42318;
}

.menu-item.danger:hover {
  background: #fff1ef;
  color: #9f1d12;
}

.section-title-tight {
  margin: 0;
}

.row {
  display: flex;
}

.row-wrap {
  flex-wrap: wrap;
}

.row-items-center {
  align-items: center;
}

.row-center-between {
  align-items: center;
  justify-content: space-between;
}

.row-justify-end {
  justify-content: flex-end;
}

.row-gap-6 {
  gap: 6px;
}

.row-gap-8 {
  gap: 8px;
}

.row-gap-10 {
  gap: 10px;
}

.grid-gap-8 {
  gap: 8px;
}

.grid-gap-10 {
  gap: 10px;
}

.grid-gap-12 {
  gap: 12px;
}

.grid-cols-160 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.grid-cols-260 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-cols-280 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-thumbs-72 {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.inline-form {
  display: inline;
}

.form-no-margin {
  margin: 0;
}

.mt-6 {
  margin-top: 6px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-12 {
  margin-top: 12px;
}

.mb-12 {
  margin-bottom: 12px;
}

.is-hidden {
  display: none !important;
}

.card-static {
  position: static;
  min-height: auto;
}

.card-badge-inline {
  position: static;
  display: inline-flex;
}

.btn,
.button {
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  height: var(--btn-height);
  min-height: var(--btn-height);
  padding: 0 var(--btn-pad-x);
  border-radius: var(--btn-radius);
  font-weight: var(--btn-font-weight);
  font-size: var(--btn-font-size);
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn-primary,
.button {
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.btn-secondary,
.button.secondary {
  background: var(--surface-soft);
  border-color: var(--border);
  color: #1e293b;
}

.btn-secondary.active {
  background: var(--accent-soft);
  border-color: #9ab8ff;
  color: var(--accent-strong);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--border);
  color: #334155;
}

.btn-icon {
  width: var(--btn-height);
  min-width: var(--btn-height);
  height: var(--btn-height);
  padding: 0;
  border-radius: var(--btn-radius);
  border-color: var(--border);
  color: #64748b;
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  font-size: 17px;
}

.btn-icon.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #9ab8ff;
}

.btn:disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:hover,
.button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.btn-primary:hover,
.button:hover {
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
}

.btn:active,
.button:active {
  transform: translateY(0) scale(0.99);
  box-shadow: none;
}

.btn.is-loading,
.button.is-loading {
  opacity: 0.82;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cddcf5;
  background: #edf4ff;
  color: #2758cc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.rating-stars {
  color: #f59e0b;
  letter-spacing: 1px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f7fd;
  font-size: 12px;
  color: #44536a;
  font-weight: 700;
  line-height: 1.2;
}

.hero {
  margin-top: var(--space-4);
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 95% -20%, rgba(37, 99, 235, 0.12), transparent 62%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: var(--shadow);
  padding: 34px;
  display: grid;
  gap: 10px;
  animation: hero-enter 420ms ease both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.8vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.section {
  margin-top: var(--space-5);
}

.section-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.13;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.trust-section {
  margin-top: var(--space-4);
}

.trust-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

.trust-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 100% -20%, rgba(37, 99, 235, 0.08), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 24px 22px;
  text-align: center;
  display: grid;
  gap: 10px;
  align-content: start;
}

.trust-icon {
  font-size: 30px;
  line-height: 1;
}

.trust-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.trust-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.56;
}

.onboarding-section {
  margin-top: var(--space-4);
}

.onboarding-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

.onboarding-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: grid;
  gap: 10px;
}

.onboarding-step {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #9ab8ff;
  background: #edf4ff;
  color: #1f4ec6;
  font-size: 14px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.onboarding-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.onboarding-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.onboarding-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-toolbar {
  gap: 14px;
}

.admin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-filter-tab {
  text-decoration: none;
  transition: all 0.2s ease;
}

.admin-filter-tab.active {
  background: var(--accent-soft);
  border-color: #9ab8ff;
  color: var(--accent-strong);
}

.admin-filter-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.admin-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.profile-card .section-title,
.modal-card .section-title,
.messages-thread .section-title,
.messages-sidebar .section-title {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

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

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

.card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.card-image {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 80% at 78% 8%, rgba(147, 197, 253, 0.35), transparent 58%),
    linear-gradient(150deg, #edf4ff, #dfeafc 54%, #d4e4fa 100%);
  color: #6f7f97;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image-with-fallback {
  position: relative;
}

.card-image-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.card-image-with-fallback.is-loaded .card-image-fallback {
  display: none;
}

.card-body {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.card-title {
  font-size: 19px;
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-muted {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-pill {
  background: #f2f6fd;
  color: #3b4a61;
}

.card-price {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1326;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-actions .btn {
  width: 100%;
  min-width: 0;
}

.card-buy-btn,
.card-cart-btn {
  min-height: 42px;
  font-size: 14px;
  padding: 0 10px;
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  border-radius: 999px;
  padding: 5px 11px;
  border: 1px solid #cddcf5;
  background: rgba(240, 246, 255, 0.94);
  color: #3c557a;
  font-size: 12px;
  font-weight: 800;
}

.card-media-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.56);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.order-status-pending {
  background: #fff7e8;
  border-color: #f4d4a6;
  color: #9a580d;
}

.order-status-on_hold {
  background: #fff8dc;
  border-color: #f2d392;
  color: #93580a;
}

.order-status-completed {
  background: #ebfff3;
  border-color: #b4e9c8;
  color: #157347;
}

.order-status-dispute {
  background: #fff1ef;
  border-color: #f3b8b2;
  color: #b43b2f;
}

.order-status-refunded,
.order-status-canceled {
  background: #f2f5fb;
  border-color: #d7e0ec;
  color: #4d5e78;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #4b5a72;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fbfdff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input,
select {
  min-height: 50px;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

.input::placeholder,
textarea::placeholder {
  color: #9baac0;
}

.input:focus,
textarea:focus,
select:focus,
input:focus,
button:focus,
a:focus {
  outline: none;
}

.input:focus,
textarea:focus,
select:focus,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  border-color: #8fb1ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: grid;
  gap: var(--space-3);
}

.product-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
}

.product-main-image {
  position: relative;
  min-height: 360px;
}

.product-main-frame {
  border-radius: 16px;
  overflow: hidden;
}

.product-main-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb img {
  cursor: pointer;
}

.product-thumbs-grid {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

.product-thumb-frame {
  height: 80px;
  border-radius: 12px;
}

.product-side {
  align-content: start;
}

.product-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.purchase-hint {
  color: #3f5676;
  font-size: 13px;
  line-height: 1.45;
  background: #f4f8ff;
  border: 1px solid #d9e5f8;
  border-radius: 12px;
  padding: 10px 12px;
}

.checkout-card {
  max-width: 640px;
}

.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fbff;
  padding: 12px 14px;
}

.purchase-success-card {
  gap: 14px;
}

.purchase-item-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fbff;
  padding: 12px;
}

.purchase-item-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.seller-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.seller-stat-card {
  min-height: 110px;
  justify-content: center;
}

.seller-stat-value {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.1;
}

.seller-charts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.seller-file-tools {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fbff;
  overflow: hidden;
}

.seller-file-tools summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #2f4667;
  border-bottom: 1px solid transparent;
}

.seller-file-tools summary::-webkit-details-marker {
  display: none;
}

.seller-file-tools[open] summary {
  border-bottom-color: var(--border);
}

.seller-file-tools-body {
  padding: 14px;
}

.seller-file-section {
  display: grid;
  gap: 8px;
}

.thumb-72 {
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
}

.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

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

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tagline {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.review {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fcff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.alert,
.notice {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: #ecfff2;
  border-color: #b7e7c7;
  color: #1d7a43;
}

.alert-error {
  background: #fff1f0;
  border-color: #f3c4be;
  color: #b13a2d;
}

.alert-warning,
.notice {
  background: #fff7ea;
  border-color: #f4d8ad;
  color: #9a5c11;
}

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 92px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 240px;
  max-width: 380px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #243044;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-info {
  background: #eef4ff;
  border-color: #d4e1fa;
}

.toast-error {
  background: #fff1f0;
  border-color: #f3c3be;
}

.toast-success {
  background: #ecfff2;
  border-color: #b4e8c7;
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
}

.tx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  margin-right: 6px;
  border-radius: 999px;
  border: 1px solid #cfdcff;
  background: #edf3ff;
  color: #365cb3;
  font-size: 11px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  padding: 16px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(5px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(640px, 100%);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  padding: 20px;
  display: grid;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty-state {
  border: 1px dashed #cbd9ec;
  border-radius: 18px;
  background:
    radial-gradient(110% 130% at 90% -20%, rgba(59, 130, 246, 0.1), transparent 55%),
    #f9fbff;
  padding: 30px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.empty-state.center {
  justify-items: center;
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #cddcf5;
  background: #ecf3ff;
  color: #345aa8;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.empty-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
  color: #14233c;
}

.empty-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 55;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.bottom-nav a {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 4px;
  border-radius: 10px;
}

.bottom-nav a.active {
  background: #e8f0ff;
  color: #1f4fc2;
  font-weight: 800;
}

.spacer {
  height: 92px;
}

.hide-mobile {
  display: inline-flex;
}

.cart-layout {
  display: grid;
  gap: 16px;
}

.cart-summary {
  height: fit-content;
}

.messages-layout {
  display: grid;
  gap: 16px;
}

.messages-sidebar .card-muted {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #f9fbff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.messages-sidebar .card-muted:hover {
  background: #f2f7ff;
  border-color: #c8d9f6;
}

.messages-active {
  border-color: #9ab8ff !important;
  background: #e9f1ff !important;
}

.messages-thread {
  min-height: 440px;
}

.messages-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.product-main-image img,
.product-thumb img {
  filter: none !important;
  opacity: 1;
}

.message-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #f8fbff;
}

.message-item.mine {
  background: #eaf2ff;
  border-color: #bed2fb;
}

.auth-card {
  max-width: 520px;
  margin: 0 auto;
}

.auth-link-row {
  margin-top: 10px;
  text-align: center;
}

.auth-link-row.right {
  text-align: right;
}

.grid-catalog .card {
  animation: card-enter 340ms ease both;
}

.grid-catalog .card:nth-child(1) { animation-delay: 30ms; }
.grid-catalog .card:nth-child(2) { animation-delay: 60ms; }
.grid-catalog .card:nth-child(3) { animation-delay: 90ms; }
.grid-catalog .card:nth-child(4) { animation-delay: 120ms; }
.grid-catalog .card:nth-child(5) { animation-delay: 150ms; }
.grid-catalog .card:nth-child(6) { animation-delay: 180ms; }
.grid-catalog .card:nth-child(7) { animation-delay: 210ms; }
.grid-catalog .card:nth-child(8) { animation-delay: 240ms; }

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  main.container,
  .hero,
  .grid-catalog .card {
    animation: none !important;
  }

  .btn,
  .button,
  .card,
  .searchbar,
  .messages-sidebar .card-muted,
  .profile-menu,
  .profile-mini-caret {
    transition: none !important;
  }
}

@media (min-width: 1024px) {
  .grid-catalog {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .cart-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .cart-summary {
    position: sticky;
    top: 94px;
  }

  .messages-layout {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
  }

  .messages-sidebar {
    position: sticky;
    top: 94px;
    max-height: calc(100vh - 124px);
    overflow: auto;
  }

  .bottom-nav {
    display: none;
  }

  .spacer {
    height: 34px;
  }
}

@media (max-width: 1023px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }

  .searchbar {
    grid-column: 1 / -1;
  }

  .header-search-wrap {
    grid-column: 1 / -1;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .hide-mobile {
    display: none;
  }

  .profile-toggle {
    min-width: auto;
    padding-right: 10px;
  }

  .profile-mini-name {
    display: none;
  }

  .hero {
    padding: 22px;
  }

  .section-title {
    font-size: clamp(24px, 8vw, 34px);
  }

  .profile-card .section-title,
  .modal-card .section-title,
  .messages-thread .section-title,
  .messages-sidebar .section-title {
    font-size: clamp(20px, 6vw, 28px);
  }

  .card-title {
    font-size: 18px;
  }

  .card-price {
    font-size: 22px;
  }

  .tagline {
    font-size: 15px;
  }

  .profile-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-main-image {
    min-height: 280px;
  }

  .cart-layout,
  .messages-layout {
    grid-template-columns: 1fr;
  }

  .seller-stats-grid,
  .seller-charts-grid {
    grid-template-columns: 1fr;
  }

  .empty-state {
    padding: 22px;
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 640px) {
  .btn,
  .button {
    width: 100%;
  }

  .header-actions .btn,
  .header-actions .button {
    width: auto;
  }

  .btn-icon {
    width: var(--btn-height);
    min-width: var(--btn-height);
  }

  .profile-menu {
    width: min(250px, calc(100vw - 32px));
    right: 0;
  }

  .notifications-menu {
    width: min(340px, calc(100vw - 32px));
    right: -36px;
  }

  .profile-card,
  .hero,
  .modal-card {
    padding: 18px;
    border-radius: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .card-title {
    font-size: 17px;
  }

  .card-price {
    font-size: 21px;
  }

  .toast {
    min-width: 0;
    width: calc(100vw - 32px);
  }

  .section {
    margin-top: 22px;
  }
}
