*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #10101c;
  --bg-surface: #16162a;
  --bg-surface-hover: #1e1e3a;
  --bg-card: #141428;
  --accent: #00d4aa;
  --accent-hover: #00e6b8;
  --accent-dim: rgba(0, 212, 170, 0.1);
  --purple: #7c3aed;
  --purple-hover: #8b5cf6;
  --danger: #ef4444;
  --danger-hover: #f87171;
  --success: #10b981;
  --warning: #f59e0b;
  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --border: #2a2a4a;
  --border-light: #1e1e3a;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15);
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.scroll-locked {
  overflow: hidden;
}

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.header__logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.4));
}

.header__cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.header__cart-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.header__cart-btn svg {
  width: 22px;
  height: 22px;
}

.header__cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.header__cart-badge:empty {
  display: none;
}

.header__cart-badge.bump {
  animation: bump 0.3s ease;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
}

.hero__content {
  max-width: 560px;
  z-index: 1;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero__subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 212, 170, 0.45);
}

.hero__decoration {
  position: relative;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
}

.hero__cube {
  position: absolute;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius-lg);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  animation: float 6s ease-in-out infinite;
  opacity: 0.15;
  filter: blur(1px);
}

.hero__cube--small {
  width: 70px;
  height: 70px;
  top: 20%;
  left: 30%;
  animation-delay: -2s;
  opacity: 0.1;
}

.hero__cube--delay {
  width: 90px;
  height: 90px;
  top: 65%;
  left: 65%;
  animation-delay: -4s;
  opacity: 0.12;
  background: linear-gradient(135deg, var(--purple), var(--accent));
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) rotate(45deg) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(45deg) translateY(-20px); }
}

/* ========== CATALOG ========== */
.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.catalog__title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ========== PRODUCT CARD ========== */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.product-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: var(--bg-secondary);
  overflow: hidden;
}

.product-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__thumb img {
  transform: scale(1.08);
}

.product-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.product-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex: 1;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card__price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.product-card__add-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1.3rem;
  line-height: 1;
}

.product-card__add-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ========== CART ========== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.cart.active {
  transform: translateX(0);
}

.cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.cart__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.cart__close:hover {
  background: var(--danger);
  color: white;
}

.cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

.cart__empty-icon {
  width: 56px;
  height: 56px;
  opacity: 0.3;
  margin-bottom: 8px;
}

.cart__empty p {
  font-size: 1rem;
  color: var(--text-secondary);
}

.cart__empty span {
  font-size: 0.85rem;
}

.cart__items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart__item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.cart__item:hover {
  border-color: var(--border);
}

.cart__item-info {
  flex: 1;
  min-width: 0;
}

.cart__item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart__item-price {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.cart__item-options {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cart__item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart__qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.cart__qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cart__qty {
  min-width: 28px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cart__remove-btn {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  margin-left: 4px;
}

.cart__remove-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.cart__item-subtotal {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.cart__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  display: none;
}

.cart__footer.visible {
  display: block;
}

.cart__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.cart__total span:first-child {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.cart__total span:last-child {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: var(--bg-primary);
}

.btn--primary:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 14px 36px;
  font-size: 1rem;
}

.btn--full {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
}

.btn__icon {
  width: 20px;
  height: 20px;
}

/* ========== CHECKOUT ========== */
.checkout {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.checkout.active {
  display: block;
}

.checkout__container {
  animation: fadeIn 0.4s ease;
}

.checkout__back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 24px;
  font-family: inherit;
  transition: color var(--transition);
}

.checkout__back:hover {
  color: var(--accent);
}

.checkout__title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.checkout__desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.checkout__summary {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.checkout__summary h4 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.checkout__summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout__summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.checkout__summary-item span:last-child {
  color: var(--text-secondary);
}

.checkout__summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 1.05rem;
}

.checkout__summary-total span:last-child {
  color: var(--accent);
  font-size: 1.2rem;
}

/* ========== FORM ========== */
.checkout__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row--3col {
  grid-template-columns: 2fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group--wide {
  /* naturally wider in 3col */
}

.form-group--small input {
  min-width: 0;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input.error {
  border-color: var(--danger);
}

.form-group input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  min-height: 0;
  opacity: 0;
  transition: all var(--transition);
}

.form-error.visible {
  opacity: 1;
  min-height: 18px;
}

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-fieldset legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.toast {
  padding: 14px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.35s ease;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast--success {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.toast--error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.removing {
  animation: slideOutRight 0.3s ease forwards;
}

/* ========== SPINNER ========== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.lightbox.active {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lightbox__close:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.lightbox__img {
  position: relative;
  z-index: 5;
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0, 212, 170, 0.1);
  animation: scaleIn 0.3s ease;
}

.lightbox__caption {
  position: relative;
  z-index: 5;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(80px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 60px 24px 40px;
  }

  .hero__subtitle {
    max-width: 100%;
  }

  .hero__decoration {
    width: 200px;
    height: 200px;
  }

  .hero__cube { width: 90px; height: 90px; }
  .hero__cube--small { width: 50px; height: 50px; }
  .hero__cube--delay { width: 65px; height: 65px; }

  .catalog__grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .catalog__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cart {
    width: 100vw;
  }

  .form-row,
  .form-row--3col {
    grid-template-columns: 1fr;
  }

  .form-fieldset {
    padding: 16px;
  }

  .checkout__title {
    font-size: 1.4rem;
  }

.product-card__options {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.product-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-card__select {
  padding: 4px 24px 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color var(--transition);
}

.product-card__select:hover {
  border-color: var(--accent);
}

.product-card__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.product-card__body {
    padding: 14px;
  }

  .product-card__name {
    font-size: 0.95rem;
  }

  .product-card__price {
    font-size: 1.1rem;
  }
}

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

  .hero {
    padding: 40px 16px 30px;
  }

  .hero__title {
    font-size: 1.6rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .header__inner {
    padding: 0 16px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }
}
