/* Home page only: consistent, swipeable category cards in the mobile/tablet shell.
   This stylesheet is loaded after layout_v4.css to avoid affecting other pages. */
@media (max-width: 1199.98px) {
  .mobile-category-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 7px 0 16px;
    isolation: isolate;
  }

  .mobile-category-carousel .mobile-cat-track {
    display: flex;
    align-items: stretch;
    gap: 9px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 20px 10px;
    scroll-padding-inline: 20px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .mobile-category-carousel .mobile-cat-track::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobile-category-carousel .mobile-cat-card {
    box-sizing: border-box;
    flex: 0 0 118px;
    width: 118px;
    height: 106px;
    min-width: 118px;
    max-width: 118px;
    min-height: 106px;
    padding: 12px 8px 10px;
    border: 1px solid #e9edf3;
    border-radius: 15px;
    background: linear-gradient(160deg, #ffffff 30%, #fff8f8 100%);
    box-shadow: 0 3px 10px rgba(20, 28, 44, .065);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    scroll-snap-align: start;
    color: #142032;
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-category-carousel .mobile-cat-card > i {
    display: block;
    flex: 0 0 auto;
    font-size: 28px;
    line-height: 1;
    color: #e30514;
  }

  .mobile-category-carousel .mobile-cat-label {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 30px;
    font-size: 11.5px;
    line-height: 1.2;
    font-weight: 750;
    color: #182033;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    text-wrap: balance;
  }

  .mobile-category-carousel .mobile-cat-card:active {
    border-color: #e30514;
    background: #fff2f2;
  }

  .mobile-category-carousel .mobile-cat-card:focus-visible,
  .mobile-category-carousel .mobile-cat-arrow:focus-visible,
  .mobile-category-carousel .mobile-cat-track:focus-visible {
    outline: 2px solid #de1220;
    outline-offset: 2px;
  }

  .mobile-category-carousel .mobile-cat-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-55%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 1px solid #f1dfe1;
    border-radius: 50%;
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 10px rgba(18,27,42,.16);
    color: #d60817;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-category-carousel .mobile-cat-arrow--prev { left: 0; }
  .mobile-category-carousel .mobile-cat-arrow--next { right: 0; }

  .mobile-category-carousel .mobile-cat-arrow:disabled {
    opacity: .38;
    cursor: default;
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  .mobile-category-carousel .mobile-cat-card {
    flex-basis: 112px;
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    height: 102px;
    min-height: 102px;
    border-radius: 13px;
    gap: 8px;
  }

  .mobile-category-carousel .mobile-cat-card > i { font-size: 26px; }
  .mobile-category-carousel .mobile-cat-label { font-size: 11px; }
}

/* Category carousel on product and category-detail pages; inherit exactly the home dimensions. */
@media(max-width:1199.98px){
  .ms-catalog-category-carousel{margin-top:8px;margin-bottom:18px;max-width:100%;}
  .ms-catalog-category-carousel .mobile-cat-card.is-active{border-color:#ea182a;background:#fff7f7;box-shadow:0 3px 14px rgba(216,7,18,.09)}
  .ms-catalog-category-carousel .mobile-cat-card .mobile-cat-label{overflow-wrap:anywhere;hyphens:auto;max-height:44px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;}
  .mobile-category-carousel.is-not-scrollable .mobile-cat-arrow{visibility:hidden;}
  .mobile-category-carousel .mobile-cat-arrow{touch-action:manipulation;}
}
