/* MYGEAR Store UI — homepage mobile/tablet (≤991px) */

@media (max-width: 991px) {
  .mg-ui-v2 .mg-store-home {
    overflow-x: clip;
  }

  /* Hero — touch-friendly dots + nav */
  .mg-ui-v2 .mg-store-home-hero__dots {
    opacity: 1;
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-hero__carousel-shell .mg-store-home-hero__nav.mg-store-carousel-nav {
    opacity: 0.92;
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-zone {
    padding-block: 8px 12px;
  }

  /* Sub-banners dưới hero — ẩn mobile/tablet, chỉ hiện desktop ≥992px */
  .mg-ui-v2 .mg-store-home-zone__sub {
    display: none;
  }

  /* Hero strip row — vuốt ngang 3 slot (combo / banner / deal), cùng chiều cao */
  .mg-ui-v2 .mg-store-home-zone__strips {
    --mg-home-strip-mobile-frame-h: 200px;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--store-gap, 12px);
    scrollbar-width: none;
    padding-bottom: 0;
  }

  .mg-ui-v2 .mg-store-home-zone__strips::-webkit-scrollbar {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-zone__strips > * {
    display: flex;
    flex: 0 0 min(88vw, 360px);
    min-width: 0;
    scroll-snap-align: start;
    align-self: stretch;
  }

  .mg-ui-v2 .mg-store-home-strip__carousel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: var(--mg-home-strip-mobile-frame-h);
  }

  .mg-ui-v2 .mg-store-home-strip__shell {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: var(--mg-home-strip-mobile-frame-h);
    min-height: var(--mg-home-strip-mobile-frame-h);
  }

  /*
   * Combo-only (full width): content-driven height so price/buttons never clip.
   * Multi-slot carousels keep fixed frame + absolute slides below.
   */
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only {
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only > * {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__carousel,
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__shell {
    height: auto;
    min-height: 0;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame,
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame--combo {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__track {
    position: relative;
    inset: auto;
    height: auto;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__slide {
    position: relative;
    inset: auto;
    height: auto;
    max-height: 0;
    overflow: hidden;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__slide--active {
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__combo-panel {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 10px 12px 14px;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__dots {
    position: relative;
    bottom: auto;
    padding: 6px 0 0;
    background: none;
  }

  /* Dots nằm trong card — không kéo cao container */
  .mg-ui-v2 .mg-store-home-strip__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    margin-top: 0;
    min-height: 0;
    padding: 10px 0 6px;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.72) 45%, rgba(255, 255, 255, 0.92) 100%);
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-strip__carousel--combo .mg-store-home-strip__dots {
    background: linear-gradient(180deg, transparent 0%, rgba(255, 249, 248, 0.75) 45%, rgba(255, 249, 248, 0.95) 100%);
  }

  .mg-ui-v2 .mg-store-home-strip__frame,
  .mg-ui-v2 .mg-store-home-strip__frame--banner,
  .mg-ui-v2 .mg-store-home-strip__frame--combo,
  .mg-ui-v2 .mg-store-home-strip__frame--product {
    height: var(--mg-home-strip-mobile-frame-h);
    min-height: var(--mg-home-strip-mobile-frame-h);
    max-height: var(--mg-home-strip-mobile-frame-h);
    overflow: hidden;
  }

  .mg-ui-v2 .mg-store-home-strip__frame--banner {
    aspect-ratio: auto;
  }

  .mg-ui-v2 .mg-store-home-strip__frame--combo .mg-store-home-strip__combo-panel {
    height: 100%;
    max-height: 100%;
    padding-bottom: 20px;
    overflow: hidden;
  }

  .mg-ui-v2 .mg-store-home-strip__frame .mg-store-home-strip__track {
    position: absolute;
    inset: 0;
    height: 100%;
    min-height: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__frame .mg-store-home-strip__slide {
    position: absolute;
    inset: 0;
    height: 100%;
    max-height: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .mg-ui-v2 .mg-store-home-strip__frame .mg-store-home-strip__slide--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-strip__frame--product .mg-store-home-strip__track--product {
    position: absolute;
    inset: 0;
    height: auto;
    top: 0;
    bottom: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-panel {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 8px 10px 20px;
    gap: 6px;
    box-sizing: border-box;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-goods-well {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
    padding: 0;
    overflow: hidden;
  }

  /* Reinstate combo-only natural height after general absolute-frame rules */
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__carousel,
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__shell {
    height: auto;
    min-height: 0;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame,
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame--combo {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__track {
    position: relative;
    inset: auto;
    height: auto;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__slide {
    position: relative;
    inset: auto;
    height: auto;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__slide:not(.mg-store-home-strip__slide--active) {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame .mg-store-home-strip__slide--active {
    display: flex;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__frame--combo .mg-store-home-strip__combo-panel,
  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__combo-panel {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 10px 12px 14px;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__combo-goods-well {
    flex: 0 0 auto;
    overflow: visible;
  }

  .mg-ui-v2 .mg-store-home-zone__strips--combo-only .mg-store-home-strip__dots {
    position: relative;
    bottom: auto;
    padding: 6px 0 0;
    background: none;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-category {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-head {
    padding-bottom: 4px;
    border-bottom-width: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-head-copy {
    min-width: 0;
    overflow: hidden;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-headline {
    font-size: 13px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-head .mg-store-home-strip__more {
    flex-shrink: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-goods-row {
    flex-direction: row;
    align-items: stretch;
    gap: 2px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-goods-item {
    flex: 1 1 0;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    gap: 2px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-cell-link {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    text-align: center;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-good-img {
    width: 48px;
    max-width: 48px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-cell-title {
    font-size: 10px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    text-align: center;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-plus {
    width: 14px;
    height: 14px;
    margin: 0;
    align-self: center;
    flex-shrink: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(217, 22, 5, 0.08);
  }

  .mg-ui-v2 .mg-store-home-strip__combo-pricing {
    flex: 1 1 120px;
    min-width: 0;
    gap: 4px 6px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-eq {
    font-size: 12px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-price {
    font-size: 16px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-price-old {
    font-size: 10px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-actions {
    flex: 1 1 140px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-actions .mg-store-home-strip__btn--primary:only-child {
    grid-column: 1 / -1;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-actions .mg-store-home-strip__btn {
    min-height: 34px;
    font-size: 11px;
    padding-inline: 6px;
  }

  .mg-ui-v2 .mg-store-home-strip__frame--product .mg-store-home-strip__track--product {
    position: relative;
    min-height: 0;
  }

  /* Product strip — gọn để khớp chiều cao combo/banner */
  .mg-ui-v2 .mg-store-home-strip__frame--product .mg-store-home-strip__product-head {
    flex-shrink: 0;
    padding: 6px 8px 4px;
    min-height: 0;
    gap: 6px;
  }

  .mg-ui-v2 .mg-store-home-strip__frame--product .mg-store-home-strip__product-label {
    font-size: 12px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-panel {
    height: 100%;
    min-height: 0;
    gap: 4px;
    padding: 4px 8px 20px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .mg-ui-v2 .mg-store-home-strip__product-main {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 6px;
    align-items: center;
  }

  .mg-ui-v2 .mg-store-home-strip__product-info {
    gap: 4px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-name {
    font-size: 11px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    min-height: calc(2 * 1.3em);
  }

  .mg-ui-v2 .mg-store-home-strip__product-promo {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-strip__product-teaser .mg-store-price-teaser__now {
    font-size: 15px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-teaser .mg-store-price-teaser__wait {
    font-size: 14px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-cta {
    font-size: 11px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-price {
    font-size: 15px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-price-old {
    font-size: 10px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-img {
    max-height: 64px;
  }

  .mg-ui-v2 .mg-store-home-strip__product-media-well {
    min-height: 0;
    max-height: 72px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-actions .mg-store-home-strip__btn {
    min-height: 32px;
  }

  /* Category split — stack visual above carousel on tablet */
  .mg-ui-v2 .mg-store-home-cat__split {
    grid-template-columns: 1fr;
    margin-top: 0;
    padding: 14px 10px 10px;
  }

  .mg-ui-v2 .mg-store-home-cat__split--visual-right .mg-store-home-cat__visual,
  .mg-ui-v2 .mg-store-home-cat__split--visual-right .mg-store-home-cat__products {
    order: unset;
  }

  .mg-ui-v2 .mg-store-home-cat__visual {
    min-height: 120px;
  }

  .mg-ui-v2 .mg-store-home-cat__products {
    padding-left: 0;
    padding-right: 0;
  }

  .mg-ui-v2 .mg-store-home-cat__products .mg-store-home-rail__carousel,
  .mg-ui-v2 .mg-store-home-cat__products .mg-store-home-rail__viewport,
  .mg-ui-v2 .mg-store-home-cat__products .mg-store-home-rail__track,
  .mg-ui-v2 .mg-store-home-cat__products .mg-store-home-rail__item {
    background: #fff;
  }

  .mg-ui-v2 .mg-store-home-cat__tabs-row {
    flex-wrap: nowrap;
    min-height: 50px;
    padding: 0;
  }

  .mg-ui-v2 .mg-store-home-cat__tabs-scroll {
    min-height: 50px;
    scroll-snap-type: x proximity;
  }

  .mg-ui-v2 .mg-store-home-cat__tab {
    min-width: 120px;
    min-height: 50px;
    padding: 12px 16px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .mg-ui-v2 .mg-store-home-cat__tab-label {
    white-space: normal;
    font-size: 15px;
  }

  .mg-ui-v2 .mg-store-home-cat__tab-sub {
    font-size: 12px;
  }

  .mg-ui-v2 .mg-store-home-cat__view-all--tabs {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-cat__products-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
  }

  .mg-ui-v2 .mg-store-home-cat__view-all--mobile {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 8px 4px;
  }

  .mg-ui-v2 .mg-store-home-rail__carousel {
    --rail-card-gap: 2px;
    --rail-card-body-h: 160px;
    --rail-card-price-h: 68px;
  }

  /* Category/product rail — native vuốt ngang trên mobile/tablet */
  .mg-ui-v2 .mg-store-home-rail__viewport.mg-store-home-rail__viewport--touch {
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
  }

  .mg-ui-v2 .mg-store-home-rail__viewport--touch::-webkit-scrollbar {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-rail__track--touch {
    display: flex;
    align-items: stretch;
    width: max-content;
    min-width: 100%;
    transform: none !important;
    will-change: auto;
    gap: var(--rail-card-gap, 2px);
  }

  .mg-ui-v2 .mg-store-home-rail__track--touch > .mg-store-home-rail__item {
    display: flex;
    align-self: stretch;
    padding-inline: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .mg-ui-v2 .mg-store-home-rail__item .mg-store-card {
    padding-inline: 2px;
    height: 100%;
    min-height: 100%;
  }

  .mg-ui-v2 .mg-store-fs__carousel {
    --fs-card-gap: 2px;
  }

  .mg-ui-v2 .mg-store-fs-card {
    padding-inline: 6px;
  }

  .mg-ui-v2 .mg-store-home-rail__item .mg-store-card__name-text {
    font-size: 13px;
    height: var(--rail-card-name-h, calc(2 * 1.35em));
    min-height: var(--rail-card-name-h, calc(2 * 1.35em));
    max-height: var(--rail-card-name-h, calc(2 * 1.35em));
  }

  /* Keep tab panel floor so skeleton ↔ content / tab switches don't jump */
  .mg-ui-v2 .mg-store-tab-panel {
    min-height: 280px;
  }

  /* Recently viewed — v2 rail sizing */
  .mg-ui-v2 .mg-store-home-rail--recent .rv-section-head {
    padding: 10px 0 8px;
  }

  /* Tile module — 2 col tablet */
  .mg-ui-v2 .mg-store-home-tile-module__grid.col-w-3 > .grid-col {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }

  /* Build PC CTA */
  .mg-ui-v2 .mg-store-home-buildpc__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .mg-ui-v2 .mg-store-home-buildpc__btn {
    width: 100%;
  }

  /* Video block */
  .mg-ui-v2 .mg-store-home-video__item {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding-block: 12px;
  }

  .mg-ui-v2 .mg-store-home-video__featured-title {
    font-size: 14px;
  }

  .mg-ui-v2 .mg-store-home-video__play--lg {
    width: 56px;
    height: 56px;
  }

  .mg-ui-v2 .mg-store-home-article__title {
    font-size: 13px;
  }

  .mg-ui-v2 .mg-store-home-article__summary {
    -webkit-line-clamp: 2;
  }
}

/* Category visual — chỉ ẩn phone; tablet vẫn hiện */
@media (max-width: 767px) {
  .mg-ui-v2 .mg-store-home-cat__visual {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-cat__split {
    padding: 10px;
  }
}

/* Combo strip — phone: full-width card trong snap row */
@media (max-width: 767px) {
  .mg-ui-v2 .mg-store-home-zone__strips > * {
    flex-basis: min(92vw, 340px);
  }

  .mg-ui-v2 .mg-store-home-strip__frame,
  .mg-ui-v2 .mg-store-home-strip__frame--banner,
  .mg-ui-v2 .mg-store-home-strip__frame--combo,
  .mg-ui-v2 .mg-store-home-strip__frame--product {
    min-height: 0;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-panel {
    padding: 8px;
    gap: 5px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-good-img {
    width: 40px;
    max-width: 40px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-cell-link {
    gap: 3px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-cell-title {
    font-size: 9px;
    -webkit-line-clamp: 1;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-headline {
    font-size: 12px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-price {
    font-size: 15px;
  }

  .mg-ui-v2 .mg-store-home-strip__combo-actions .mg-store-home-strip__btn {
    min-height: 32px;
    font-size: 10px;
    padding-inline: 4px;
  }

  .mg-ui-v2 .mg-store-home-strip__btn--primary {
    background: #d02915;
    border-color: #d02915;
  }

  .mg-ui-v2 .mg-store-home-strip__btn--primary:hover:not(:disabled) {
    background: var(--store-brand-dark);
    border-color: var(--store-brand-dark);
  }

  .mg-ui-v2 .mg-store-home-rail__item--filter {
    display: none;
  }

  .mg-ui-v2 .mg-store-home-tile-module__grid.col-w-3 > .grid-col {
    flex: 1 1 100%;
    max-width: 100%;
  }
}