/* OEM ASTRA J — Top Selling on mobile (≤900px)
   Shown directly under the hero as a horizontal marquee. */

@media (max-width: 900px) {
  :root {
    --ts-blue: #1e5bb8;
    --ts-text: #1a2332;
    --ts-muted: #6b7280;
    --ts-border: #e5eaf0;
    --ts-card-radius: 18px;
    --ts-media-scale: 1.15;
  }

  body.is-home-page #topParts.top-selling-section {
    margin-top: 0 !important;
    /* Small mobile catalog→best-selling gap (1.5cm increase stays desktop-only) */
    padding-top: 12px !important;
    position: relative !important;
    z-index: 2 !important;
    background: #ffffff !important;
  }

  body.is-home-page #topParts.top-selling-section::before {
    display: none !important;
    content: none !important;
  }

  body.is-home-page #topParts.top-selling-section .section-inner {
    padding: 4px 16px 0 !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
  }

  body.is-home-page #topParts.top-selling-section .section-head {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    scroll-margin-top: calc(var(--mob-v2-header-total, 72px) + 8px);
  }

  body.is-home-page #topParts.top-selling-section .section-label,
  body.is-home-page #topParts.top-selling-section .top-parts-swipe-hint {
    display: none !important;
  }

  body.is-home-page #topParts.top-selling-section .section-title,
  body.is-home-page #topParts.top-selling-section .section-title em {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    font-family: var(--font-en, "Segoe UI", sans-serif) !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    font-style: normal !important;
    letter-spacing: -0.02em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    color: #0f2d6b !important;
    -webkit-text-fill-color: #0f2d6b !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    filter: none !important;
  }

  body.is-home-page #topParts.top-selling-section .top-selling-title-flame {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 auto !important;
    display: block !important;
    color: #e85d04 !important;
  }

  html[dir="rtl"] body.is-home-page #topParts.top-selling-section .section-title,
  html[dir="rtl"] body.is-home-page #topParts.top-selling-section .section-title em {
    font-family: var(--font-ar, Cairo, sans-serif) !important;
    text-transform: none !important;
  }

  /* Text-only red “View All →” link (beats mobile-v2 / home-premium blue fills) */
  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold,
  body.is-home-page #topParts.top-selling-section .btn-all-gold {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;
    gap: 0.3em !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--ws-cart-badge, #e11d2e) !important;
    -webkit-text-fill-color: var(--ws-cart-badge, #e11d2e) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: var(--font-en, "DM Sans", sans-serif) !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
    text-transform: none !important;
    cursor: pointer !important;
    transition: color 0.2s ease, opacity 0.2s ease;
  }

  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold span,
  body.is-home-page #topParts.top-selling-section .btn-all-gold span {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    background: transparent !important;
  }

  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold::after,
  body.is-home-page #topParts.top-selling-section .btn-all-gold::after {
    content: "→" !important;
    display: inline-block !important;
    font-weight: 700 !important;
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    line-height: 1 !important;
  }

  html[dir="rtl"] body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold,
  html[dir="rtl"] body.is-home-page #topParts.top-selling-section .btn-all-gold {
    font-family: var(--font-ar, Cairo, sans-serif) !important;
  }

  html[dir="rtl"] body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold::after,
  html[dir="rtl"] body.is-home-page #topParts.top-selling-section .btn-all-gold::after {
    content: "←" !important;
  }

  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold:hover,
  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold:focus-visible,
  body.is-home-page #topParts.top-selling-section .btn-all-gold:hover,
  body.is-home-page #topParts.top-selling-section .btn-all-gold:focus-visible {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #c41020 !important;
    -webkit-text-fill-color: #c41020 !important;
    opacity: 0.92;
  }

  body.is-home-page #topParts.top-selling-section > .section-inner > .section-head > button.btn-all-gold:hover span,
  body.is-home-page #topParts.top-selling-section .btn-all-gold:hover span {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
  }

  body.is-home-page #topParts .top-parts-desktop,
  body.is-home-page #topParts .top-parts-grid,
  body.is-home-page #topPartsGrid.top-parts-grid,
  body.is-home-page #topPartsGrid.top-parts-desktop {
    display: none !important;
  }

  body.is-home-page #topParts .top-parts-mobile,
  body.is-home-page #topParts .mob-card-body--marquee {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
    max-width: 100% !important;
  }

  body.is-home-page #topParts .top-parts-viewport,
  body.is-home-page #topParts #topPartsViewport {
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    cursor: grab !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 4px 0 8px !important;
    margin: 0 !important;
    scrollbar-width: none !important;
  }

  body.is-home-page #topParts .top-parts-viewport::-webkit-scrollbar {
    display: none !important;
  }

  body.is-home-page #topParts .top-selling-track,
  body.is-home-page #topParts #topPartsTrack {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: max-content !important;
    min-width: 100% !important;
    padding: 0 16px !important;
    margin: 0 !important;
    transition: none !important;
  }

  body.is-home-page #topParts .top-selling-track.top-selling-marquee,
  body.is-home-page #topParts #topPartsTrack.top-selling-marquee {
    will-change: transform !important;
    animation: topSellingMarqueeLtr 32s linear infinite !important;
    animation-play-state: running !important;
  }

  html[dir="rtl"] body.is-home-page #topParts .top-selling-track.top-selling-marquee,
  html[dir="rtl"] body.is-home-page #topParts #topPartsTrack.top-selling-marquee {
    animation-name: topSellingMarqueeRtl !important;
  }

  body.is-home-page #topParts .top-parts-viewport.is-paused .top-selling-track.top-selling-marquee,
  body.is-home-page #topParts .top-parts-viewport.is-dragging .top-selling-track.top-selling-marquee,
  body.is-home-page #topParts #topPartsViewport.is-paused .top-selling-track.top-selling-marquee,
  body.is-home-page #topParts #topPartsViewport.is-dragging .top-selling-track.top-selling-marquee {
    animation-play-state: paused !important;
  }

  body.is-home-page #topParts .top-selling-card.oem-rec-card {
    position: relative !important;
    flex: 0 0 170px !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1px solid var(--ts-border) !important;
    border-radius: var(--ts-card-radius) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07) !important;
    overflow: hidden !important;
  }

  body.is-home-page #topParts .top-part-slot-empty,
  body.is-home-page #topParts .top-selling-empty {
    flex: 0 0 170px !important;
    width: 170px !important;
    min-height: 220px !important;
    border-radius: var(--ts-card-radius) !important;
    border: 1px dashed #d5dce6 !important;
    background: #f8fafc !important;
    color: var(--ts-muted) !important;
  }

  body.is-home-page #topParts .oem-rec-card__layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 14px !important;
    --oem-rec-media-col: 100%;
  }

  body.is-home-page #topParts .top-selling-card.oem-rec-card > .oem-rec-card__compat,
  body.is-home-page #topParts .oem-rec-card__compat {
    display: none !important;
  }

  /* Brand logo — top-left (former stars slot) */
  body.is-home-page #topParts .top-selling-card.oem-rec-card > .top-selling-brand,
  body.is-home-page #topParts .top-selling-card.oem-rec-card > .oem-rec-card__brand {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    z-index: 5 !important;
    gap: 0 !important;
    width: auto !important;
    max-width: calc(100% - 20px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  body.is-home-page #topParts .top-selling-card.oem-rec-card > .top-selling-brand .top-selling-brand-logo,
  body.is-home-page #topParts .top-selling-card.oem-rec-card > .oem-rec-card__brand .oem-rec-card__brand-logo {
    display: block !important;
    height: 40px !important;
    max-height: 40px !important;
    max-width: 160px !important;
    width: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
    filter: none !important;
  }

  body.is-home-page #topParts .top-selling-card.oem-rec-card > .top-selling-brand .top-selling-brand-fallback,
  body.is-home-page #topParts .top-selling-card.oem-rec-card > .oem-rec-card__brand .oem-rec-card__brand-text {
    display: none !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: var(--ts-blue) !important;
    line-height: 1.2 !important;
  }

  /* Stars — under product name */
  body.is-home-page #topParts .oem-rec-card__info .product-rating.top-selling-rating,
  body.is-home-page #topParts .top-selling-footer .product-rating.top-selling-rating {
    display: inline-flex !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    order: 2 !important;
    gap: 2px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
    direction: ltr !important;
  }

  body.is-home-page #topParts .top-selling-rating .product-star {
    font-size: 12px !important;
    color: #d1d5db !important;
    -webkit-text-fill-color: #d1d5db !important;
  }

  body.is-home-page #topParts .top-selling-rating .product-star.is-filled {
    color: #f5a524 !important;
    -webkit-text-fill-color: #f5a524 !important;
  }

  /* Part number — under stars */
  body.is-home-page #topParts .top-selling-part,
  body.is-home-page #topParts .oem-rec-card__part {
    display: block !important;
    order: 3 !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.02em !important;
    color: var(--ts-muted) !important;
    -webkit-text-fill-color: var(--ts-muted) !important;
    text-align: start !important;
  }

  body.is-home-page #topParts .oem-rec-card__media,
  body.is-home-page #topParts .top-selling-img-wrap {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(130px * var(--ts-media-scale, 1.15)) !important;
    min-height: calc(130px * var(--ts-media-scale, 1.15)) !important;
    max-height: calc(130px * var(--ts-media-scale, 1.15)) !important;
    aspect-ratio: auto !important;
    margin: 8px 0 0 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    border: none !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    background-image: none !important;
    isolation: auto !important;
    overflow: hidden !important;
  }

  body.is-home-page #topParts .oem-rec-card__media::before,
  body.is-home-page #topParts .top-selling-img-wrap::before {
    content: none !important;
    display: none !important;
  }

  body.is-home-page #topParts .oem-rec-card__media img,
  body.is-home-page #topParts .top-selling-img-wrap img,
  body.is-home-page #topParts .oem-rec-card__media img:not(.product-brand-fallback),
  body.is-home-page #topParts .top-selling-img-wrap img:not(.product-brand-fallback) {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    filter: none !important;
    transform: none !important;
    box-shadow: none !important;
  }

  body.is-home-page #topParts .top-selling-card.oem-rec-card:hover .oem-rec-card__media img:not(.product-brand-fallback),
  body.is-home-page #topParts .top-selling-card.oem-rec-card:hover .top-selling-img-wrap img:not(.product-brand-fallback) {
    transform: none !important;
  }

  body.is-home-page #topParts .oem-rec-card__media .product-brand-fallback,
  body.is-home-page #topParts .top-selling-img-wrap .product-brand-fallback {
    width: 72% !important;
    height: 72% !important;
    object-fit: contain !important;
    margin: auto !important;
    background: transparent !important;
    filter: none !important;
  }

  body.is-home-page #topParts .oem-rec-card__info,
  body.is-home-page #topParts .oem-rec-card .top-selling-footer {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    padding: 0 2px 8px !important;
    margin: 0 !important;
    min-width: 0 !important;
  }

  body.is-home-page #topParts .top-selling-name,
  body.is-home-page #topParts .oem-rec-card__name {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    margin: 0 !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    color: var(--ts-text) !important;
    -webkit-text-fill-color: var(--ts-text) !important;
    text-align: start !important;
    text-transform: none !important;
  }

  body.is-home-page #topParts .oem-rec-card__bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin-top: auto !important;
    padding-top: 8px !important;
    border: none !important;
    min-height: 0 !important;
  }

  body.is-home-page #topParts .oem-rec-card__price,
  body.is-home-page #topParts .top-selling-price-row {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.is-home-page #topParts .oem-rec-card__cart,
  body.is-home-page #topParts .top-selling-actions-row {
    flex: 0 0 auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  body.is-home-page #topParts .product-price-compare,
  body.is-home-page #topParts .product-price-badge {
    display: none !important;
  }

  body.is-home-page #topParts .product-price-sale,
  body.is-home-page #topParts .product-price--single,
  body.is-home-page #topParts .top-selling-price-block .product-price-sale,
  body.is-home-page #topParts .top-selling-price-block .product-price--single {
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #0f2d6b !important;
  }

  body.is-home-page #topParts .product-price-sale span,
  body.is-home-page #topParts .product-price--single span,
  body.is-home-page #topParts .top-selling-price-block .product-price-sale span,
  body.is-home-page #topParts .top-selling-price-block .product-price--single span {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--ts-muted) !important;
    text-transform: uppercase !important;
  }

  body.is-home-page #topParts .top-selling-cart,
  body.is-home-page #topParts .oem-rec-card .top-selling-cart {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 9px 12px !important;
    border-radius: 12px !important;
    border: none !important;
    background: #0062BD !important;
    color: #ffffff !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    font-family: var(--font-en, "Segoe UI", sans-serif) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
  }

  html[dir="rtl"] body.is-home-page #topParts .top-selling-cart,
  html[dir="rtl"] body.is-home-page #topParts .oem-rec-card .top-selling-cart {
    font-family: var(--font-ar, "Segoe UI", Tahoma, sans-serif) !important;
  }

  body.is-home-page #topParts .top-selling-cart:hover,
  body.is-home-page #topParts .top-selling-cart:focus-visible,
  body.is-home-page #topParts .oem-rec-card .top-selling-cart:hover,
  body.is-home-page #topParts .oem-rec-card .top-selling-cart:focus-visible {
    background: #0056b3 !important;
    border: none !important;
    color: #ffffff !important;
  }

  body.is-home-page #topParts .top-selling-cart__icon,
  body.is-home-page #topParts .top-selling-cart svg,
  body.is-home-page #topParts .oem-rec-card .top-selling-cart svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
    color: #ffffff !important;
    stroke: #ffffff !important;
    fill: none !important;
  }

  body.is-home-page #topParts .top-selling-cart__label {
    color: inherit !important;
  }

  body.is-home-page #topParts .top-selling-cart.is-disabled {
    background: #8eb4db !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.72;
  }
}
