/* Boutique Merch */

.merch-hero.section--red-top {
  display: flex;
  align-items: center;
  min-height: min(36svh, 320px);
  padding-bottom: 2rem;
}

.merch-hero__inner {
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.merch-hero__inner h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
}

.merch-hero__inner p {
  color: rgba(255, 255, 255, 0.88);
  margin-top: 0.5rem;
}

.merch-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 3rem;
}

@media (min-width: 1024px) {
  .merch-layout {
    grid-template-columns: 1fr min(340px, 32%);
    align-items: start;
  }

  .merch-layout__grid,
  .merch-layout__cart {
    min-width: 0;
  }

  .merch-layout__cart {
    position: sticky;
    top: calc(var(--nav-h) + var(--presence-h, 0px) + 1rem);
    align-self: start;
    z-index: 10;
    max-height: calc(100dvh - var(--nav-h) - var(--presence-h, 0px) - 2rem);
  }
}

.merch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .merch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .merch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.merch-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.25s;
}

.merch-card:hover {
  border-color: rgba(227, 45, 45, 0.45);
  transform: translateY(-4px);
}

.merch-card__visual {
  position: relative;
  aspect-ratio: 1;
  background: var(--black-soft);
}

.merch-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merch-card__badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.25rem 0.55rem;
  background: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  z-index: 1;
}

.merch-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}

.merch-card__body h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.merch-card__desc {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.45;
  flex: 1;
}

.merch-card__price {
  font-size: 1.25rem;
  font-weight: 800;
}

.merch-card__sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.merch-size-btn {
  min-width: 40px;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.merch-size-btn:hover {
  border-color: var(--red);
  color: var(--white);
}

.merch-size-btn.is-selected {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.merch-card__add {
  width: 100%;
  margin-top: 0.35rem;
}

.merch-cart {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 1024px) {
  .merch-cart {
    max-height: calc(100dvh - var(--nav-h) - var(--presence-h, 0px) - 2rem);
  }
}

.merch-cart__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--black-card);
}

.merch-cart__head h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.merch-cart__count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red-hover);
}

.merch-cart__items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) {
  .merch-cart__items {
    max-height: none;
  }
}

.merch-cart__foot {
  flex-shrink: 0;
  margin-top: auto;
}

.merch-cart__empty {
  color: var(--gray);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

.merch-cart-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.65rem;
  align-items: start;
}

.merch-cart-line__thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--black-soft);
}

.merch-cart-line__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merch-cart-line strong {
  font-size: 0.85rem;
  display: block;
}

.merch-cart-line span {
  font-size: 0.75rem;
  color: var(--gray);
}

.merch-cart-line__price {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.merch-cart-line__remove {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  justify-self: start;
}

.merch-cart__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 0.35rem;
}

.merch-cart__total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0.75rem 0 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.merch-cart__note {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.merch-fab-cart {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: calc(var(--tab-h, 0px) + 5rem);
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(227, 45, 45, 0.45);
  cursor: pointer;
}

.merch-fab-cart__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--white);
  color: var(--red);
  font-size: 0.7rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.merch-fab-cart__badge.is-visible {
  display: flex;
}

@media (max-width: 1023px) {
  .merch-layout__cart {
    display: none;
  }

  .merch-layout__cart.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(0, 0, 0, 0.75);
    padding: 1rem;
    padding-top: calc(var(--nav-h) + 1rem);
    overflow-y: auto;
  }

  .merch-layout__cart.is-open .merch-cart {
    max-width: 420px;
    margin-inline: auto;
  }

  .merch-fab-cart {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

#home-merch .section__head {
  margin-bottom: 1.25rem;
}

.home-merch-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.home-merch-cta {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 0;
}

.home-merch-cta .btn {
  width: auto;
  min-width: 10rem;
}

.home-merch-scroll .merch-card {
  flex: 0 0 min(260px, 78vw);
  scroll-snap-align: start;
}

.home-merch-scroll .merch-card__sizes,
.home-merch-scroll .merch-card__add {
  display: none;
}

.merch-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.home-merch-scroll .merch-card--link .merch-card__body::after {
  content: none;
}
