/* Mars 1.6.8 — mobile sale/carousel layout repair */

@media (max-width:700px){
  /* Keep every home product rail inside the mobile viewport. */
  .mars-product-section,
  .mars-product-section .mars-carousel-shell,
  .mars-product-section .mars-product-carousel{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .mars-product-section .mars-carousel-shell{
    width:100%!important;
    overflow:hidden!important;
  }
  .mars-product-section .mars-product-carousel{
    display:flex!important;
    width:100%!important;
    margin:0!important;
    padding:1px 0 8px!important;
    gap:10px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
  }
  .mars-product-section .mars-product-carousel::-webkit-scrollbar{display:none!important}
  .mars-product-section .mars-product-carousel>li.product{
    flex:0 0 var(--mars-carousel-basis-mobile)!important;
    width:var(--mars-carousel-basis-mobile)!important;
    max-width:var(--mars-carousel-basis-mobile)!important;
    min-width:0!important;
    margin:0!important;
    scroll-snap-align:start!important;
  }

  /* Flash-sale section: clean single-column mobile card + two-card swipe rail. */
  .mars-flash-sale.mars-container{
    width:min(calc(100% - 20px),var(--mars-container,1400px))!important;
    max-width:var(--mars-container,1400px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding:0!important;
    overflow:hidden!important;
  }
  .mars-flash-sale__head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    gap:10px!important;
    width:100%!important;
    margin:0 0 12px!important;
  }
  .mars-flash-sale__head>div:first-child{min-width:0!important}
  .mars-flash-sale__head h2{
    margin:0!important;
    font-size:22px!important;
    line-height:1.2!important;
    letter-spacing:-.35px!important;
  }
  .mars-flash-sale__head p{
    margin:4px 0 0!important;
    max-width:100%!important;
    font-size:10.5px!important;
    line-height:1.45!important;
  }
  .mars-flash-sale__head-actions{
    align-self:end!important;
    gap:0!important;
    padding-bottom:1px!important;
  }
  .mars-flash-sale__head-actions>a{
    font-size:10px!important;
    gap:4px!important;
  }
  .mars-flash-sale__nav{display:none!important}

  .mars-flash-sale__layout{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    gap:10px!important;
  }
  .mars-flash-featured{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:0!important;
    border-radius:7px!important;
    overflow:hidden!important;
  }
  .mars-flash-featured__image{
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    aspect-ratio:16/11!important;
    padding:12px!important;
    overflow:hidden!important;
  }
  .mars-flash-featured__image img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:none!important;
    object-fit:contain!important;
  }
  .mars-flash-badge{
    left:10px!important;
    top:10px!important;
    min-width:44px!important;
    height:26px!important;
    padding:0 7px!important;
    font-size:10px!important;
    border-radius:5px!important;
  }
  .mars-flash-featured__content{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding:16px 14px 17px!important;
  }
  .mars-flash-countdown-label{
    gap:6px!important;
    margin-bottom:9px!important;
    font-size:10px!important;
  }
  .mars-flash-countdown-label .mars-icon{width:14px!important;height:14px!important}
  .mars-flash-countdown{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    gap:6px!important;
    margin:0 0 16px!important;
  }
  .mars-flash-countdown>span{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .mars-flash-countdown>span:not(:last-child)::after{display:none!important}
  .mars-flash-countdown b{
    width:100%!important;
    max-width:none!important;
    height:37px!important;
    font-size:15px!important;
    border-radius:5px!important;
  }
  .mars-flash-countdown small{
    margin-top:4px!important;
    font-size:6.5px!important;
    letter-spacing:.1px!important;
  }
  .mars-flash-featured__content h3{
    margin:0 0 7px!important;
    font-size:18px!important;
    line-height:1.28!important;
  }
  .mars-flash-featured__content>p{
    margin:0 0 11px!important;
    font-size:11px!important;
    line-height:1.55!important;
  }
  .mars-flash-rating{margin-bottom:8px!important;font-size:9px!important}
  .mars-flash-featured__price{
    margin:0 0 13px!important;
    gap:6px!important;
    font-size:19px!important;
  }
  .mars-flash-featured__price del{font-size:11px!important}
  .mars-flash-featured__button{
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    justify-content:center!important;
    font-size:11px!important;
  }

  .mars-flash-sale__products{
    display:flex!important;
    grid-template-columns:none!important;
    grid-auto-flow:initial!important;
    grid-auto-columns:initial!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    gap:10px!important;
    margin:0!important;
    padding:0 0 4px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    contain:inline-size!important;
  }
  .mars-flash-sale__products::-webkit-scrollbar{display:none!important}
  .mars-flash-small-card{
    flex:0 0 calc(50% - 5px)!important;
    width:calc(50% - 5px)!important;
    max-width:calc(50% - 5px)!important;
    min-width:0!important;
    border-radius:7px!important;
    scroll-snap-align:start!important;
  }
  .mars-flash-small-card__image{
    width:100%!important;
    min-width:0!important;
    min-height:128px!important;
    height:128px!important;
    padding:10px 10px 3px!important;
  }
  .mars-flash-small-card__image img{
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    object-fit:contain!important;
  }
  .mars-flash-small-card .mars-flash-badge{
    left:8px!important;
    top:8px!important;
    min-width:38px!important;
    height:23px!important;
    font-size:9px!important;
  }
  .mars-flash-small-card__body{padding:8px 9px 11px!important;min-width:0!important}
  .mars-flash-small-card__body h3{
    min-height:30px!important;
    margin:0 0 5px!important;
    font-size:10.5px!important;
    line-height:1.42!important;
  }
  .mars-flash-small-card .mars-flash-rating{min-height:14px!important;margin-bottom:5px!important;font-size:8px!important}
  .mars-flash-small-card .star-rating{font-size:9px!important}
  .mars-flash-price{gap:4px!important;font-size:13px!important;line-height:1.25!important}
  .mars-flash-price del{font-size:9px!important}
  .mars-flash-sale__dots{
    display:flex!important;
    margin-top:10px!important;
    gap:6px!important;
  }
  .mars-flash-sale__dots button{width:6px!important;height:6px!important}
}

@media (max-width:380px){
  .mars-flash-sale__head h2{font-size:20px!important}
  .mars-flash-sale__head p{font-size:9.5px!important}
  .mars-flash-sale__head-actions>a{font-size:9px!important}
  .mars-flash-featured__image{aspect-ratio:4/3!important}
  .mars-flash-featured__content{padding:14px 12px 15px!important}
  .mars-flash-countdown{gap:4px!important}
  .mars-flash-countdown b{height:34px!important;font-size:14px!important}
  .mars-flash-small-card__image{height:116px!important;min-height:116px!important}
}
