/* AceBase pre-owned / knife merch — MyGear layout adapted for slate theme */

:root {
  --mg-ink: #e8e6f0;
  --mg-ink-muted: #9ca3af;
  --mg-accent: #a78bfa;
  --mg-accent-2: #ef4444;
}

/* —— Shop hero + slideshow —— */
.mg-shop {
  margin: -0.35rem 0 0.5rem;
}

.mg-home-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.35rem;
  border-radius: 0.75rem;
  min-height: 16.5rem;
  background: #1a1028;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.mg-home-hero--shop {
  min-height: 14.5rem;
}

.mg-hero-slides {
  background-image: none;
  background-color: #1a1028;
}

.mg-hero-slides::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(26, 16, 40, 0.94) 0%,
    rgba(76, 29, 149, 0.72) 48%,
    rgba(15, 23, 42, 0.45) 100%
  );
}

.mg-hero-slides__track {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.mg-hero-slides__img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.mg-hero-slides__img.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mg-hero-slides__img {
    transition: none;
  }
}

.mg-hero-slides .mg-home-hero__inner {
  z-index: 2;
}

.mg-home-hero__inner {
  position: relative;
  z-index: 1;
  padding: 1.65rem 1.4rem 1.55rem;
  max-width: 34rem;
}

.mg-home-hero__brand {
  margin: 0 0 0.55rem !important;
  color: #c4b5fd !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2 !important;
}

.mg-home-hero__title {
  margin: 0 0 0.55rem !important;
  color: #fff !important;
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  line-height: 1.15 !important;
}

.mg-home-hero__lead {
  margin: 0 0 1rem !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

.mg-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.mg-home-hero__btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem !important;
  border-radius: 0.45rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.mg-home-hero__btn--primary {
  background: #25d366 !important;
  color: #fff !important;
}

.mg-home-hero__btn--primary:hover {
  filter: brightness(1.08);
  color: #fff !important;
}

.mg-home-hero__btn--ghost {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
}

.mg-home-hero__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

/* —— Help links —— */
.mg-home-help {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.mg-home-help__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0 !important;
}

.mg-home-help__links a {
  color: #c4b5fd !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.mg-home-help__links a:hover {
  text-decoration: underline !important;
}

/* —— List meta / legend —— */
.md-typeset h2 .mg-list-meta {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  vertical-align: middle;
  line-height: 1.35 !important;
  border: 0 !important;
}

.mg-preowned-showing {
  margin: 0.15rem 0 0.65rem !important;
  color: var(--mg-ink-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.mg-price-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin: 0.35rem 0 0.85rem !important;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--mg-ink-muted);
}

.mg-price-legend__stock,
.mg-price-legend__sold {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.mg-price-legend__stock {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.mg-price-legend__stock::before,
.mg-price-legend__sold::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
}

.mg-price-legend__stock::before {
  background: #22c55e;
}

.mg-price-legend__sold {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

.mg-price-legend__sold::before {
  background: #64748b;
}

/* —— Hide source table once grid is built —— */
.md-typeset .mg-price-table--preowned:has(.mg-preowned-grid) > table,
.md-typeset .mg-price-table--preowned:has(.mg-preowned-grid) > .md-typeset__table {
  display: none !important;
}

.md-typeset .mg-price-table--preowned:has(.mg-preowned-grid) {
  overflow: visible;
}

.md-typeset .mg-price-table--preowned thead {
  display: none;
}

/* —— Product card grid —— */
.mg-preowned-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}

@media (min-width: 760px) {
  .mg-preowned-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1100px) {
  .mg-preowned-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mg-preowned-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0 0 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 0.75rem;
  overflow: hidden;
}

.mg-preowned-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #1a1625;
}

.md-typeset .mg-preowned-card__media > img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  object-fit: cover;
  display: block !important;
}

.mg-preowned-card__oos {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 0.3rem;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mg-preowned-card--sold .mg-preowned-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.md-typeset .mg-preowned-card__title {
  margin: 0.7rem 0.75rem 0.25rem !important;
  color: var(--mg-ink) !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.md-typeset .mg-preowned-card__price {
  margin: 0 0.75rem 0.65rem !important;
  color: #c4b5fd !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
}

.md-typeset .mg-preowned-card--sold .mg-preowned-card__title {
  color: #94a3b8 !important;
}

.md-typeset .mg-preowned-card--sold .mg-preowned-card__price,
.md-typeset .mg-preowned-card--sold .mg-preowned-card__price del {
  color: #64748b !important;
}

.md-typeset .mg-preowned-card__wa {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: auto 0.75rem 0 !important;
  padding: 0.5rem 0.7rem !important;
  border-radius: 0.45rem !important;
  background: #25d366 !important;
  color: #fff !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.md-typeset .mg-preowned-card__wa:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.md-typeset .mg-preowned-card__wa--preorder {
  background: rgba(167, 139, 250, 0.35) !important;
}

.mg-preowned-card__wa-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .mg-shop {
    margin: 0 -0.8rem 0.75rem;
  }

  .mg-home-hero {
    margin: 0 0 1.1rem;
    border-radius: 0;
    min-height: 17.5rem;
    box-shadow: none;
  }

  .mg-hero-slides::before {
    background: linear-gradient(
      180deg,
      rgba(26, 16, 40, 0.45) 0%,
      rgba(76, 29, 149, 0.7) 42%,
      rgba(15, 23, 42, 0.92) 100%
    );
  }

  .mg-home-hero__inner {
    max-width: none;
    padding: 1.25rem 1rem 1.2rem;
  }

  .mg-home-hero__title {
    font-size: 1.55rem !important;
  }
}
