:root {
  --bg-1: #06080f;
  --bg-2: #213205;
  --bg-3: #024450;
  --surface: rgba(10, 14, 22, 0.72);
  --surface-strong: rgba(10, 14, 22, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --text: #f4f7ee;
  --muted: #c6d6bf;
  --accent: #d4ff36;
  --accent-2: #ff7a2f;
  --accent-3: #1ff1ff;
  --danger: #ff4f4f;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, var(--bg-2), transparent 38%),
    radial-gradient(circle at 80% 0%, var(--bg-3), transparent 30%),
    linear-gradient(135deg, var(--bg-1), #0a131e 45%, #12151a);
  overflow-x: hidden;
}

.bg-layers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.blob {
  position: absolute;
  border-radius: 40% 60% 50% 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
}

.blob-a {
  width: 38vw;
  height: 38vw;
  background: #2eff9f;
  top: -8vw;
  left: -10vw;
}

.blob-b {
  width: 30vw;
  height: 30vw;
  background: #ff5f3e;
  right: -8vw;
  top: 18vh;
  animation-duration: 18s;
}

.blob-c {
  width: 36vw;
  height: 36vw;
  background: #13dcff;
  left: 30vw;
  bottom: -16vw;
  animation-duration: 20s;
}

.grid-noise {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 18, 0.66);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: "Bungee Shade", cursive;
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  letter-spacing: 1px;
  color: var(--text);
}

.brand-logo {
  width: clamp(2.7rem, 6vw, 4rem);
  height: clamp(2.7rem, 6vw, 4rem);
  display: block;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  background: #f4ead9;
}

.brand-text {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 0.8rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  color: var(--accent-3);
}

.cart-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-weight: 700;
}

.cart-toggle span {
  margin-left: 0.45rem;
  color: var(--bg-1);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

main {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 3rem;
}

.hero {
  margin-top: 1.6rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  animation: rise 0.7s ease-out;
}

.hero-mark {
  width: clamp(5rem, 10vw, 7.5rem);
  height: clamp(5rem, 10vw, 7.5rem);
  margin-bottom: 0.9rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
}

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

.hero h1 {
  margin: 0.4rem 0;
  font-family: "Bungee Shade", cursive;
  line-height: 1.07;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
}

.hero p {
  color: var(--muted);
  max-width: 66ch;
}

.chip {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-stats {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-stats article {
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.65rem;
  text-align: center;
}

.hero-stats strong {
  display: block;
  font-size: 1.2rem;
  color: var(--accent-3);
}

.controls {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--surface);
}

.control-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.control-row label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 8, 12, 0.5);
  color: var(--text);
  padding: 0.6rem 0.65rem;
  font: inherit;
  min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent-3);
  outline-offset: 1px;
}

.results-meta {
  margin: 0.8rem 0 0;
  color: var(--accent);
  font-weight: 600;
}

.catalog-section {
  margin-top: 1rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.95rem;
}

.product-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: rise 0.6s ease both;
  animation-delay: var(--delay, 0ms);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, transparent 58%, rgba(212, 255, 54, 0.15));
  pointer-events: none;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-body {
  padding: 0.8rem;
  display: grid;
  gap: 0.45rem;
  flex: 1;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.badge.featured {
  color: var(--bg-1);
  background: var(--accent);
  border-color: transparent;
}

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

.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 2.5rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.price-row strong {
  font-size: 1.1rem;
}

.stock-text {
  color: var(--accent-2);
  font-size: 0.82rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 0.62rem 0.9rem;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  transition: transform 0.18s ease, filter 0.18s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: var(--bg-1);
  background: linear-gradient(90deg, var(--accent), #ffe865);
}

.btn-secondary {
  color: #fff;
  background: linear-gradient(100deg, var(--accent-2), #ff4f2f);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-full {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.tracker {
  margin-top: 1.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--surface);
  padding: 1rem;
}

.tracker h2 {
  margin-top: 0;
}

.tracker p {
  color: var(--muted);
}

.tracker-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tracker-result {
  margin-top: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.7rem;
  min-height: 1.5rem;
}

.receipt-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.receipt-brand img {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.receipt-brand strong {
  display: block;
  font-size: 1rem;
}

.receipt-brand span {
  color: var(--muted);
  font-size: 0.8rem;
}

.receipt-grid {
  display: grid;
  gap: 0.55rem;
}

.receipt-grid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  overflow-wrap: anywhere;
}

.receipt-grid span {
  color: var(--muted);
}

.receipt-grid strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(470px, 100%);
  height: 100vh;
  background: var(--surface-strong);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 35;
  padding: 1rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.cart-head h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.cart-items {
  overflow: auto;
  padding-right: 0.2rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.6rem;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.45rem;
  margin-bottom: 0.55rem;
}

.cart-item > div {
  min-width: 0;
}

.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item h4 {
  margin: 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.cart-line-sub {
  margin: 0.2rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cart-line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.qty-controls button {
  border: 0;
  padding: 0.2rem 0.52rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
}

.qty-controls span {
  min-width: 1.9rem;
  text-align: center;
  font-size: 0.83rem;
}

.remove-line {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.79rem;
}

.cart-summary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem;
  display: grid;
  gap: 0.25rem;
}

.cart-summary div {
  display: flex;
  justify-content: space-between;
}

.cart-summary strong {
  color: var(--accent);
}

.checkout-form {
  display: grid;
  gap: 0.5rem;
  overflow: auto;
  padding-bottom: 0.4rem;
}

.checkout-form h3 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.checkout-form label {
  font-size: 0.83rem;
  color: var(--muted);
  display: grid;
  gap: 0.2rem;
}

.checkout-button {
  margin-top: 0.2rem;
}

.checkout-message {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.88rem;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}

.toast-host {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.4rem;
  z-index: 45;
}

.toast {
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 18, 0.9);
  box-shadow: var(--shadow);
  animation: rise 0.24s ease;
}

.toast.success {
  border-color: rgba(212, 255, 54, 0.6);
}

.toast.error {
  border-color: rgba(255, 79, 79, 0.8);
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0) rotate(0deg);
  }
  to {
    transform: translate(4vw, -2vw) rotate(9deg);
  }
}

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
  }

  .brand {
    flex: 1 1 100%;
  }

  .site-nav {
    display: none;
  }

  .control-row {
    grid-template-columns: 1fr 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main {
    width: calc(100% - 1rem);
  }

  .control-row {
    grid-template-columns: 1fr;
  }

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

  .cart-panel {
    padding: 0.7rem;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border-left: 0;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 540px) {
  main {
    width: calc(100% - 0.75rem);
  }

  .site-header {
    padding: 0.75rem 0.8rem;
    gap: 0.65rem;
  }

  .brand {
    justify-content: center;
    text-align: center;
  }

  .cart-toggle {
    width: 100%;
  }

  .hero {
    margin-top: 1rem;
    padding: 1rem;
  }

  .hero-actions .btn,
  .tracker-form .btn,
  .checkout-button {
    width: 100%;
  }

  .tracker-form {
    flex-direction: column;
  }

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

  .cart-head .btn {
    width: 100%;
  }

  .receipt-brand {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .receipt-grid div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .receipt-grid strong {
    text-align: left;
  }

  .toast-host {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .toast {
    width: 100%;
  }
}
