/* ─── APP SHELL ─── */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--fg);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); }

.nav-cart { color: var(--accent); }
.nav-cart:hover { color: var(--fg); }

.cart-count {
  display: inline-block;
  background: var(--accent);
  color: #0f0f0f;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  text-align: center;
  line-height: 18px;
  margin-left: 4px;
  vertical-align: middle;
}

.app-main {
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

/* ─── PAGE HEADER ─── */
.page-header {
  padding: 80px 48px 60px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.page-header h1 .accent {
  color: var(--accent);
  font-style: italic;
  font-family: var(--font-body);
  font-weight: 400;
}

.page-sub {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.6;
}

/* ─── BREADCRUMB ─── */
.breadcrumb {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 40px;
  padding-top: 40px;
}
.breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }

/* ─── COLLECTIONS GRID ─── */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding-top: 2px;
  padding-bottom: 80px;
}

.collection-card {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  text-decoration: none;
  display: block;
  background: var(--bg-elevated);
  transition: transform 0.3s ease;
}

.collection-card:hover { transform: scale(1.01); }

.collection-card-wide {
  grid-column: span 2;
  aspect-ratio: 8/3;
}

.collection-card-bg {
  position: absolute;
  inset: 0;
}

.collection-card-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
}

/* Pattern variations per collection */
.collection-pattern-wedding {
  background: radial-gradient(circle at 30% 50%, #d4a853 0%, transparent 60%),
              radial-gradient(circle at 70% 30%, #c084fc 0%, transparent 50%);
}
.collection-pattern-corporate {
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 20px,
    rgba(212,168,83,0.4) 20px, rgba(212,168,83,0.4) 21px
  );
}
.collection-pattern-birthday {
  background: radial-gradient(circle at 20% 80%, #f87171 0%, transparent 40%),
              radial-gradient(circle at 80% 20%, #34d399 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, #d4a853 0%, transparent 30%);
}
.collection-pattern-holiday {
  background: radial-gradient(circle at 50% 50%, rgba(212,168,83,0.6) 0%, transparent 50%);
}
.collection-pattern-custom {
  background: linear-gradient(135deg, rgba(212,168,83,0.2) 0%, transparent 50%, rgba(192,132,252,0.1) 100%);
}

.collection-card-body {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.collection-number {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
}

.collection-card-content h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--fg);
}

.collection-tagline {
  color: var(--fg-muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.collection-price-range {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
}

.collection-arrow {
  font-size: 24px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s, transform 0.2s;
  align-self: flex-end;
}

.collection-card:hover .collection-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ─── COLLECTION HEADER ─── */
.collection-header {
  padding: 80px 48px 60px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.collection-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.collection-desc {
  color: var(--fg-muted);
  font-size: 17px;
  max-width: 560px;
  line-height: 1.7;
}

/* ─── PRODUCTS GRID ─── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 60px;
  padding-bottom: 80px;
}

.product-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.product-card:hover {
  border-color: rgba(212,168,83,0.3);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.product-card-image {
  aspect-ratio: 4/3;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-placeholder::before {
  content: '';
  position: absolute;
  inset: 20px;
  border: 2px solid rgba(212,168,83,0.2);
  border-radius: 8px;
}

.product-placeholder-wedding { background: linear-gradient(135deg, #1a1218 0%, #0f0f0f 100%); }
.product-placeholder-corporate { background: linear-gradient(135deg, #11161a 0%, #0f0f0f 100%); }
.product-placeholder-birthday { background: linear-gradient(135deg, #1a1110 0%, #0f0f0f 100%); }
.product-placeholder-holiday { background: linear-gradient(135deg, #111a12 0%, #0f0f0f 100%); }
.product-placeholder-custom { background: linear-gradient(135deg, #16111a 0%, #0f0f0f 100%); }

.product-placeholder-text {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  color: rgba(212,168,83,0.2);
  z-index: 1;
}

/* AI-generated product images */
.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

/* Collection hero photos */
.collection-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition: opacity 0.4s ease, transform 0.6s ease;
}

.collection-card:hover .collection-card-photo {
  opacity: 0.6;
  transform: scale(1.03);
}

.collection-card-photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,0.7) 0%, rgba(10,10,10,0.3) 100%);
}

.product-card-body {
  padding: 24px;
}

.product-card-body h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-desc-short {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
}

.product-tag {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--accent);
  border: 1px solid rgba(212,168,83,0.3);
  padding: 3px 8px;
}

.btn-add-to-cart {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid rgba(212,168,83,0.3);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-transform: uppercase;
}

.btn-add-to-cart:hover {
  background: var(--accent);
  color: #0f0f0f;
  border-color: var(--accent);
}

/* ─── PRODUCT DETAIL ─── */
.product-detail {
  padding-bottom: 80px;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.product-preview-col { position: sticky; top: 88px; }

.preview-container {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  aspect-ratio: 1;
  overflow: hidden;
}

.preview-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(15,15,15,0.8);
  padding: 5px 10px;
  border: 1px solid rgba(212,168,83,0.3);
}

.product-collection-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 16px;
}

.product-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.product-price-large {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}

.product-description {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-muted);
  margin-bottom: 36px;
}

/* ─── CUSTOMIZER ─── */
.customizer-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 36px;
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
}

.customizer-section {}

.customizer-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.optional {
  font-weight: 400;
  color: rgba(138,133,128,0.6);
}

.customizer-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--fg);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.customizer-input:focus {
  border-color: var(--accent);
}

.customizer-input::placeholder { color: rgba(138,133,128,0.5); }

.color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch, .bg-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  padding: 0;
}

.color-swatch:hover, .bg-swatch:hover { transform: scale(1.15); }
.color-swatch.active, .bg-swatch.active { border-color: var(--accent); }

.upload-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

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

.upload-hint {
  font-size: 12px;
  color: rgba(138,133,128,0.5);
  margin-top: 8px;
}

/* ─── ADD TO CART ─── */
.add-to-cart-section {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255,255,255,0.1);
}

.qty-btn {
  width: 40px;
  height: 48px;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.qty-btn:hover { color: var(--fg); background: rgba(255,255,255,0.04); }

.qty-value {
  min-width: 36px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.lead-time {
  font-size: 13px;
  color: rgba(138,133,128,0.6);
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #0f0f0f;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-large { padding: 16px 40px; font-size: 14px; }
.btn-block { width: 100%; text-align: center; }

.btn-ghost {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── CART ─── */
.cart-page {
  padding-top: 60px;
  padding-bottom: 80px;
}

.cart-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 48px;
}

.cart-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--fg-muted);
  font-size: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255,255,255,0.04);
}

.cart-item {
  background: var(--bg);
  display: flex;
  gap: 20px;
  padding: 24px;
  align-items: center;
  transition: opacity 0.2s;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: var(--bg-elevated);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-placeholder {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: rgba(212,168,83,0.3);
}

.cart-item-info { flex: 1; }

.cart-item-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-collection {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
}

.cart-item-custom {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
  margin-bottom: 4px;
}

.cart-item-qty {
  font-size: 13px;
  color: var(--fg-muted);
}

.cart-item-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cart-item-price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.remove-btn {
  background: transparent;
  border: none;
  color: rgba(138,133,128,0.5);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: 1px;
  padding: 0;
  transition: color 0.2s;
}

.remove-btn:hover { color: #f87171; }

/* ─── CART SUMMARY ─── */
.summary-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 32px;
  position: sticky;
  top: 88px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-family: var(--font-display);
  font-size: 14px;
}

.summary-row-muted { color: var(--fg-muted); font-size: 13px; }

.summary-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 12px 0;
}

.summary-row-total {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.continue-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fg-muted);
  text-decoration: none;
}

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

/* ─── SUCCESS PAGE ─── */
.success-page {
  padding-top: 80px;
  padding-bottom: 80px;
  display: flex;
  justify-content: center;
}

.success-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  padding: 60px 48px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
}

.success-icon {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 24px;
}

.success-card h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.success-sub {
  font-size: 17px;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.success-detail {
  font-size: 15px;
  color: rgba(138,133,128,0.7);
  line-height: 1.7;
  margin-bottom: 36px;
}

.success-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── ERROR PAGE ─── */
.page-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 28px;
  text-align: center;
}

.error-msg {
  font-size: 18px;
  color: var(--fg-muted);
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg-elevated);
  border: 1px solid rgba(212,168,83,0.4);
  color: var(--fg);
  padding: 14px 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ─── TEMPLATE SELECTOR ─── */
.template-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-cat-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(138,133,128,0.5);
  text-transform: uppercase;
}

.template-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  width: 88px;
  flex-shrink: 0;
}

.template-btn:hover {
  border-color: rgba(212,168,83,0.4);
  transform: translateY(-1px);
}

.template-btn.active {
  border-color: var(--accent);
  background: rgba(212,168,83,0.06);
}

.template-btn canvas {
  display: block;
  width: 72px;
  height: 72px;
  border: none;
}

.template-btn-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 76px;
}

.template-btn.active .template-btn-label {
  color: var(--accent);
}

/* ─── ADMIN ─── */
@media (max-width: 900px) {
  .collections-grid { grid-template-columns: 1fr; }
  .collection-card-wide { grid-column: span 1; aspect-ratio: 4/3; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .product-preview-col { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}

@media (max-width: 600px) {
  .nav-inner { padding: 0 20px; }
  .container { padding: 0 20px; }
  .page-header { padding: 60px 20px 40px; }
  .collection-header { padding: 60px 20px 40px; }
  .products-grid { grid-template-columns: 1fr; }
  .add-to-cart-section { flex-direction: column; align-items: stretch; }
  .success-actions { flex-direction: column; }
  .success-card { padding: 40px 24px; }
  .cart-item { flex-wrap: wrap; }
}
