@font-face {
  font-family: "Vampire Wars";
  src: url("fonts/Vampire\ Wars.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Nexa";
  src: url("fonts/Nexa-Heavy.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #1c1c1d;
  --surface: #262936;
  --text: #ffffff;
  --muted: #a9adba;
  --primary: #f3f3f5;
  --primary-hover: #ffffff;
  --border: #3a3e4e;
  --font-main: "Nexa", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-title: "Vampire Wars", "Inter", "Helvetica Neue", Arial, sans-serif;
  --title-grad-1: #aca7bd;
  --title-grad-2: #8a84a0;
  --title-grad-3: #68637e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
}

body.checkout-open {
  overflow: hidden;
}

.site-header {
  padding: 1rem 0 0.9rem;
}

.header-content {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  position: relative;
  padding: 0 3rem;
}

.page-shell {
  padding-top: 1.1rem;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.intro-title {
  font-family: var(--font-title);
  transform: scale(0.7);
  transform-origin: center;
  font-size: clamp(2.4rem, 10vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: transparent;
  background-image: linear-gradient(120deg, var(--title-grad-1), var(--title-grad-2), var(--title-grad-3), var(--title-grad-1));
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: titleGradient 6s ease infinite;
  margin: 0;
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.social-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.social-link:hover {
  opacity: 0.8;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: block;
  filter: brightness(0) invert(1);
}

.social-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@keyframes titleGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.layout {
  display: block;
  margin: 1.2rem auto;
}

.menu-toggle {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  cursor: pointer;
}

.menu-line {
  width: 100%;
  height: 2px;
  background: var(--text);
  display: block;
}

.menu-toggle:focus-visible {
  outline: 2px solid #f3f3f5;
  outline-offset: 3px;
}

.cart-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.cart-toggle:focus-visible {
  outline: 2px solid #f3f3f5;
  outline-offset: 3px;
}

.cart-toggle-icon {
  width: 38px;
  height: 38px;
  display: block;
  filter: brightness(0) invert(1);
  transition: transform 0.18s ease;
}

.cart-toggle:hover .cart-toggle-icon {
  transform: scale(1.06);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #d62828;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.cart-count.is-empty {
  display: none;
}

.categories-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  padding: 8.4rem 0.75rem 0.75rem;
  background: rgba(38, 41, 54, 0.58);
  border: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  z-index: 10;
  transform: translateX(-104%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.products-section {
  width: min(860px, 100%);
  margin: 0 auto;
}

body.menu-open .categories-panel {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.category-btn.active {
  background: var(--primary);
  color: #1d1f27;
}

h2 {
  margin: 0 0 1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: none;
  background: #1d1f27;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image-placeholder {
  color: var(--muted);
  font-size: 0.82rem;
}

.card {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.price {
  font-weight: bold;
}

.price-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.price-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.discount-badge {
  background: rgba(214, 40, 40, 0.2);
  color: #ff6f6f;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.stock-info {
  color: var(--muted);
  font-size: 0.86rem;
}

.stock-low {
  color: #ff4d4f;
  font-size: 0.86rem;
  font-weight: 700;
}

.card-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card-actions-row .btn {
  width: 100%;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  font-weight: 500;
  font-family: "Nexa", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.btn.primary {
  background: var(--primary);
  color: #1d1f27;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
}

.btn.outline {
  background: transparent;
  color: var(--text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-panel {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 1rem;
  position: fixed;
  top: 5.8rem;
  right: 1.2rem;
  width: min(360px, calc(100vw - 2.4rem));
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 44;
}

body.cart-open .cart-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.cart-actions {
  margin-top: 0.4rem;
}

.remove {
  border: none;
  background: transparent;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}

.empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.cart-footer {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer {
  padding: 1rem 0 1.5rem;
  color: var(--muted);
  text-align: center;
}

.checkout-modal {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 80;
}

body.checkout-open .checkout-modal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.checkout-dialog {
  position: relative;
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  padding: 1rem;
  background: var(--surface);
  overflow-y: auto;
}

.checkout-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.checkout-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.field-input {
  border: 1px solid var(--border);
  background: #1d1f27;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font: inherit;
}

.payment-options {
  border: 1px solid var(--border);
  padding: 0.7rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.checkout-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 900px) {
  .header-content {
    padding: 0 2.9rem;
  }

  .categories-panel {
    width: min(260px, calc(100vw - 2rem));
    padding-top: 8rem;
  }

  .products-section {
    width: 100%;
  }

  .checkout-grid,
  .checkout-grid.two-cols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-title {
    animation: none;
    color: var(--text);
    background: none;
  }

}