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

:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #242432;
  --border: #2e2e3e;
  --text: #f0f0f5;
  --muted: #888899;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15,15,19,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
#cart-btn {
  cursor: pointer;
  padding: 0.5rem 1.2rem;
  background: var(--surface2);
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background 0.2s;
}
#cart-btn:hover { background: var(--primary); }
#cart-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.75rem;
  margin-left: 4px;
}

/* HERO */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: radial-gradient(ellipse at top, #3b1fa830 0%, transparent 70%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; color: var(--muted); margin-bottom: 2rem; }

/* BUTTONS */
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.full { width: 100%; border-radius: var(--radius); margin-top: 1rem; padding: 0.9rem; }

.btn-secondary {
  display: inline-block;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--border); }
.btn-secondary.full { width: 100%; border-radius: var(--radius); margin-top: 0.5rem; padding: 0.9rem; }

/* GALLERY */
#gallery {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
#gallery h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.gallery-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery-card img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}
.card-info {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-name { font-weight: 600; font-size: 0.95rem; }
.card-price { color: var(--primary); font-weight: 700; }
.card-tag {
  font-size: 0.72rem;
  background: var(--surface2);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 2px;
  display: inline-block;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.modal-close:hover { background: #e53e3e; }
.modal h2 { margin-bottom: 1.5rem; font-size: 1.4rem; }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 640px) { .modal-body { grid-template-columns: 1fr; } }

.canvas-wrap {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#preview-canvas { max-width: 100%; height: auto; display: block; }

.controls { display: flex; flex-direction: column; gap: 0.8rem; }
.controls label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.controls input[type="text"],
.controls input[type="email"],
.controls select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.controls input:focus, .controls select:focus { border-color: var(--primary); }
.controls input[type="range"] { accent-color: var(--primary); width: 100%; }
.color-row { display: flex; align-items: center; gap: 0.8rem; }
.color-row input[type="color"] { width: 44px; height: 36px; border: none; border-radius: 8px; cursor: pointer; background: none; }
.price-tag { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-top: 0.5rem; }

/* CART */
.cart-modal { max-width: 480px; }
.cart-items-list { display: flex; flex-direction: column; gap: 0.8rem; margin: 1rem 0; }
.cart-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface2);
  border-radius: 10px;
  padding: 0.8rem;
}
.cart-item img { width: 56px; height: 80px; object-fit: cover; border-radius: 6px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; }
.cart-item-custom { color: var(--muted); font-size: 0.8rem; }
.cart-item-price { color: var(--primary); font-weight: 700; }
.cart-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; padding: 0 0.3rem; }
.cart-item-remove:hover { color: #e53e3e; }
.cart-total { text-align: right; font-size: 1.2rem; font-weight: 700; padding: 0.5rem 0; border-top: 1px solid var(--border); margin-top: 0.5rem; }
.empty-cart { text-align: center; color: var(--muted); padding: 2rem; }

/* CHECKOUT */
.checkout-modal { max-width: 500px; }
.payment-steps {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.step {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface2);
  transition: all 0.3s;
}
.step.active { background: var(--primary); color: #fff; font-weight: 600; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.form-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.payment-methods { display: flex; gap: 1rem; }
.pm-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.pm-option:has(input:checked) { border-color: var(--primary); }

.pay-amount { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-align: center; margin-bottom: 1rem; }
.qr-box { text-align: center; }
.qr-box img { border-radius: 12px; border: 4px solid #fff; margin-bottom: 0.8rem; }
.qr-note { color: var(--muted); font-size: 0.9rem; }

.success-step { text-align: center; padding: 1rem 0; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.success-step h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.success-step p { color: var(--muted); margin-bottom: 1rem; }

.hidden { display: none !important; }

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
