/* ===========================
   MTG Shop — Premium Dark Theme
   Mobile-First Design
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ── */
:root {
  --bg-dark: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --gold: #c8a84e;
  --gold-light: #e0c872;
  --gold-dark: #a88a3a;
  --text-white: #f5f5f5;
  --text-muted: #999999;
  --text-dim: #666666;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(200, 168, 78, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.25s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

img {
  display: block;
  max-width: 100%;
}

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
}

.site-header .logo a {
  color: var(--gold);
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--gold);
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--gold-dark);
  color: var(--bg-dark) !important;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.cart-link:hover {
  background: var(--gold);
  transform: translateY(-1px);
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-dark);
}

.site-main {
  flex: 1;
}

/* ══════════════════════════
   LANDING PAGE
   ══════════════════════════ */

.landing-page {
  display: flex;
  flex-direction: column;
}

/* ── Hero Carousel ── */
.hero-section {
  padding: 1rem;
}

.carousel-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-height: 420px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.carousel-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
}

.promo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-slide {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.placeholder-overlay {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.promo-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
}

.placeholder-overlay h2 {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-white);
}

.placeholder-overlay p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
}

.btn-promo {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gold);
  transition: all var(--transition);
  margin-top: 0.5rem;
}

.btn-promo:hover {
  background: transparent;
  color: var(--gold);
}

/* ── Category Cards ── */
.categories-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem 1rem;
  transition: all var(--transition);
  text-align: center;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 168, 78, 0.1);
}

.category-icon {
  font-size: 2rem;
}

.category-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
}

/* ── Quick Search ── */
.quick-search-section {
  padding: 2rem 1rem 3rem;
  text-align: center;
}

.quick-search-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.quick-search-bar {
  display: flex;
  gap: 0.75rem;
  max-width: 600px;
  margin: 0 auto;
}

.quick-search-bar input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-white);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}

.quick-search-bar input::placeholder {
  color: var(--text-dim);
}

.quick-search-bar input:focus {
  outline: none;
  border-color: var(--gold-dark);
}

.btn-search {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--gold-dark);
  color: var(--bg-dark);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all var(--transition);
}

.btn-search:hover {
  background: var(--gold);
}

/* ══════════════════════════
   CATALOG PAGE
   ══════════════════════════ */

.catalog-layout {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.catalog-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.catalog-sidebar h3 {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1rem;
  font-weight: 700;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-group h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.filter-group button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  text-align: left;
  transition: all var(--transition);
}

.filter-group button:hover,
.filter-group button.active {
  background: var(--gold-dark);
  color: var(--bg-dark);
  border-color: var(--gold-dark);
}

.mana-symbols {
  display: flex;
  gap: 0.5rem;
}

.mana {
  width: 36px !important;
  height: 36px;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.mana.w { background: #f9faf4; color: #333; border-color: #f9faf4 !important; }
.mana.u { background: #0e68ab; color: #fff; border-color: #0e68ab !important; }
.mana.b { background: #150b00; color: #ccc; border-color: #555 !important; }
.mana.r { background: #d3202a; color: #fff; border-color: #d3202a !important; }
.mana.g { background: #00733e; color: #fff; border-color: #00733e !important; }

.filter-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-group label input[type="checkbox"] {
  accent-color: var(--gold);
}

.catalog-content {
  flex: 1;
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-white);
  font-size: 0.95rem;
  font-family: var(--font);
  margin-bottom: 1.5rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--gold-dark);
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.product-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.product-image {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
}

.placeholder-image {
  width: 100%;
  aspect-ratio: 5 / 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.product-info {
  padding: 0.75rem;
  text-align: center;
}

.product-info h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.set-code {
  display: inline-block;
  font-size: 0.7rem;
  background: #2a2a2a;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-range {
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 1rem;
}

/* ══════════════════════════
   CHECKOUT PAGE
   ══════════════════════════ */

.checkout-container {
  padding: 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.checkout-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gold);
}

.checkout-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.order-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.order-summary h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.order-summary ul {
  list-style: none;
  padding: 0;
}

.order-summary li {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  font-size: 1.1rem;
  color: var(--gold);
}

.checkout-form {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.checkout-form h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.checkout-form > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold-dark);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-submit:hover:not(:disabled) {
  background: var(--gold-light);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════
   RESPONSIVE — Tablet & Up
   ══════════════════════════ */

@media (min-width: 640px) {
  .site-header {
    padding: 1.25rem 2.5rem;
  }

  .site-header .logo {
    font-size: 1.4rem;
    letter-spacing: 4px;
  }

  .hero-section {
    padding: 1.5rem 2rem;
  }

  .carousel-container {
    aspect-ratio: 16 / 7;
  }

  .placeholder-overlay h2 {
    font-size: 2.25rem;
  }

  .categories-section {
    flex-direction: row;
    padding: 1.5rem 2rem;
  }

  .category-card {
    flex: 1;
    padding: 2.5rem 1rem;
  }

  .quick-search-section {
    padding: 3rem 2rem 4rem;
  }

  .catalog-layout {
    flex-direction: row;
    padding: 2rem;
  }

  .catalog-sidebar {
    width: 240px;
    flex-shrink: 0;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .checkout-layout {
    flex-direction: row;
  }

  .order-summary {
    flex: 1;
  }

  .checkout-form {
    flex: 1.5;
  }
}

/* ══════════════════════════
   RESPONSIVE — Desktop
   ══════════════════════════ */

@media (min-width: 1024px) {
  .site-header {
    padding: 1.25rem 3rem;
  }

  .hero-section {
    padding: 2rem 3rem;
  }

  .carousel-container {
    aspect-ratio: 16 / 6;
    max-height: 480px;
  }

  .placeholder-overlay {
    padding: 3rem;
  }

  .placeholder-overlay h2 {
    font-size: 2.75rem;
  }

  .categories-section {
    padding: 2rem 3rem;
    gap: 1.5rem;
  }

  .category-card {
    padding: 3rem 2rem;
  }

  .category-icon {
    font-size: 2.5rem;
  }

  .category-card h3 {
    font-size: 1.25rem;
  }

  .catalog-layout {
    padding: 2rem 3rem;
  }

  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .checkout-container {
    padding: 2rem 3rem;
  }
}
