/* =========================
  3Dreams Best Sellers Slider (Scoped by .td3bs-root)
  NOTE: This CSS intentionally avoids touching global styles.
========================= */

.td3bs-root,
.td3bs-root * { box-sizing: border-box; }

.td3bs-root{
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: #fbf7f1;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  padding: clamp(24px,4vw,44px) 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.td3bs-wrap{
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.td3bs-title{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: #1f2a44;
}

.td3bs-title h2{
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(18px,2.1vw,28px);
  text-align: center;
  line-height: 1.1;
}

.td3bs-line{
  height: 2px;
  border-radius: 999px;
  background: rgba(31,42,68,.10);
}

/* Card */
.td3bs-card{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(31,42,68,.08);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(24,35,55,.08);
  overflow: hidden;
  min-width: 0;
}

.td3bs-card a{
  text-decoration: none;
  color: inherit;
  display: block;
}

.td3bs-thumb{
  background: rgba(0,0,0,.02);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.td3bs-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* no crop */
  display: block;
}

.td3bs-meta{
  padding: 12px 14px 14px;
  text-align: center;
}

.td3bs-name{
  margin: 0;
  font-weight: 900;
  color: #1f2a44;
  font-size: 14px;
  line-height: 1.2;
}

/* Grid (<=4) */
.td3bs-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Slider */
.td3bs-slider{ position: relative; }
.td3bs-viewport{
  overflow: hidden;
  border-radius: 18px;
}
.td3bs-track{
  display: flex;
  gap: 16px;
  will-change: transform;
  transition: transform .35s ease;
  padding: 2px; /* avoids shadow clipping */
}
.td3bs-slide{
  flex: 0 0 calc((100% - 48px) / 4); /* 4 visible */
}

/* Controls */
.td3bs-controls{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

/* ✅ Visible arrows (black/grey) */
.td3bs-navbtn{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.22);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  color: #222;            /* arrow color */
  font-size: 28px;        /* arrow size */
  line-height: 1;
  padding: 0;
}

.td3bs-navbtn:hover{
  filter: brightness(.98);
}

.td3bs-navbtn:active{
  transform: translateY(1px);
}

.td3bs-navbtn:disabled{
  opacity: .40;
  cursor: not-allowed;
  transform: none;
}

.td3bs-navbtn span{
  transform: translateY(-1px);
}

/* Dots */
.td3bs-dots{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 70%;
}

.td3bs-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(31,42,68,.20);
  border: 0;
  cursor: pointer;
  padding: 0;
}

.td3bs-dot[aria-current="true"]{
  background: rgba(0,0,0,.65);
}

/* CTA */
.td3bs-cta{
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.td3bs-cta a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  background: #e7882f;
  color: #fff;
}
.td3bs-cta svg{ width: 18px; height: 18px; }

/* Responsive */
@media (max-width: 980px){
  .td3bs-grid{ grid-template-columns: repeat(2, 1fr); }
  .td3bs-slide{ flex-basis: calc((100% - 16px) / 2); } /* 2 visible */
  .td3bs-thumb{ height: 210px; }
}

@media (max-width: 560px){
  .td3bs-grid{ grid-template-columns: 1fr; }
  .td3bs-slide{ flex-basis: 100%; } /* 1 visible */
  .td3bs-thumb{ height: 200px; }
  .td3bs-dots{ max-width: 100%; }
}

@media (prefers-reduced-motion: reduce){
  .td3bs-track{ transition: none; }
}
