:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --primary: #0a84ff;
  --primary-dark: #0067cc;
  --success: #10a66a;
  --danger: #d92d20;
  --warning: #f79009;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  --container: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

body.admin-page {
  background: #f8fafc;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(217, 226, 236, 0.78);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 176px;
  max-height: 54px;
  border-radius: var(--radius);
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  border-radius: var(--radius);
  color: var(--muted);
  padding: 10px 12px;
  font-weight: 650;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(340px, 1fr);
  align-items: center;
  gap: 34px;
  min-height: 540px;
  padding: 34px 0 24px;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 610px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-showcase {
  position: relative;
  display: grid;
  min-height: 420px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(217, 226, 236, 0.78);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.82) 42%, rgba(238, 243, 248, 0.22) 100%),
    url("/assets/images/product-placeholder.svg") right center / min(48%, 360px) no-repeat,
    linear-gradient(145deg, #ffffff, #eef6ff);
  box-shadow: var(--shadow);
}

.hero-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(10, 132, 255, 0.08) 58% 100%);
  pointer-events: none;
}

.hero-showcase img {
  position: relative;
  width: min(72%, 430px);
  border-radius: var(--radius);
  box-shadow: 0 20px 55px rgba(16, 24, 40, 0.08);
}

.hero-offer {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: min(62%, 320px);
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  backdrop-filter: blur(14px);
}

.hero-offer span {
  display: block;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-offer strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}

.hero-actions,
.toolbar,
.form-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-device {
  position: relative;
  min-height: 420px;
  border-radius: 0;
  overflow: hidden;
}

.hero-device::before {
  content: "";
  position: absolute;
  inset: 26px 22px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 70% 25%, rgba(10, 132, 255, 0.24), transparent 34%),
    linear-gradient(145deg, #111827, #303847 55%, #edf4ff 56%);
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

.hero-device::after {
  content: "";
  position: absolute;
  right: 46px;
  bottom: 44px;
  width: min(62%, 270px);
  aspect-ratio: 1;
  border-radius: 32px;
  background: linear-gradient(145deg, #ffffff, #d8ecff);
  box-shadow: 0 24px 70px rgba(10, 132, 255, 0.18);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 760;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.section {
  padding: 34px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.section-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(16, 24, 40, 0.05);
}

.product-media {
  display: grid;
  min-height: 220px;
  place-items: center;
  background: linear-gradient(145deg, #f8fbff, #edf3fa);
}

.product-media img {
  width: 78%;
  height: 190px;
  object-fit: contain;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.product-meta,
.muted {
  color: var(--muted);
}

.product-title {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.3;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.price {
  font-size: 1.2rem;
  font-weight: 850;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: #e7f3ff;
  color: #0057ad;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}

.filters {
  position: sticky;
  top: 92px;
  height: fit-content;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 720;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.textarea {
  min-height: 118px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(0, 1fr);
  gap: 34px;
  padding: 34px 0;
}

.detail-media {
  display: grid;
  min-height: 520px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-media img {
  width: min(84%, 520px);
  max-height: 470px;
  object-fit: contain;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.spec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.spec span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.spec strong {
  display: block;
  margin-top: 3px;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px;
}

.admin-nav {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.admin-nav a,
.admin-nav button {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 12px;
  text-align: left;
  font-weight: 720;
}

.admin-nav a[aria-current="page"],
.admin-nav a:hover,
.admin-nav button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-main {
  padding: 28px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel,
.login-card,
.offline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.05);
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.panel {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: var(--surface-2);
  object-fit: contain;
}

.login-shell,
.offline-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card,
.offline-card {
  width: min(100%, 430px);
  padding: 24px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e8eef5;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.4s infinite;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(92vw, 360px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 980px) {
  .hero,
  .detail-layout,
  .catalog-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .hero-device {
    min-height: 320px;
  }

  .hero-showcase {
    min-height: 360px;
  }

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

  .filters,
  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .brand-logo {
    width: 148px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding-top: 28px;
    min-height: auto;
  }

  .hero-showcase {
    min-height: 300px;
  }

  .hero-offer {
    width: calc(100% - 28px);
    left: 14px;
    bottom: 14px;
  }

  .product-grid,
  .spec-grid,
  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .admin-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-media {
    min-height: 340px;
  }

  .admin-main {
    padding: 18px 12px;
  }
}
