/* hscroll v1 - horizontal carousels for comss.ru
   Replaces old .horizontal mechanics (display:table-cell + native scrollbar)
   with flex + scroll-snap, edge fading and arrow buttons.
   Buttons and .hscroll-wrap are created by /js/hscroll.js
   ------------------------------------------------------------------ */

div.horizontal{
  display:flex;
  gap:12px;
  width:100%;
  padding:12px 14px 14px 14px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;
  scroll-padding-left:14px;
  scroll-padding-right:14px;
  -webkit-overflow-scrolling:touch;
  background-color:#eee;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
div.horizontal::-webkit-scrollbar{display:none;}

.rbox{
  display:block;
  flex:0 0 auto;
  margin:0;
  padding:0;
  scroll-snap-align:start;
}

.rapp{
  width:166px;
  height:100%;
  background:#fff;
  padding:10px 7px;
  border-radius:10px;
  box-shadow:0 1px 3px rgba(0,0,0,.07);
  transition:transform .15s ease, box-shadow .15s ease;
}
.rapp:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 18px rgba(0,0,0,.13);
}

/* rating+badge row: never clip, otherwise the badge gets cut */
.rapp .clip{overflow:visible;}
.rapp .label{white-space:nowrap;}
/* title: single line with ellipsis, as before */
.rapp .list_title.clip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------- edge fading + scroll buttons ---------- */
.hscroll-wrap{position:relative;}

.hscroll-wrap::before,
.hscroll-wrap::after{
  content:'';
  position:absolute;
  top:0;bottom:0;
  width:64px;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
  z-index:2;
}
.hscroll-wrap::before{left:0;background:linear-gradient(90deg,#eee 15%,rgba(238,238,238,0) 100%);}
.hscroll-wrap::after{right:0;background:linear-gradient(270deg,#eee 15%,rgba(238,238,238,0) 100%);}
.hscroll-wrap.can-left::before{opacity:1;}
.hscroll-wrap.can-right::after{opacity:1;}

.hscroll-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:38px;height:38px;
  padding:0;border:0;border-radius:50%;
  background:#fff;color:#333;
  font-size:22px;
  font-family:Arial,Helvetica,sans-serif;
  box-shadow:0 2px 10px rgba(0,0,0,.2);
  cursor:pointer;
  z-index:3;
  display:none;
  align-items:center;
  justify-content:center;
  transition:background .15s, box-shadow .15s;
}
.hscroll-btn:hover{background:#f2f2f2;box-shadow:0 4px 16px rgba(0,0,0,.26);}
.hscroll-prev{left:8px;}
.hscroll-next{right:8px;}
.hscroll-wrap.can-left .hscroll-prev{display:flex;}
.hscroll-wrap.can-right .hscroll-next{display:flex;}

/* touch devices: swipe instead of buttons */
@media (hover:none){.hscroll-btn{display:none!important;}}

/* narrow screens: thinner fade so it does not eat content */
@media (max-width:767.98px){
  .hscroll-wrap::before,.hscroll-wrap::after{width:36px;}
}
@media (max-width:575.98px){
  .hscroll-wrap::before,.hscroll-wrap::after{width:24px;}
  .hscroll-wrap::before{background:linear-gradient(90deg,#eee 30%,rgba(238,238,238,0) 100%);}
  .hscroll-wrap::after{background:linear-gradient(270deg,#eee 30%,rgba(238,238,238,0) 100%);}
}
@media (max-width:480px){
  .rapp{width:152px;}
}
