/**
 * Mobile UX V2 — Group Products screen (Step 2, ≤900px)
 * One product per brand + brand chips + premium product cards
 */

@media (max-width: 900px) {
  /* ── Item tabs (subcategories within group) ── */
  body.mob-cat-v2-active .mob-cat-v2-item-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.mob-cat-v2-active .mob-cat-v2-item-tabs::-webkit-scrollbar {
    display: none;
  }

  body.mob-cat-v2-active .mob-cat-v2-item-tab {
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--mob-cat-card-border);
    border-radius: 999px;
    background: var(--mob-cat-surface);
    color: var(--mob-cat-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  body.mob-cat-v2-active .mob-cat-v2-item-tab.is-active {
    background: var(--mob-cat-gold-soft);
    border-color: var(--mob-cat-gold-border);
    color: var(--mob-cat-gold);
    box-shadow: 0 0 0 1px rgba(232, 196, 90, 0.18);
  }

  /* ── Brand chips ── */
  body.mob-cat-v2-active .mob-cat-v2-brand-chips {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    padding: 10px 16px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.mob-cat-v2-active .mob-cat-v2-brand-chips::-webkit-scrollbar {
    display: none;
  }

  body.mob-cat-v2-active .mob-cat-v2-brand-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 52px;
    padding: 6px 12px;
    border: 1.5px solid var(--mob-cat-card-border);
    border-radius: 14px;
    background: var(--mob-cat-card);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  body.mob-cat-v2-active .mob-cat-v2-brand-chip.is-active {
    border-color: var(--mob-cat-gold);
    box-shadow: 0 0 0 2px var(--mob-cat-gold-soft), 0 6px 16px rgba(232, 196, 90, 0.18);
  }

  body.mob-cat-v2-active .mob-cat-v2-brand-chip--all {
    min-width: auto;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mob-cat-gold);
  }

  body.mob-cat-v2-active .mob-cat-v2-brand-chip img {
    max-width: 36px;
    max-height: 28px;
    object-fit: contain;
  }

  /* ── Products grid — premium cards ── */
  body.mob-cat-v2-active .mob-cat-v2-products-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 88px);
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .product-card.product-card--v3 {
    width: 100%;
    margin: 0;
    border-radius: var(--mob-cat-radius);
    border: 1px solid var(--mob-cat-card-border);
    background: var(--mob-cat-card);
    box-shadow: var(--mob-cat-shadow);
    overflow: hidden;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-media {
    min-height: 200px;
    background: #0d1018;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-media img,
  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-media .product-brand-fallback {
    object-fit: contain;
    padding: 12px;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-body {
    padding: 16px 16px 18px;
    gap: 10px;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--mob-cat-text);
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .pc-v3-brand-name {
    color: var(--mob-cat-gold);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .btn-cart--pc-v3 {
    min-height: 48px;
    border-radius: var(--mob-cat-radius-sm);
    background: var(--mob-cat-gold) !important;
    color: #070707 !important;
    font-weight: 800;
    font-size: 14px;
  }

  body.mob-cat-v2-active .mob-cat-v2-products-grid .product-price-sale,
  body.mob-cat-v2-active .mob-cat-v2-products-grid .product-price--single {
    font-size: 22px;
    font-weight: 800;
    color: var(--mob-cat-text);
  }

  /* Hide legacy catalog chrome on mobile V2 */
  body.mob-cat-v2-active #products,
  body.mob-cat-v2-active #catalogBranchPage {
    display: none !important;
  }

  /* ── Flexible premium spacer before the bottom edge ──
     Fills leftover viewport height only; JS hides it entirely when the
     product list already fills (or overflows) the screen. */
  body.mob-cat-v2-active #mobCatV2ProductsView .mob-cat-v2-scroll {
    display: flex;
    flex-direction: column;
  }

  body.mob-cat-v2-active #mobCatV2ProductsView .mob-cat-v2-products-grid,
  body.mob-cat-v2-active #mobCatV2ProductsView .mob-cat-v2-empty {
    flex-shrink: 0;
  }

  /* While the spacer is visible, it owns the bottom breathing space —
     drop the large grid/scroll bottom paddings so nothing double-stacks. */
  body.mob-cat-v2-active .mob-cat-v2-scroll--filler {
    padding-bottom: 0;
  }

  body.mob-cat-v2-active .mob-cat-v2-scroll--filler .mob-cat-v2-products-grid {
    padding-bottom: 8px;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px -16px 0;
    padding: 24px 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.018) 0%,
      rgba(232, 196, 90, 0.028) 60%,
      rgba(7, 7, 7, 0) 100%
    );
    animation: mobCatV2FillerFade 0.45s ease both;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler[hidden] {
    display: none !important;
  }

  @keyframes mobCatV2FillerFade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    max-width: 320px;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-icon {
    width: 58px;
    height: 58px;
    stroke: var(--mob-cat-gold);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
    margin-bottom: 4px;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-spark {
    stroke-width: 2.2;
    opacity: 0.6;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--mob-cat-text);
    line-height: 1.3;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--mob-cat-muted);
    font-weight: 500;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin-top: 8px;
    padding: 12px 24px;
    border: 1px solid var(--mob-cat-gold-border);
    border-radius: 999px;
    background: transparent;
    color: var(--mob-cat-gold);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s ease;
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-cta:active {
    background: var(--mob-cat-gold-soft);
    transform: scale(0.97);
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-cta svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html[dir="rtl"] body.mob-cat-v2-active .mob-cat-v2-filler-cta svg {
    transform: scaleX(-1);
  }

  body.mob-cat-v2-active .mob-cat-v2-filler-note {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    margin-top: 2px;
  }
}
