/* Home fixes: unified section surfaces + history section alignment */

:root {
  --home-surface-card: var(--market-card, #ffffff);
  --home-surface-border: var(--market-border, #e3e6ea);
  --home-surface-shadow: var(--market-shadow, 0 6px 18px rgba(16, 24, 40, 0.08));
  --home-banner-gradient: linear-gradient(135deg, #fff7db 0%, #ffe9b1 48%, #ffd789 100%);
  --home-banner-border: rgba(236, 187, 70, 0.45);
}

:is(
  .home-section--history,
  .home-section--deals,
  .home-section--featured,
  .home-section--trending,
  .home-section--reco,
  .home-section--local
) {
  max-width: 1240px;
  margin: 0 auto 24px;
  padding: 18px 20px 22px;
  background: var(--home-surface-card);
  border: 1px solid var(--home-surface-border);
  border-radius: 14px;
  box-shadow: var(--home-surface-shadow);
}

.home-section--history .product-grid {
  margin-top: 0;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
}

.home-section--history .product-card {
  display: flex;
  flex-direction: column;
  background: var(--home-surface-card);
  border: 1px solid var(--home-surface-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  overflow: hidden;
}

.home-section--history .product-card:hover {
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.14);
  transform: translateY(-2px);
}

.home-section--history .product-card__figure {
  min-height: 196px;
  border-bottom: 1px solid #edf0f4;
  background: #ffffff;
}

.home-section--history .product-card__image-link {
  min-height: 196px;
}

.home-section--history .product-card__image-link img,
.home-section--history .product-card__placeholder {
  width: 100%;
  max-height: 168px;
  object-fit: contain;
}

.home-section--history .product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.home-section--history .product-card__price {
  font-size: 1.56rem;
  font-weight: 400;
}

.home-section--history .product-card__title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  min-height: 2.5em;
}

.home-section--history .product-card__title a {
  color: var(--market-text, #333333);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-section--history .product-card__title a:hover {
  color: var(--market-link-hover, #005eb8);
}

.reco-rail__viewport {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.reco-rail__viewport::-webkit-scrollbar {
  display: none;
}

.home-dynamic-banner-row {
  max-width: 1240px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.home-dynamic-banner {
  position: relative;
  border-radius: 14px;
  padding: 18px 18px 16px;
  background: var(--home-banner-gradient);
  border: 1px solid var(--home-banner-border);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
  overflow: hidden;
}

.home-dynamic-banner__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.72);
  color: #7a5300;
}

.home-dynamic-banner__title {
  margin: 8px 0 6px;
  font-size: 1.16rem;
  line-height: 1.25;
  color: #2f2a1f;
}

.home-dynamic-banner__subtitle {
  margin: 0;
  color: #4f4733;
  font-size: 0.9rem;
  line-height: 1.4;
}

.home-dynamic-banner__cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  background: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.home-dynamic-banner__cta:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}

@media (max-width: 768px) {
  :is(
    .home-section--history,
    .home-section--deals,
    .home-section--featured,
    .home-section--trending,
    .home-section--reco,
    .home-section--local
  ) {
    padding: 14px 12px 16px;
    border-radius: 10px;
  }

  .home-section--history .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-dynamic-banner-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
