:root {
  --bg: #f7f8fc;
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #eef2ff;
  --success: #027a48;
  --success-soft: #dcfae6;
  --warning: #b54708;
  --warning-soft: #fff4e5;
  --danger: #c01048;
  --danger-soft: #fff1f3;
  --shadow: 0 24px 70px rgba(79, 70, 229, 0.14);
  --radius-lg: 34px;
  --radius-md: 22px;
  --radius-sm: 15px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 20%, rgba(244, 114, 182, 0.17), transparent 31rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 46%, #fff7ed 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 42px;
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  padding: 28px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(44px);
  pointer-events: none;
}
.hero::before { right: -50px; top: -40px; width: 260px; height: 260px; background: rgba(99,102,241,.28); }
.hero::after { left: 22%; bottom: -95px; width: 280px; height: 280px; background: rgba(244,114,182,.23); }
.hero > * { position: relative; z-index: 1; }
.compact-hero { margin-bottom: 24px; }
.compact-hero section { max-width: 900px; padding: 28px 4px 8px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #111827);
  box-shadow: 0 14px 36px rgba(79,70,229,.28);
  font-weight: 900;
  font-size: 21px;
}
.brand strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.owner-link,
.ghost-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  padding: 11px 16px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.owner-link,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  color: #344054;
  box-shadow: 0 8px 20px rgba(16,24,40,.05);
}
.owner-link:hover,
.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover { transform: translateY(-1px); }
.owner-link.light { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.32); color: #fff; }
.owner-link.danger { color: var(--danger); }
.owner-link.small,
.ghost-button.small { min-height: 36px; padding: 8px 12px; border-radius: 13px; }
.primary-button { background: var(--primary); color: #fff; box-shadow: 0 14px 32px rgba(79,70,229,.22); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { background: #101828; color: #fff; box-shadow: 0 14px 30px rgba(16,24,40,.22); }
.special { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.danger-button { background: var(--danger-soft); color: var(--danger); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(310px, .72fr);
  gap: 28px;
  align-items: end;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #d8b4fe;
  border-radius: 999px;
  background: #faf5ff;
  color: #6b21a8;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 900;
}
h1 {
  margin: 18px 0 0;
  max-width: 950px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: .95;
  letter-spacing: -0.065em;
}
.compact-hero h1 { font-size: clamp(36px, 4vw, 58px); }
.hero p {
  max-width: 850px;
  margin: 20px 0 0;
  color: #475467;
  font-size: 18px;
  line-height: 1.8;
}
.hero-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.metric {
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  padding: 22px;
  box-shadow: 0 18px 38px rgba(16,24,40,.08);
}
.metric.wide { grid-column: 1 / -1; }
.metric span { display: block; font-size: 35px; font-weight: 950; letter-spacing: -.04em; }
.metric small { color: var(--muted); font-weight: 800; }

.catalog-layout,
.owner-layout,
.auth-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}
.catalog-layout { grid-template-columns: 360px minmax(0,1fr); }
.owner-layout { grid-template-columns: 390px minmax(0,1fr); align-items: start; }
.auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  border: 1px solid rgba(255,255,255,.74);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 22px;
}
.sticky-panel { position: sticky; top: 18px; align-self: start; }
.section-title,
.catalog-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-title h2,
.catalog-controls h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.03em;
}
.section-title p,
.catalog-controls p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }

.shop-list { display: grid; gap: 12px; }
.shop-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: rgba(255,255,255,.78);
  padding: 15px;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.shop-card:hover,
.shop-card.active { transform: translateY(-1px); border-color: #c7d2fe; background: #eef2ff; box-shadow: 0 16px 28px rgba(79,70,229,.12); }
.shop-card strong { display: block; font-size: 16px; }
.shop-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.shop-card .pill-row { margin-top: 12px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(228,231,236,.78);
  padding: 5px 10px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.catalog-panel { min-height: 480px; }
.catalog-controls { align-items: center; flex-wrap: wrap; }
.control-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }
.search-box { position: relative; min-width: min(420px, 100%); }
.search-box span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #98a2b3; font-weight: 900; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.94);
  color: var(--text);
  outline: none;
  padding: 13px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.search-box input { padding-left: 38px; }
textarea { min-height: 118px; resize: vertical; line-height: 1.55; }
select { min-width: 200px; }
input:focus,
textarea:focus,
select:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(129,140,248,.18); background: #fff; }
label span { display: block; margin: 0 0 8px; color: #344054; font-weight: 850; font-size: 14px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card-solid);
  box-shadow: 0 10px 28px rgba(16,24,40,.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(79,70,229,.15); border-color: #c7d2fe; }
.product-image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image .empty-image { color: #98a2b3; font-size: 42px; }
.second-thumb {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 64px;
  height: 64px;
  border: 4px solid #fff;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(16,24,40,.18);
}
.card-body { padding: 16px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-body h3 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.price {
  flex: 0 0 auto;
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 950;
}
.product-meta { margin-top: 6px; color: #98a2b3; font-size: 12px; font-weight: 800; }
.description { margin: 12px 0 0; min-height: 64px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.card-actions button { min-height: 38px; padding: 8px 12px; border-radius: 13px; }

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.7);
  padding: 44px 22px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--text); font-size: 20px; margin-bottom: 7px; }

.auth-panel { min-height: 410px; }
.accent-panel { background: linear-gradient(135deg, rgba(238,242,255,.92), rgba(255,255,255,.88)); }
.form-stack { display: grid; gap: 15px; }
.mini-form { margin-bottom: 18px; }
.button-row { display: flex; gap: 10px; align-items: center; }
.button-row.wrap { flex-wrap: wrap; justify-content: flex-end; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.product-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 340px;
  gap: 18px;
  align-items: start;
  border: 1px solid rgba(228,231,236,.72);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.64);
  padding: 16px;
  margin-bottom: 24px;
}
.form-main { display: grid; gap: 15px; }
.picture-panel {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(16,24,40,.05);
}
.picture-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.picture-actions strong { display: block; }
.picture-actions small { display: block; margin-top: 3px; color: var(--muted); }
.hint { margin: -2px 0 0; color: #667085; font-size: 12px; line-height: 1.55; }
.picture-slots { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.picture-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed #cbd5e1;
  border-radius: 22px;
  background: #f8fafc;
  color: #98a2b3;
  overflow: hidden;
  text-align: center;
  font-weight: 850;
  font-size: 12px;
}
.picture-slot img { width: 100%; height: 100%; object-fit: cover; }
.remove-image {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--danger);
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(16,24,40,.16);
}
.preview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #f8fafc;
}
.preview-card .product-card { border: 0; box-shadow: none; border-radius: 0; }

.duplicate-box {
  border: 1px solid #fed7aa;
  border-radius: 26px;
  background: var(--warning-soft);
  padding: 15px;
}
.duplicate-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #7c2d12; }
.duplicate-head span { font-size: 12px; font-weight: 900; }
.duplicate-list { display: grid; gap: 10px; margin-top: 12px; }
.duplicate-card {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  gap: 12px;
  border: 1px solid rgba(251,146,60,.28);
  border-radius: 19px;
  background: rgba(255,255,255,.9);
  padding: 10px;
}
.duplicate-card .mini-image {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  color: #98a2b3;
}
.duplicate-card img { width: 100%; height: 100%; object-fit: cover; }
.duplicate-card h4 { margin: 0; }
.duplicate-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.duplicate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.match { display: inline-flex; border-radius: 999px; background: #ffedd5; color: #9a3412; padding: 4px 8px; font-size: 12px; font-weight: 950; }
.owner-controls { padding-top: 10px; border-top: 1px solid var(--line); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  max-width: min(420px, calc(100% - 44px));
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 22px;
  background: rgba(16,24,40,.94);
  color: #fff;
  box-shadow: 0 18px 45px rgba(16,24,40,.26);
  padding: 14px 16px;
  line-height: 1.45;
  animation: toastIn .2s ease-out;
}
.toast strong { display: block; margin-bottom: 3px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .hero-grid,
  .catalog-layout,
  .owner-layout,
  .product-form { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .picture-panel { max-width: none; }
}
@media (max-width: 760px) {
  .page-shell { width: min(100% - 22px, 1440px); padding-top: 11px; }
  .hero, .panel { border-radius: 28px; padding: 18px; }
  .topbar, .section-title, .catalog-controls, .responsive-title { flex-direction: column; align-items: stretch; }
  .top-actions, .control-row, .button-row.wrap { justify-content: stretch; }
  .owner-link, .ghost-button, .primary-button, .secondary-button { width: 100%; }
  h1 { font-size: clamp(34px, 12vw, 54px); }
  .hero p { font-size: 16px; }
  .hero-card,
  .auth-grid,
  .two-col,
  .product-grid { grid-template-columns: 1fr; }
  .metric.wide { grid-column: auto; }
  .button-row { flex-direction: column; align-items: stretch; }
  .search-box, select { min-width: 100%; }
}
.shop-card .shop-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}
.shop-card .card-actions {
  margin-top: 12px;
}
