/* ============================================
   VITRINE DE PRODUTOS POPULARES
   ============================================ */

/* Importa as variáveis globais */
@import url('app_variables.css');

/* ========== SEÇÃO POPULAR ========== */
.popular {
  margin-top: 1vh;
}

.popular__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--space-2) var(--space-2);
}

.popular__header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: #111827 !important;
}

.popular__header h2 .icon {
  color: #fbbf24;
  margin-right: var(--space-1);
  width: 1.4em;
  height: 1.4em;
}

/* ========== RAIL HORIZONTAL ========== */
.popular__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(130px, 140px);
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  align-items: stretch;
  justify-items: center;
}

.popular__rail::-webkit-scrollbar {
  height: 8px;
}

.popular__rail::-webkit-scrollbar-thumb {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
}

/* ========== CARDS DE PRODUTO ========== */
.card {
  scroll-snap-align: start;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card__img {
  aspect-ratio: 4/3;
  background: var(--color-bg-light);
  position: relative;
  overflow: hidden;
}

.card_img2 {
  width: 130px;
  height: 130px;
  object-fit: cover;
}

.card__img.img-error {
  display: none;
}

.card__body {
  padding: var(--space-2) var(--space-2) var(--space-2);
  display: grid;
  gap: 0.35rem;
}

.card__category {
  font-size: var(--font-size-sm);
  color: #6b7280 !important;
}

.card__title {
  font-weight: var(--font-weight-semibold);
  min-height: 1.2em;
  color: #0f172a !important;
}

/* ========== SKELETON LOADING ========== */
.card--skeleton .card__img,
.card--skeleton .card__category,
.card--skeleton .card__title {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-light);
  border-radius: 0.25rem;
}

.card--skeleton .card__img::after,
.card--skeleton .card__category::after,
.card--skeleton .card__title::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(255,255,255,.45), rgba(0,0,0,0));
  animation: shimmer 1.2s infinite;
}

.card--skeleton .card__img {
  height: 100px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ========== OVERLAY ACTIONS ========== */
.overlay-actions {
  margin-top: var(--space-4);
  width: 100%;
  display: flex;
  justify-content: center;
}

.overlay-hr {
  width: 100%;
  border: 1px solid var(--color-border-light);
  margin: var(--space-3) 0;
}

.overlay-desc {
  color: var(--color-text-tertiary);
  text-align: justify;
  hyphens: auto;
  word-break: break-word;
  max-height: 6em;
  overflow-y: auto;
}
