/* SNKXBY Shop V2 presentation layer
   Scoped to the modern shop route by the existing .hero-grid marker.
   Keeps warning/reservation amber/red states intact while making blue the primary brand color. */

html:has(.hero-grid) {
  --shop-primary: #0066ff;
  --shop-primary-bright: #3d86ff;
  --shop-primary-soft: rgba(0, 102, 255, 0.11);
  --shop-primary-border: rgba(0, 102, 255, 0.42);
  --shop-surface: #091322;
  --shop-surface-raised: #0c1728;
}

/* Replace the old gold primary accent only. Amber/red availability warnings are deliberately untouched. */
html:has(.hero-grid) [style*="color: rgb(255, 215, 0)"],
html:has(.hero-grid) [style*="color: #ffd700"],
html:has(.hero-grid) .hero-grid h1 span,
html:has(.hero-grid) .product-card strong[style*="color"],
html:has(.hero-grid) .shop-detail-grid strong[style*="color"] {
  color: var(--shop-primary-bright) !important;
}

html:has(.hero-grid) [style*="background: rgb(255, 215, 0)"],
html:has(.hero-grid) [style*="background: #ffd700"] {
  background: var(--shop-primary) !important;
  color: #fff !important;
}

html:has(.hero-grid) [style*="rgba(255, 215, 0"] {
  border-color: var(--shop-primary-border) !important;
  background: var(--shop-primary-soft) !important;
}

html:has(.hero-grid) [style*="border-color: rgb(255, 215, 0)"],
html:has(.hero-grid) [style*="border-color: #ffd700"] {
  border-color: var(--shop-primary) !important;
}

/* Page proportions */
html:has(.hero-grid) main {
  max-width: 1240px !important;
  padding-top: 34px !important;
}

html:has(.hero-grid) .hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.55fr) !important;
  gap: 42px !important;
  margin-bottom: 30px !important;
}

html:has(.hero-grid) .hero-grid > div > span {
  border-color: var(--shop-primary-border) !important;
  background: var(--shop-primary-soft) !important;
  color: #7eb0ff !important;
}

html:has(.hero-grid) .hero-grid h1 span {
  text-shadow: 0 0 34px rgba(0, 102, 255, 0.18);
}

/* Product overview: cards stay compact instead of stretching to fill the entire row. */
html:has(.hero-grid) .product-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px)) !important;
  justify-content: center !important;
  align-items: start !important;
  gap: 18px !important;
}

html:has(.hero-grid) .product-card {
  width: 100% !important;
  max-width: 260px !important;
  border-radius: 14px !important;
  border-color: rgba(255, 255, 255, 0.085) !important;
  background: linear-gradient(180deg, #0b1626 0%, #08111f 100%) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18) !important;
  transform: translateZ(0);
}

html:has(.hero-grid) .product-card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--shop-primary-border) !important;
  box-shadow: 0 18px 46px rgba(0, 68, 170, 0.16) !important;
}

html:has(.hero-grid) .product-card > div:first-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html:has(.hero-grid) .product-card > div:last-child {
  padding: 14px 14px 13px !important;
}

html:has(.hero-grid) .product-card > div:last-child > div:first-child {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

html:has(.hero-grid) .product-card h3 {
  font-size: 16px !important;
  line-height: 1.15 !important;
}

html:has(.hero-grid) .product-card strong[style*="white-space"] {
  font-size: 15px !important;
  color: var(--shop-primary-bright) !important;
}

/* Filters feel like part of the blue UI rather than a separate gold theme. */
html:has(.hero-grid) .filter-row button:hover,
html:has(.hero-grid) .filter-row button:focus-visible {
  border-color: var(--shop-primary-border) !important;
  color: #fff !important;
}

html:has(.hero-grid) .filter-row > div:nth-child(2) {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 102, 255, 0.35) transparent;
}

/* Product detail view: narrower and more balanced than the old 1060px stretched dialog. */
html:has(.hero-grid) div:has(> .shop-detail-grid) {
  width: min(960px, calc(100vw - 30px)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  border-color: rgba(0, 102, 255, 0.18) !important;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.72) !important;
}

html:has(.hero-grid) .shop-detail-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(350px, 1.08fr) !important;
}

html:has(.hero-grid) .shop-detail-grid > div:first-child {
  padding: 16px !important;
  background: #07101d;
}

html:has(.hero-grid) .shop-detail-grid > div:last-child {
  padding: 26px 26px 28px !important;
}

html:has(.hero-grid) .shop-detail-grid h2 {
  font-size: clamp(34px, 4.4vw, 48px) !important;
}

html:has(.hero-grid) .shop-detail-grid section button:hover {
  border-color: var(--shop-primary-border) !important;
}

/* Checkout / cart primary actions inherit the blue brand color through the exact gold replacement above. */
html:has(.hero-grid) input:focus,
html:has(.hero-grid) select:focus,
html:has(.hero-grid) textarea:focus {
  border-color: var(--shop-primary-border) !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.08);
}

@media (max-width: 980px) {
  html:has(.hero-grid) main {
    padding-top: 28px !important;
  }

  html:has(.hero-grid) .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  html:has(.hero-grid) .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
  }

  html:has(.hero-grid) .product-card {
    max-width: none !important;
  }

  html:has(.hero-grid) .shop-detail-grid {
    grid-template-columns: 1fr !important;
  }

  html:has(.hero-grid) .shop-detail-grid > div:last-child {
    border-left: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  }
}

@media (max-width: 700px) {
  html:has(.hero-grid) main {
    padding: 24px 12px 72px !important;
  }

  html:has(.hero-grid) header > div:last-child {
    padding: 11px 12px !important;
  }

  html:has(.hero-grid) .hero-grid {
    margin-bottom: 20px !important;
  }

  html:has(.hero-grid) .hero-grid h1 {
    font-size: clamp(42px, 14vw, 64px) !important;
    line-height: 0.9 !important;
  }

  html:has(.hero-grid) .hero-grid p {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }

  html:has(.hero-grid) .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  html:has(.hero-grid) .product-card {
    max-width: none !important;
    border-radius: 10px !important;
  }

  html:has(.hero-grid) .product-card > div:last-child {
    padding: 10px !important;
  }

  html:has(.hero-grid) .product-card h3 {
    font-size: 14px !important;
  }

  html:has(.hero-grid) .product-card strong[style*="white-space"] {
    font-size: 13px !important;
  }

  html:has(.hero-grid) .product-card > div:last-child > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }

  html:has(.hero-grid) .filter-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  html:has(.hero-grid) .filter-row > div:nth-child(2) {
    margin-inline: -2px;
    padding-bottom: 3px;
  }

  html:has(.hero-grid) div:has(> .shop-detail-grid) {
    width: calc(100vw - 12px) !important;
    max-height: 96dvh !important;
    border-radius: 12px !important;
  }

  html:has(.hero-grid) .shop-detail-grid > div:first-child {
    padding: 9px !important;
  }

  html:has(.hero-grid) .shop-detail-grid > div:last-child {
    padding: 18px 14px 24px !important;
  }

  html:has(.hero-grid) .shop-detail-grid h2 {
    font-size: clamp(32px, 10vw, 42px) !important;
  }

  html:has(.hero-grid) .shop-detail-grid > div:last-child > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html:has(.hero-grid) .checkout-grid > div:first-child {
    padding: 16px 13px !important;
  }

  html:has(.hero-grid) .checkout-grid > div:first-child > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  html:has(.hero-grid) .checkout-grid > div:first-child > div[style*="display: flex"] {
    flex-wrap: wrap !important;
  }

  html:has(.hero-grid) .checkout-grid > aside {
    padding: 16px 13px !important;
  }
}

@media (max-width: 390px) {
  html:has(.hero-grid) .product-grid {
    gap: 8px !important;
  }

  html:has(.hero-grid) .product-card > div:last-child {
    padding: 9px !important;
  }

  html:has(.hero-grid) .product-card h3 {
    font-size: 13px !important;
  }

  html:has(.hero-grid) .product-card strong[style*="white-space"] {
    font-size: 12px !important;
  }
}

@media (max-width: 340px) {
  html:has(.hero-grid) .product-grid {
    grid-template-columns: 1fr !important;
  }

  html:has(.hero-grid) .product-card {
    max-width: 260px !important;
    justify-self: center !important;
  }
}
