:root {
  --bg: #070b18;
  --bg-elev: #111a33;
  --card: #111c37;
  --card-strong: #0f1730;
  --text: #ebf0ff;
  --muted: #9ba9cf;
  --line: rgba(148, 165, 217, 0.24);
  --brand: #25d0ff;
  --brand-deep: #1f74ff;
  --accent: #ff8a3d;
  --success: #2dde9f;
  --danger: #ff6f6f;
  --white: #ffffff;
  --shadow: 0 24px 54px rgba(0, 8, 28, 0.46);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(31, 116, 255, 0.25), transparent 38%),
    radial-gradient(circle at 84% 28%, rgba(37, 208, 255, 0.18), transparent 41%),
    var(--bg);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at 50% 56%, rgba(74, 120, 232, 0.2) 0%, rgba(18, 28, 58, 0) 52%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.08;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.45) 0.6px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.2) 0.5px, transparent 0.6px);
  background-size: 4px 4px, 6px 6px;
  background-position: 0 0, 2px 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Exo 2', sans-serif;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
  line-height: 1.6;
}

code {
  font-size: 0.9em;
  background: rgba(37, 208, 255, 0.16);
  border-radius: 0.4rem;
  padding: 0.1rem 0.35rem;
}

.container {
  width: min(1160px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.background-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(93, 113, 177, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 113, 177, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 40%, black 45%, transparent 100%);
  opacity: 0.6;
}

.background-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.35;
  z-index: -2;
}

.orb-1 {
  width: 360px;
  height: 360px;
  background: #1f74ff;
  top: -90px;
  left: -80px;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: #ff8a3d;
  right: -100px;
  top: 120px;
}

.site-header,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #031322;
  font-weight: 800;
}

.admin-link,
.back-link,
.table-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.header-contacts,
.footer-contacts {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(143, 166, 233, 0.3);
  background: rgba(15, 24, 49, 0.55);
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.subtle-link {
  color: var(--muted);
  border: 1px solid rgba(143, 166, 233, 0.28);
  background: rgba(16, 27, 56, 0.5);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
}

.hero {
  margin: 2rem 0 2.1rem;
  display: grid;
  gap: 0.75rem;
  max-width: 760px;
}

.hero-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-kicker-natural {
  text-transform: none;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.06;
}

.hero p {
  color: var(--muted);
  max-width: 690px;
}

.trustbar {
  margin: 30px 0 40px;
  position: relative;
}

.trustbar__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 30px;
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trustbar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.trustbar__icon {
  font-size: 22px;
  filter: drop-shadow(0 6px 20px rgba(80, 180, 255, 0.4));
}

.trustbar__icon-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.trustbar__text {
  font-size: 14px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.82);
}

.trustbar::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 2px;
  background: radial-gradient(circle, rgba(80, 200, 255, 0.9), rgba(80, 200, 255, 0.25), rgba(80, 200, 255, 0));
}

.warning-banner,
.success-box,
.error-box {
  border-radius: 15px;
  padding: 0.95rem 1rem;
  margin: 1rem 0;
  font-weight: 600;
}

.warning-banner {
  color: #ffd4a7;
  border: 1px solid rgba(255, 155, 69, 0.35);
  background: rgba(84, 45, 14, 0.56);
}

.success-box {
  color: #b7ffe3;
  border: 1px solid rgba(45, 222, 159, 0.35);
  background: rgba(14, 67, 49, 0.54);
}

.error-box {
  color: #ffd2d2;
  border: 1px solid rgba(255, 111, 111, 0.35);
  background: rgba(88, 21, 21, 0.54);
}

.toolbar {
  display: grid;
  gap: 0.85rem;
  margin: 2rem 0 1.3rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
}

button,
.admin-link,
.filter-btn,
.outline-btn {
  border: none;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn {
  background: rgba(148, 165, 217, 0.16);
  color: var(--text);
  border: 1px solid transparent;
}

.filter-btn.active {
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #031322;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 1rem;
  padding-bottom: 2.5rem;
  position: relative;
  isolation: isolate;
}

.catalog::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(980px, 95%);
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(37, 208, 255, 0.15) 0%, rgba(37, 208, 255, 0.05) 36%, transparent 72%);
  filter: blur(18px);
  z-index: -1;
}

.model-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(170deg, rgba(21, 32, 65, 0.95), rgba(11, 17, 35, 0.95));
  border: 1px solid rgba(109, 129, 191, 0.22);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.model-card:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 208, 255, 0.5);
}

.image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  display: block;
}

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

.category-pill,
.promo-badge {
  position: absolute;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  backdrop-filter: blur(6px);
}

.category-pill {
  left: 0.72rem;
  top: 0.72rem;
  color: #eaf4ff;
  background: rgba(7, 12, 30, 0.72);
  border: 1px solid rgba(180, 199, 255, 0.36);
}

.promo-badge {
  right: 0.72rem;
  top: 0.72rem;
  color: #fff6ef;
  background: rgba(232, 140, 84, 0.78);
  border: 1px solid rgba(255, 210, 180, 0.45);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.72rem;
  padding: 1rem;
}

.product-title-link {
  color: var(--text);
  text-decoration: none;
}

.card-body h3 {
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-body p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

.card-footer {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.price-box,
.detail-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.old-price {
  font-size: 0.9rem;
  color: #ffb9b9;
  text-decoration: line-through;
  text-decoration-thickness: 1.7px;
}

.price {
  font-size: 1.34rem;
  font-weight: 800;
  color: #dff7ff;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.order-btn,
.submit-order,
button {
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #041224;
  text-decoration: none;
}

.order-btn,
.submit-order {
  border: 1px solid rgba(150, 236, 255, 0.35);
  box-shadow: 0 10px 22px rgba(24, 102, 255, 0.26), inset 0 1px 0 rgba(224, 251, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.order-btn:hover,
.submit-order:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 0 0 1px rgba(140, 236, 255, 0.45), 0 16px 30px rgba(22, 116, 255, 0.34);
}

.outline-btn,
.danger-outline {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(143, 166, 233, 0.42);
  color: var(--text);
  background: transparent;
}

.detail-order-btn {
  width: fit-content;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  padding: 1rem;
}

.modal[aria-hidden='false'] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(470px, 100%);
  background: linear-gradient(180deg, #142047 0%, #101936 100%);
  border: 1px solid rgba(130, 151, 212, 0.36);
  border-radius: 18px;
  padding: 1rem;
  position: relative;
  box-shadow: var(--shadow);
}

.close-modal {
  position: absolute;
  right: 0.68rem;
  top: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

.modal-model {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.telegram-deeplink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
}

.disabled-link {
  opacity: 0.65;
  pointer-events: none;
}

.field-error {
  min-height: 1rem;
  color: #ffb0b0;
  font-size: 0.78rem;
  line-height: 1.3;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  font: inherit;
  color: var(--text);
  background: rgba(10, 17, 38, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(37, 208, 255, 0.35);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
}

#orderForm,
.stack-form,
.login-form {
  display: grid;
  gap: 0.75rem;
}

.order-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.order-status.error {
  color: #ffb0b0;
}

.order-status.success {
  color: #9dffd8;
}

.site-footer {
  border-top: 1px solid rgba(130, 151, 212, 0.22);
  margin-top: 1.8rem;
  background: rgba(7, 12, 30, 0.56);
}

.footer-inner {
  padding: 1rem 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-open {
  overflow: hidden;
}

.admin-page {
  background:
    radial-gradient(circle at 16% 0%, rgba(31, 116, 255, 0.24), transparent 33%),
    radial-gradient(circle at 84% 12%, rgba(37, 208, 255, 0.2), transparent 34%),
    #070b18;
}

.login-shell {
  width: min(450px, calc(100% - 2rem));
  margin: 8vh auto;
  background: linear-gradient(180deg, #16214a 0%, #111a38 100%);
  border: 1px solid rgba(133, 154, 219, 0.34);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.9rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.panel {
  background: linear-gradient(175deg, rgba(20, 30, 60, 0.95), rgba(11, 18, 37, 0.95));
  border: 1px solid rgba(130, 151, 212, 0.25);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
}

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

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tiny-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.inline-category-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px auto;
  gap: 0.5rem;
  align-items: center;
}

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

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

.admin-table th,
.admin-table td {
  padding: 0.62rem;
  border-bottom: 1px solid rgba(130, 151, 212, 0.2);
  text-align: left;
  font-size: 0.91rem;
}

.product-layout {
  margin: 1rem 0 2.5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
}

.gallery-panel,
.detail-panel {
  border: 1px solid rgba(130, 151, 212, 0.26);
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(20, 30, 60, 0.95), rgba(11, 18, 37, 0.95));
  box-shadow: var(--shadow);
  padding: 1rem;
}

.gallery-main-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(130, 151, 212, 0.22);
  margin-bottom: 0.7rem;
  position: relative;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 0.5rem;
}

.thumb-btn {
  border: 1px solid rgba(130, 151, 212, 0.24);
  background: rgba(255, 255, 255, 0.03);
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
}

.thumb-btn.active {
  border-color: rgba(37, 208, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(37, 208, 255, 0.26);
}

.thumb-btn img {
  width: 100%;
  height: 74px;
  object-fit: cover;
  display: block;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.detail-description {
  color: var(--muted);
}

.product-badge {
  top: 0.8rem;
  right: 0.8rem;
}

@media (max-width: 980px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .trustbar__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .site-header,
  .admin-header {
    padding: 1rem 0;
  }

  .hero {
    margin-top: 1rem;
  }

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

  .card-actions {
    flex-direction: column;
  }

  .outline-btn,
  .order-btn {
    width: 100%;
  }

  .modal-actions .outline-btn,
  .modal-actions .submit-order {
    width: 100%;
  }

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

  .two-cols {
    grid-template-columns: 1fr;
  }

  .inline-category-form {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .trustbar__inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
