:root {
  --bg: #98064d;
  --panel: #170713;
  --panel-2: #fff7f1;
  --panel-3: #ffe7d8;
  --line: rgba(255, 255, 255, .28);
  --line-soft: rgba(255, 255, 255, .18);
  --text: #ffffff;
  --dark: #080606;
  --muted: #ffd2e5;
  --aqua: #62f0d0;
  --gold: #fff238;
  --green: #00846b;
  --red: #e41418;
  --blue: #8b6cff;
  --orange: #ff4a12;
  --lime: #eaff2e;
  --ink: var(--text);
  --white: var(--panel);
  --paper: var(--bg);
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, .08), transparent 8rem),
    radial-gradient(circle at 82% 26%, rgba(234, 255, 46, .18), transparent 18rem),
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 18px),
    linear-gradient(135deg, #8f0349, #b70757 44%, #7c0645),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(14px, 4vw, 42px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(107, 0, 54, .82);
  backdrop-filter: blur(18px);
}

.shop-topbar {
  min-height: 74px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark strong {
  display: block;
  font-size: 17px;
  line-height: 1.05;
}

.brand-mark small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #071018;
  background: linear-gradient(135deg, var(--lime), var(--aqua), var(--orange));
  font-weight: 950;
}

.top-search {
  position: relative;
  flex: 1;
}

.top-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--dark);
  background: var(--panel-2);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .14);
}

.top-search input {
  min-height: 48px;
  padding-left: 44px;
  background:
    linear-gradient(90deg, rgba(234, 255, 46, .28), transparent 62%),
    var(--panel-2);
}

.top-search::before {
  content: "⌕";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}

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

.admin-link, .ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--text);
  background: rgba(0, 0, 0, .42);
  text-decoration: none;
  font-weight: 850;
}

.cart-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(94, 234, 212, .34);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--aqua);
  background: rgba(0, 0, 0, .42);
}

.cart-chip span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #071018;
  background: var(--aqua);
  font-weight: 950;
}

.shop-layout {
  padding: 26px 414px 32px clamp(14px, 4vw, 54px);
}

.catalog-panel {
  max-width: 1460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.09), transparent 12rem),
    linear-gradient(135deg, rgba(0, 132, 107, .82), rgba(148, 6, 77, .92) 38%, rgba(234, 255, 46, .18)),
    rgba(151, 5, 79, .96);
  box-shadow: var(--shadow);
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.step-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 28px;
  border-radius: 999px;
  color: #071018;
  background: var(--aqua);
  font-weight: 950;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.catalog-head h1 {
  margin: 0;
  color: var(--lime);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 18px;
}

.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  min-height: 346px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, .72);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.card:hover {
  transform: translateY(-3px);
  outline: 2px solid var(--lime);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .26);
}

.card-media {
  position: relative;
  overflow: hidden;
  margin: 10px 10px 0;
  border: 5px solid #a8cf91;
  background: #d9efc7;
}

.card-media img {
  display: block;
  width: 100%;
  aspect-ratio: 420 / 580;
  object-fit: cover;
}

.code-badge {
  position: absolute;
  left: 9px;
  top: 9px;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--green);
  background: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.card-body {
  display: grid;
  gap: 9px;
  padding: 10px 12px 0;
}

.card-title {
  margin: 0;
  min-height: 40px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.22;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 800;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.price {
  color: var(--aqua);
  font-size: 18px;
  font-weight: 950;
}

.stock {
  color: #ffd2e5;
  font-size: 12px;
  font-weight: 800;
}

.add-button, .primary-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  margin: 12px;
  color: #061213;
  background: linear-gradient(90deg, #ff9f37, var(--lime), var(--aqua));
  font-weight: 950;
  text-transform: uppercase;
}

.add-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .86);
  box-shadow:
    0 0 0 2px rgba(104, 240, 223, .34),
    0 0 22px rgba(98, 240, 208, .72),
    inset 0 0 12px rgba(255, 255, 255, .62);
  background:
    linear-gradient(135deg, rgba(255,255,255,.78), rgba(255,255,255,0) 20% 28%, rgba(255,255,255,.58) 38%, rgba(255,255,255,0) 48%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 4px, rgba(0,0,0,.04) 4px 8px),
    linear-gradient(135deg, #14d2cc 0%, #eaff2e 38%, #ff4a12 66%, #8b6cff 100%);
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.add-button::before {
  content: "";
  position: absolute;
  inset: -34px;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.9), transparent 12%),
    conic-gradient(from 20deg, transparent, rgba(255,255,255,.75), transparent, rgba(98,240,208,.7), transparent);
  opacity: .38;
  transform: rotate(8deg);
}

.add-button::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 5px;
  border: 1px dashed rgba(6, 18, 19, .22);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent);
}

.add-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .42),
    0 0 30px rgba(98, 240, 208, .92),
    inset 0 0 16px rgba(255, 255, 255, .72);
}

.add-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: .45;
  transform: none;
}

.cart-drawer {
  position: fixed;
  right: 24px;
  top: 98px;
  bottom: 24px;
  z-index: 15;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 366px;
  max-width: calc(100vw - 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 3, 8, .94);
  box-shadow: var(--shadow);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 16px;
  background: #050505;
}

.cart-head strong:last-child {
  color: var(--aqua);
  font-size: 20px;
}

.cart-items {
  overflow: auto;
  padding: 10px 14px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
}

.cart-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.cart-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.qty {
  display: flex;
  align-items: center;
  gap: 7px;
}

.qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-3);
  font-weight: 950;
}

.checkout {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

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

.checkout-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.primary-button {
  margin: 0;
  min-height: 48px;
}

.empty {
  color: var(--muted);
  padding: 18px 4px;
  text-align: center;
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
  }

  .brand-mark {
    min-width: 0;
  }

  .top-search {
    order: 3;
    flex-basis: 100%;
  }

  .shop-layout {
    padding-right: 24px;
  }

  .cart-drawer {
    position: static;
    width: auto;
    margin: 18px 24px 30px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .brand-mark strong {
    font-size: 15px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .top-actions {
    margin-left: auto;
  }

  .admin-link {
    display: none;
  }

  .shop-layout {
    padding: 12px;
  }

  .catalog-panel {
    padding: 14px;
  }

  .catalog-head {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  .result-meta {
    justify-content: space-between;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

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

  .card {
    min-height: 354px;
  }

  .card-body {
    padding: 10px 10px 0;
  }

  .card-title {
    min-height: 38px;
    font-size: 13px;
  }

  .pill {
    font-size: 11px;
  }

  .price {
    font-size: 16px;
  }

  .stock {
    font-size: 11px;
  }

  .add-button {
    margin: 10px;
    min-height: 39px;
  }

  .cart-drawer {
    margin: 12px;
  }
}
