/* RED20-V4-SCROLL-ALIGNMENT-20260902
   Focused UI-only fix:
   - Explore More: always one row. Mobile = 3 full cards + ~half next card.
   - Brands: always one row. Mobile = 4 full cards + ~half next card.
   - Horizontal rows no longer block vertical page scrolling on touch screens.
*/

/* ---------- Touch / page scroll safety ---------- */
html body .red20-products-scroll,
html body .red20-explore-scroll,
html body .red20-brand-scroll,
html body .category-section ul.d-flex {
  touch-action: pan-x pan-y pinch-zoom !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-x: contain !important;
  overscroll-behavior-y: auto !important;
}

/* V3 had pan-x only; explicitly neutralize it so vertical page scroll works
   when the finger starts on a product card. */
html body .red20-horizontal-section .red20-products-scroll {
  touch-action: pan-x pan-y pinch-zoom !important;
}

/* ---------- Shared native horizontal row controls ---------- */
.red20-native-arrow{
  width:32px;height:32px;flex:0 0 32px;border:1px solid #e6e8ec;border-radius:50%;
  background:#fff;color:#25292f;display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.05);padding:0;z-index:3
}
.red20-native-arrow:hover{background:#ff5a00;border-color:#ff5a00;color:#fff}
.red20-native-arrow i{font-size:11px}

/* ---------- Explore More: one row on desktop and mobile ---------- */
html body .red20-explore-section{overflow:hidden!important}
html body .red20-explore-section .red20-section-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important}
.red20-explore-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
html body .red20-explore-scroll{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:10px!important;
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  scroll-snap-type:x proximity!important;
  padding:2px 2px 10px!important;
}
html body .red20-explore-scroll::-webkit-scrollbar{display:none!important}
html body .red20-explore-card{
  display:flex!important;
  flex-direction:column!important;
  flex:0 0 126px!important;
  width:126px!important;
  min-width:126px!important;
  max-width:126px!important;
  box-sizing:border-box!important;
  scroll-snap-align:start!important;
  margin:0!important;
}
html body .red20-explore-image{height:92px!important}
html body .red20-explore-name{font-size:11px!important;line-height:1.2!important;min-height:14px!important}

/* ---------- Brands: replace Swiper feel with clean native one-row scroller ---------- */
.red20-brand-row-shell{display:flex;align-items:center;gap:8px;width:100%;min-width:0}
html body .red20-brand-scroll{
  flex:1 1 auto;
  min-width:0;
  width:100%;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  scroll-snap-type:x proximity;
  padding:2px 2px 8px;
}
html body .red20-brand-scroll::-webkit-scrollbar{display:none!important}
.red20-brand-track{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  gap:10px!important;
  width:max-content!important;
  min-width:max-content!important;
}
.red20-brand-card{
  flex:0 0 118px!important;
  width:118px!important;
  min-width:118px!important;
  max-width:118px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  padding:9px 7px!important;
  background:#fff!important;
  border:1px solid #e8eaee!important;
  border-radius:13px!important;
  box-sizing:border-box!important;
  scroll-snap-align:start!important;
  color:#20242a!important;
}
.red20-brand-image{
  width:82px!important;height:62px!important;display:flex!important;align-items:center!important;justify-content:center!important;
  border-radius:10px!important;background:#fafafa!important;overflow:hidden!important
}
.red20-brand-image img{max-width:90%!important;max-height:90%!important;object-fit:contain!important}
.red20-brand-name{
  display:block!important;width:100%!important;margin-top:7px!important;text-align:center!important;
  font-size:10px!important;line-height:1.2!important;font-weight:650!important;white-space:nowrap!important;
  overflow:hidden!important;text-overflow:ellipsis!important;color:#20242a!important
}

@media (min-width:768px){
  /* Desktop Explore More never wraps to a second line. */
  html body .red20-explore-card{flex-basis:126px!important;width:126px!important;min-width:126px!important;max-width:126px!important}
}

@media (max-width:767.98px){
  .red20-native-arrow{display:none!important}

  /* 3 full Explore cards + roughly half of the next card. */
  html body .red20-explore-section{padding-left:7px!important;padding-right:0!important}
  html body .red20-explore-scroll{gap:6px!important;padding:1px 18px 6px 0!important;scroll-snap-type:x proximity!important}
  html body .red20-explore-card{
    flex:0 0 calc((100vw - 34px) / 3.5)!important;
    width:calc((100vw - 34px) / 3.5)!important;
    min-width:calc((100vw - 34px) / 3.5)!important;
    max-width:calc((100vw - 34px) / 3.5)!important;
    padding:6px!important;border-radius:11px!important
  }
  html body .red20-explore-image{height:66px!important;border-radius:8px!important}
  html body .red20-explore-name{font-size:8.5px!important;margin-top:5px!important}
  .red20-explore-actions{gap:4px}

  /* 4 full Brand cards + roughly half of the next card. */
  .red20-brand-row-shell{gap:0!important;margin-left:0!important;margin-right:-5px!important}
  html body .red20-brand-scroll{padding:1px 18px 5px 0!important}
  .red20-brand-track{gap:6px!important}
  .red20-brand-card{
    flex:0 0 calc((100vw - 39px) / 4.5)!important;
    width:calc((100vw - 39px) / 4.5)!important;
    min-width:calc((100vw - 39px) / 4.5)!important;
    max-width:calc((100vw - 39px) / 4.5)!important;
    padding:5px 4px!important;border-radius:10px!important
  }
  .red20-brand-image{width:100%!important;height:48px!important;border-radius:7px!important}
  .red20-brand-name{font-size:7.5px!important;margin-top:4px!important}
}
