/* Component: popular (sidebar) - extracted from styles.css
   Includes mini-list (mini-card), mini-thumb, and carousel pagination
*/

.sidebar {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 18px;
  padding: clamp(1rem, 3vw, 1.25rem);
  box-shadow: 0 14px 40px rgb(0 0 0 / 25%);
  height: fit-content;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mini-card {
  display: grid;
  /* Ensure a fixed thumbnail column + a flexible but constrained text column to avoid overlap */
  grid-template-columns: 56px minmax(120px, 1fr);
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 14px;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 6%);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  min-height: 84px;
  align-items: start; /* align text to top to avoid vertical overlap with thumbnail */
  overflow: hidden; /* prevent visual overlap */
}

.mini-card:hover {
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 107 53 / 45%);
  transform: translateY(-2px);
}

.mini-thumb {
  /* keep thumbnail spacing consistent */
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff; /* white background for thumbnails */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  aspect-ratio: 1 / 1; /* keep square */
}

.mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* preserve ratio */
  display: block;
}

@media (min-width: 641px) {
  .mini-thumb {
    width: 72px;
    height: 72px;
  }

  /* increase the minimum text column on larger screens to keep title away from the thumb */
  .mini-card { 
    min-height: 96px;
    grid-template-columns: 72px minmax(160px, 1fr);
  }

  .mini-title { font-size: 0.95rem; }
}

.mini-title {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.43em;
  max-height: 2.43em;
  padding-right: 0.25rem; /* keep text away from edges */
}

.mini-price {
  color: rgb(245 245 245 / 70%);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Popular carousel */
.popular-carousel {
  position: relative;
}

.popular-pages {
  position: relative;
  min-height: 260px;
}

.popular-page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.popular-page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.popular-pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  justify-content: center;
  z-index: 2;
}

.popular-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 35%);
  background: rgb(255 255 255 / 8%);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.popular-dot.active {
  background: #FF6B35;
  border-color: #FF6B35;
  box-shadow: 0 6px 18px rgb(255 107 53 / 35%);
}
