/* PATCH 380 — MOBILE MARKET FEED
   Replaces only the phone layout below the hero with a compact news rail,
   category filters and a continuous two-column product feed. Desktop and
   tablet layouts keep the existing architecture. */

.mobile-market-news,
.mobile-market-catalog {
  display: none;
}

@media (max-width: 820px) {
  body.home-page {
    --p380-side: clamp(12px, 3.2vw, 18px);
    --p380-shell: 760px;
    --p380-surface: rgba(14, 6, 25, .94);
    --p380-surface-strong: #0b0514;
    --p380-line: rgba(210, 126, 255, .22);
    --p380-line-strong: rgba(225, 133, 255, .48);
    --p380-text: #fff7ff;
    --p380-muted: rgba(238, 220, 247, .66);
    --p380-accent: #e064ff;
    --p380-accent-soft: rgba(167, 83, 255, .18);
  }

  body.home-page .mobile-showcase-categories,
  body.home-page .mobile-future-drops {
    display: none !important;
  }

  body.home-page .mobile-showcase-header--353 {
    min-height: 66px !important;
    padding-top: calc(6px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 4px !important;
  }

  body.home-page .mobile-showcase-brand--353 {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  body.home-page .mobile-showcase-profile-link {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }

  body.home-page .mobile-home-hero__link {
    height: clamp(218px, 52vw, 258px) !important;
  }

  body.home-page .mobile-home-clock {
    top: clamp(92px, 21vw, 138px) !important;
    min-height: clamp(88px, 18vw, 124px) !important;
  }

  body.home-page .mobile-market-news,
  body.home-page .mobile-market-catalog {
    position: relative;
    z-index: 2;
    width: min(calc(100% - (var(--p380-side) * 2)), var(--p380-shell));
    margin-inline: auto;
    display: block;
    scroll-margin-top: 76px;
  }

  body.home-page .mobile-market-news[hidden] {
    display: none !important;
  }

  body.home-page .mobile-market-news {
    margin-top: 12px;
  }

  body.home-page .mobile-market-catalog {
    margin-top: 18px;
    padding-bottom: 18px;
  }

  body.home-page .mobile-market-section-head {
    min-height: 35px;
    margin-bottom: 8px;
    padding-inline: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  body.home-page .mobile-market-section-head h2 {
    margin: 0;
    color: var(--p380-text);
    font-family: var(--font-title);
    font-size: clamp(1.48rem, 6vw, 1.88rem);
    line-height: .95;
    letter-spacing: -.045em;
  }

  body.home-page .mobile-market-section-head output {
    flex: 0 0 auto;
    color: var(--p380-muted);
    font-family: "Consolas", "Courier New", monospace;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  body.home-page .mobile-market-news__rail {
    width: 100%;
    display: block;
    overflow: visible;
    padding: 1px;
    touch-action: auto;
  }

  body.home-page .mobile-market-news__rail::-webkit-scrollbar {
    display: none;
  }

  /* PATCH 382 — the mobile news section has one main banner only. The first
     entry in hero-news.json owns this slot; no carousel or secondary banners. */
  body.home-page .mobile-market-news-card {
    position: relative;
    flex: 0 0 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 8 / 5;
    padding: 0;
    display: block;
    overflow: hidden;
    border: 1px solid var(--p380-line);
    border-radius: 18px;
    color: var(--p380-text);
    background: var(--p380-surface-strong);
    box-shadow: 0 9px 22px rgba(0, 0, 0, .23);
    scroll-snap-align: start;
    text-decoration: none;
  }

  body.home-page .mobile-market-news-card::after {
    content: none;
    display: none;
  }

  body.home-page .mobile-market-news-card__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
  }

  body.home-page .mobile-market-news-card__index {
    position: relative;
    z-index: 1;
    color: var(--p380-accent);
    font-family: "Consolas", "Courier New", monospace;
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .08em;
  }

  body.home-page .mobile-market-news-card__copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
  }

  body.home-page .mobile-market-news-card__eyebrow {
    color: var(--p380-accent);
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .10em;
    text-transform: uppercase;
  }

  body.home-page .mobile-market-news-card__copy strong {
    min-width: 0;
    overflow: hidden;
    color: var(--p380-text);
    font-size: clamp(.88rem, 3.5vw, 1.02rem);
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.home-page .mobile-market-news-card__text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--p380-muted);
    font-size: clamp(.68rem, 2.75vw, .78rem);
    line-height: 1.34;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.home-page .mobile-market-news-card__link {
    position: relative;
    z-index: 1;
    grid-column: 2;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(250, 235, 255, .82);
    font-size: .64rem;
    font-weight: 850;
  }

  body.home-page .mobile-market-news-card__link b {
    color: var(--p380-accent);
    font-size: 1rem;
    line-height: .7;
  }

  body.home-page .mobile-market-catalog__filters {
    width: 100%;
    margin-bottom: 10px;
    padding: 1px 1px 5px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  body.home-page .mobile-market-catalog__filters::-webkit-scrollbar {
    display: none;
  }

  body.home-page .mobile-market-catalog__filters .drop-filter {
    flex: 0 0 auto;
    min-height: 34px;
    padding-inline: 13px;
    border: 1px solid var(--p380-line);
    border-radius: 999px;
    color: rgba(247, 231, 255, .76);
    background: rgba(12, 5, 21, .80);
    box-shadow: none;
    font-size: .70rem;
    font-weight: 850;
    scroll-snap-align: start;
  }

  body.home-page .mobile-market-catalog__filters .drop-filter.is-active {
    color: #fff;
    border-color: var(--p380-line-strong);
    background: linear-gradient(135deg, rgba(202, 72, 243, .82), rgba(103, 70, 220, .88));
    box-shadow: 0 0 14px rgba(190, 76, 255, .18);
  }

  body.home-page .mobile-market-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px 8px;
  }

  body.home-page .mobile-market-grid .drop-card {
    min-width: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    contain: layout paint style;
  }

  body.home-page .mobile-market-grid .drop-card__media {
    aspect-ratio: 1 / 1.04;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--drop-accent) 25%, var(--p380-line));
    border-radius: 13px;
    background:
      radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--drop-accent) 14%, transparent), transparent 52%),
      var(--p380-surface-strong);
  }

  body.home-page .mobile-market-grid .drop-card__media::after {
    height: 24%;
    background: linear-gradient(180deg, transparent, rgba(4, 2, 10, .36));
  }

  body.home-page .mobile-market-grid .drop-card__media img {
    object-fit: contain;
    transform: none !important;
  }

  body.home-page .mobile-market-grid .drop-card__badge {
    top: 7px;
    left: 7px;
    max-width: calc(100% - 48px);
    padding: 5px 7px;
    border-radius: 7px;
    font-size: .54rem;
    line-height: 1;
  }

  body.home-page .mobile-market-grid .drop-card__favorite {
    top: 7px;
    right: 7px;
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, .25);
    background: rgba(6, 2, 12, .72);
    font-size: .98rem;
    box-shadow: none;
  }

  body.home-page .mobile-market-grid .drop-card__content {
    padding: 8px 2px 0;
  }

  body.home-page .mobile-market-grid .drop-card__meta {
    gap: 5px;
    font-size: .55rem;
    letter-spacing: .025em;
  }

  body.home-page .mobile-market-grid .drop-card__meta span,
  body.home-page .mobile-market-grid .drop-card__meta strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.home-page .mobile-market-grid .drop-card h3 {
    display: -webkit-box;
    min-height: 2.28em;
    margin-top: 5px;
    overflow: hidden;
    font-size: clamp(.76rem, 3vw, .88rem);
    line-height: 1.14;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.home-page .mobile-market-grid .drop-card__summary,
  body.home-page .mobile-market-grid .drop-card__quick {
    display: none;
  }

  body.home-page .mobile-market-grid .drop-card__price {
    margin-top: 6px;
    gap: 6px;
  }

  body.home-page .mobile-market-grid .drop-card__price strong {
    font-size: clamp(.88rem, 3.6vw, 1.02rem);
  }

  body.home-page .mobile-market-grid .drop-card__price del {
    font-size: .62rem;
  }

  body.home-page .mobile-market-grid .drop-grid-message {
    min-height: 150px;
    border-color: var(--p380-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
  }

  html[data-theme="pink"] body.home-page {
    --p380-surface: rgba(37, 7, 39, .94);
    --p380-surface-strong: #17051d;
    --p380-line: rgba(255, 109, 213, .25);
    --p380-line-strong: rgba(255, 116, 218, .58);
    --p380-text: #fff5fd;
    --p380-muted: rgba(255, 219, 246, .67);
    --p380-accent: #ff72d8;
    --p380-accent-soft: rgba(255, 85, 201, .16);
  }

  html[data-theme="pink"] body.home-page .mobile-market-news-card {
    background:
      radial-gradient(circle at 92% 8%, rgba(255, 96, 207, .20), transparent 40%),
      linear-gradient(135deg, rgba(45, 9, 45, .98), rgba(18, 4, 23, .98));
  }

  html[data-theme="lite"] body.home-page .mobile-market-news-card,
  html[data-theme="lite"] body.home-page .mobile-market-catalog__filters .drop-filter,
  html[data-theme="lite"] body.home-page .mobile-market-grid .drop-card__media {
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Keep the lower homepage out of the initial mobile paint. Chrome renders
     each section shortly before it approaches the viewport and remembers its
     measured size after the first visit. */
  body.home-page .mobile-showcase-hello {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
  }

  body.home-page .perks-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
  }

  body.home-page .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
  }

  @media (max-width: 370px) {
    body.home-page .mobile-market-grid {
      gap-inline: 6px;
    }

    body.home-page .mobile-market-grid .drop-card__meta span {
      display: none;
    }

    body.home-page .mobile-market-news-card {
      flex-basis: 100%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .mobile-market-news__rail,
  body.home-page .mobile-market-catalog__filters {
    scroll-behavior: auto;
  }
}
