:root {
  --shop-bg-1: #060912;
  --shop-bg-2: #0d1424;
  --shop-panel: rgba(11, 18, 32, 0.82);
  --shop-border: rgba(255,255,255,0.08);
  --shop-text: #eef4ff;
  --shop-muted: #9db0cf;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--shop-text);
  background:
    radial-gradient(circle at top left, rgba(88, 120, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(17, 182, 255, 0.11), transparent 26%),
    linear-gradient(180deg, var(--shop-bg-2), var(--shop-bg-1));
}

.shop-shell-inner {
  width: min(1380px, calc(100% - 18px));
}

.shop-page-main {
  padding-bottom: 34px;
}

.shop-intro-card,
.shop-grid-section {
  border: 1px solid var(--shop-border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    var(--shop-panel);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}

.shop-intro-card {
  padding: 24px;
  margin-top: 18px;
}

.shop-intro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(121,168,255,0.14);
  color: #dce9ff;
  border: 1px solid rgba(121,168,255,0.22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-intro-card h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
}

.shop-intro-card p {
  margin: 0;
  color: var(--shop-muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 760px;
}

.shop-grid-section {
  margin-top: 18px;
  padding: 20px;
}

.shop-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.shop-section-header h2 {
  margin: 0;
  font-size: 24px;
  color: #fff;
}

.shop-grid-meta {
  color: var(--shop-muted);
  font-size: 13px;
  font-weight: 700;
}

.shop-empty {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--shop-border);
  background: rgba(11,18,32,0.7);
  color: var(--shop-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.product-card,
.product-card * {
  text-shadow: none !important;
  box-sizing: border-box;
}

.product-card {
  position: relative;
  min-width: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.98) !important;
  border: 1px solid rgba(148,163,184,0.38) !important;
  box-shadow: 0 10px 24px rgba(15,23,42,0.14) !important;
}

.product-card-inner {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
  display: block;
}

.product-card.is-sold-out .product-image {
  opacity: 0.7;
}

.edition-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.12em;
  color: #1e293b !important;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.edition-royalty { background: #facc15; }
.edition-investor { background: #a855f7; color: #fff !important; }
.edition-founder { background: #3b82f6; color: #fff !important; }

.card-sold-out-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff !important;
  background: rgba(15,23,42,0.94) !important;
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 2;
}

.product-header {
  display: block;
  margin-top: 10px;
  min-width: 0;
}

.product-title-wrap {
  min-width: 0;
}

.product-title,
.product-card h3.product-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a !important;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-subtitle,
.product-card p.product-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: #475569 !important;
  font-weight: 600 !important;
}

.product-inventory-meta {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inventory-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

.inventory-chip.inventory-chip-next {
  color: #1e3a8a !important;
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}

.quantity-strip {
  margin-top: 10px;
  padding: 8px 10px;
  background: #0f172a;
  border-radius: 10px;
  border: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.product-card.is-sold-out .quantity-strip {
  background: #3a1414;
  border-color: #5b1d1d;
}

.quantity-flash-soft { animation: qSoft 2.5s infinite; }
.quantity-flash-urgent { animation: qUrgent 2s infinite; }
.quantity-critical { animation: qCritical 1.5s infinite; }

@keyframes qSoft { 50% { background: #162235; } }
@keyframes qUrgent { 50% { background: #3a2a10; } }
@keyframes qCritical { 50% { background: #3a1414; } }

.quantity-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quantity-count {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.stock-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.stock-bar-fill {
  height: 100%;
  background: linear-gradient(90deg,#22c55e,#eab308,#ef4444);
  transform-origin: left;
}

.product-card.is-sold-out .stock-bar-fill {
  background: linear-gradient(90deg,#94a3b8,#94a3b8);
}

.product-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}

.product-price,
.product-price-wrap,
.product-price-wrap * {
  color: #0f172a !important;
}

.product-price {
  font-size: 15px;
  font-weight: 800;
}

.product-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.buy-now-btn,
.view-item-btn {
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.buy-now-btn:hover,
.view-item-btn:hover {
  transform: translateY(-1px);
}

.view-item-btn {
  color: #0f172a !important;
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

.buy-now-btn {
  color: #ffffff !important;
  background: #0f172a !important;
  border: 1px solid #0f172a !important;
  box-shadow: 0 6px 14px rgba(15,23,42,0.15) !important;
}

.buy-now-btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.buy-now-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

.buy-now-btn:disabled {
  color: #ffffff !important;
  background: #64748b !important;
  border-color: #64748b !important;
  opacity: 0.68;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .shop-shell-inner {
    width: min(100%, calc(100% - 10px));
  }

  .shop-intro-card,
  .shop-grid-section {
    border-radius: 18px;
  }

  .shop-grid-section {
    padding: 12px;
  }

  .shop-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card-inner {
    padding: 10px;
  }

  .product-image-wrapper {
    height: 170px !important;
  }

  .product-header {
    margin-top: 8px !important;
  }

  .product-title {
    font-size: 12px !important;
    line-height: 1.22 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-subtitle {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  .quantity-strip {
    margin-top: 8px !important;
    padding: 7px 8px !important;
    animation: none !important;
  }

  .quantity-label {
    font-size: 9px !important;
  }

  .quantity-count {
    font-size: 11px !important;
  }

  .stock-bar {
    margin-top: 7px !important;
  }

  .product-foot {
    margin-top: 10px !important;
    flex-direction: column;
    align-items: stretch;
  }

  .product-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .buy-now-btn,
  .view-item-btn {
    width: 100%;
    padding: 8px 8px !important;
    font-size: 10px !important;
  }

  .product-price {
    font-size: 13px !important;
  }
}


/* nav sizing copied from brand page so logo stays normal */
.app-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.app-nav-title {
  min-width: 0;
}

.app-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}


@media (max-width: 640px) {
  .app-nav {
    gap: 8px;
  }

  .app-nav-left {
    width: 100%;
  }

  .app-logo-img {
    width: 34px;
    height: 34px;
  }

  .app-nav-title-main {
    font-size: 12px;
    line-height: 1;
  }

  .app-nav-title-sub {
    font-size: 10px;
    line-height: 1;
  }

  .app-nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
}


body.checkout-loading {
  overflow: hidden;
}

.checkout-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.checkout-loading-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.checkout-loading-modal {
  width: min(520px, 100%);
  padding: 28px 26px;
  border-radius: 24px;
  text-align: center;
  color: #eef4ff;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
    rgba(11, 18, 32, 0.96);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.checkout-loading-spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 5px solid rgba(255,255,255,0.16);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

.checkout-loading-title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.checkout-loading-subtitle {
  margin-top: 10px;
  color: #b4c5e6;
  font-size: 14px;
  line-height: 1.5;
}


/* Edition number display added for live product cards */
.available-edition-number-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
}
.available-edition-number-badge span {
  font-size: 9px;
  font-weight: 900;
  opacity: 0.85;
}
.available-edition-number-badge strong {
  font-size: 16px;
  line-height: 1;
  font-weight: 1000;
}
.product-card.is-sold-out .available-edition-number-badge {
  display: none;
}

/* ===================================== */
/* EDITION UI FIXES: readable badges + picker + faster red flash */
/* ===================================== */
.product-image-wrapper .available-edition-number-badge {
  top: 10px !important;
  left: 10px !important;
  bottom: auto !important;
  z-index: 6 !important;
  min-width: 92px;
  align-items: flex-start;
}

.product-image-wrapper .edition-badge {
  bottom: 10px !important;
  left: 10px !important;
  z-index: 5 !important;
}

.quantity-strip.quantity-flash-soft,
.quantity-strip.quantity-flash-urgent,
.quantity-strip.quantity-critical {
  animation: inventoryRedPulse var(--flash-speed, 2.8s) infinite ease-in-out !important;
}

@keyframes inventoryRedPulse {
  0%, 100% {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: none;
  }
  50% {
    background: #991b1b;
    border-color: #ef4444;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.42);
  }
}

.edition-picker-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.edition-picker-label {
  color: #0f172a !important;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.edition-picker-select {
  min-width: 92px;
  max-width: 125px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 640px) {
  .edition-picker-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 7px;
  }

  .edition-picker-select {
    width: 100%;
    max-width: none;
  }

  .product-image-wrapper .available-edition-number-badge {
    min-width: 78px;
    padding: 6px 8px;
  }

  .product-image-wrapper .available-edition-number-badge strong {
    font-size: 13px;
  }
}
