/* JoyKings Store — Design System */

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

:root {
  --gold: #D4A017;
  --deep-gold: #B8860B;
  --warm-black: #1A1A1A;
  --rich-brown: #3D2B1F;
  --cream: #FFF8E7;
  --amber: #FFBF00;
  --soft-white: #FFFDF5;
  --card-bg: #222222;
  --card-border: rgba(212, 160, 23, 0.12);
  --text-muted: rgba(255, 248, 231, 0.55);
  --nav-height: 64px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--warm-black);
  color: var(--cream);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--amber); }

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 160, 23, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cream);
  opacity: 0.7;
  transition: opacity 0.2s;
  letter-spacing: 0.03em;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: var(--gold);
}

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--gold);
  color: var(--warm-black);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Page Container ===== */
.page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Page Header ===== */
.page-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.category-tab {
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(255, 248, 231, 0.1);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tab:hover {
  border-color: rgba(212, 160, 23, 0.3);
  color: var(--cream);
}

.category-tab.active {
  background: var(--gold);
  color: var(--warm-black);
  border-color: var(--gold);
  font-weight: 600;
}

/* ===== Product Grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding-bottom: 4rem;
}

/* ===== Product Card ===== */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  border-color: rgba(212, 160, 23, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.product-card-image {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #1e1e1e 0%, #2a2218 40%, #1e1a14 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.product-card-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A017' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.product-card-icon {
  font-size: 4rem;
  color: var(--gold);
  opacity: 0.15;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: serif;
}

.product-card-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
}

.product-card-visual-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--cream);
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

.product-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.product-card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--cream);
}

.product-card-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.product-card-price {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold);
}

.product-card-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.product-card-btn:hover {
  background: var(--gold);
  color: var(--warm-black);
}

/* ===== Product Detail ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 3rem 0 5rem;
  align-items: start;
}

.product-detail-image {
  aspect-ratio: 1;
  background: linear-gradient(145deg, #1e1e1e 0%, #2a2218 40%, #1e1a14 100%);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.product-detail-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A017' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.product-detail-icon {
  font-size: 8rem;
  color: var(--gold);
  opacity: 0.12;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.product-detail-visual-category {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  position: relative;
  z-index: 1;
  margin-bottom: 0.75rem;
}

.product-detail-visual-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--cream);
  position: relative;
  z-index: 1;
}

.product-detail-info {
  padding-top: 1rem;
}

.product-detail-info h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.product-detail-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.product-detail-price {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 2rem;
}

.product-detail-description {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 248, 231, 0.7);
  margin-bottom: 2.5rem;
}

/* Size Selector */
.size-selector {
  margin-bottom: 2rem;
}

.size-selector-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.size-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.size-btn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 248, 231, 0.15);
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-btn:hover {
  border-color: rgba(212, 160, 23, 0.4);
}

.size-btn.selected {
  background: var(--gold);
  color: var(--warm-black);
  border-color: var(--gold);
}

.size-btn.wide {
  width: auto;
  padding: 0 1rem;
}

/* Quantity */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quantity-selector-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 248, 231, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--cream);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: rgba(212, 160, 23, 0.15);
}

.qty-value {
  width: 48px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  border-left: 1px solid rgba(255, 248, 231, 0.1);
  border-right: 1px solid rgba(255, 248, 231, 0.1);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--warm-black);
  width: 100%;
}

.btn-primary:hover {
  background: var(--amber);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 160, 23, 0.3);
  color: var(--warm-black);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn-secondary:hover {
  background: rgba(212, 160, 23, 0.1);
  color: var(--gold);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* ===== Cart ===== */
.cart-empty {
  text-align: center;
  padding: 5rem 2rem;
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.cart-empty h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.cart-empty p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  padding: 2rem 0 5rem;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  background: linear-gradient(145deg, #1e1e1e, #2a2218);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cart-item-icon {
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.2;
}

.cart-item-details h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.cart-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 248, 231, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--cream);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-qty button:hover {
  background: rgba(212, 160, 23, 0.1);
}

.cart-item-qty span {
  width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 1px solid rgba(255, 248, 231, 0.08);
  border-right: 1px solid rgba(255, 248, 231, 0.08);
}

.cart-item-remove {
  background: none;
  border: none;
  color: rgba(255, 248, 231, 0.3);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: #ff6b6b;
}

.cart-item-right {
  text-align: right;
}

.cart-item-price {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* Cart Summary */
.cart-summary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

.cart-summary h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 248, 231, 0.08);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  padding-top: 1rem;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255, 248, 231, 0.08);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.cart-summary-row.total .amount {
  color: var(--gold);
}

.cart-summary .btn {
  margin-top: 1.5rem;
}

.cart-summary-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ===== Success Page ===== */
.success-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.success-crown {
  font-size: 5rem;
  margin-bottom: 2rem;
  animation: crownBounce 1s ease-out;
}

@keyframes crownBounce {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.success-page h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.success-page h1 .gold { color: var(--gold); }

.success-page p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: var(--warm-black);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
.store-footer {
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 248, 231, 0.06);
  background: #0A0A0A;
}

.store-footer .footer-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.store-footer p {
  font-size: 0.8rem;
  color: rgba(255, 248, 231, 0.3);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 160, 23, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav { padding: 0 1rem; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(212, 160, 23, 0.1);
  }

  .nav-links.open { display: flex; }
  .nav-mobile-toggle { display: block; }

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

  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }

  .cart-item-right {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .container { padding: 0 1rem; }
}

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

  .product-card-image {
    aspect-ratio: 4/3;
  }
}
