/*
 * Momo Review — Home page styles.
 * Port từ React src/components/Hero.css + Categories.css.
 */

/* Hero section */
.hero {
  background: linear-gradient(135deg, rgba(255, 140, 163, 0.05), rgba(108, 176, 199, 0.05));
  padding: 40px 0 80px;
  overflow: hidden;
  position: relative;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 500px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Hero image wrapper */
.hero-image-wrapper {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blob-shape {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--secondary-light), var(--primary-light));
  border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%;
  animation: blob 8s ease-in-out infinite;
  opacity: 0.6;
  z-index: 0;
}

@keyframes blob {
  0%, 100% { border-radius: 50% 40% 60% 50% / 50% 60% 40% 50%; }
  50%      { border-radius: 40% 60% 50% 50% / 60% 50% 60% 40%; }
}

.hero-image-placeholder {
  position: relative;
  z-index: 1;
  width: 85%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.hero-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  border-radius: var(--radius);
}

.hero-fallback-icon {
  width: 40%;
  height: 40%;
  opacity: 0.7;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Floating cards */
.floating-card {
  position: absolute;
  background: var(--surface);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  z-index: 2;
  border: 1px solid var(--border);
}

.floating-card-icon {
  flex-shrink: 0;
}

.floating-card-content strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text);
}

.floating-card-content p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-light);
}

.floating-card.card-1 {
  top: 15%;
  left: -5%;
  animation: float 3s ease-in-out infinite;
}

.floating-card.card-2 {
  bottom: 15%;
  right: -5%;
  animation: float 3s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Top Rated section */
.top-rated-section {
  padding: 60px 0;
}

.top-rated-slider {
  position: relative;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 20px 16px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 20px;
  /* Right-edge fade — visual cue that more cards are off-screen.
     Pure CSS via mask-image, no extra DOM needed. The fade is over
     the scroll container itself so it tracks viewport on swipe. */
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 56px), transparent 100%);
          mask-image: linear-gradient(to right, black 0, black calc(100% - 56px), transparent 100%);
}

.top-rated-slider .review-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

/* Categories Featured section */
.categories-section {
  padding: 60px 0 80px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 16px;
}

.category-grid .review-card {
  width: 100%;
}

.categories-cta {
  text-align: center;
  margin-top: 48px;
}

.categories-cta .btn {
  text-decoration: none;
}

@media (max-width: 968px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .category-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 968px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }
  .hero-content { align-items: center; }
  .hero-description { margin-left: auto; margin-right: auto; }
  .hero-image-wrapper { min-height: 400px; }
  .floating-card.card-1 { left: 5%; }
  .floating-card.card-2 { right: 5%; }
  .top-rated-slider .review-card { flex: 0 0 280px; }
}

@media (max-width: 640px) {
  .hero { padding: 24px 0 60px; }
  /* Hero image takes the full container width on mobile — more impact.
     Reorders: image first, then text (reorder via flex order). */
  .hero-container { gap: 24px; }
  .hero-image-wrapper {
    min-height: 320px;
    width: 100%;
    order: -1;
  }
  .hero-image-placeholder { max-width: 100%; }
  /* Mobile crop: default object-position=center often cuts off heads/faces
     and shows torsos only. Force top-center so the focal subject
     (face / product / baby) stays in the frame. */
  .hero-image-wrapper img,
  .hero-image-placeholder {
    object-position: top center;
  }
  /* Floating cards look awkward on narrow viewports — collapse to
     inline badges under the title so they don't overlap the hero image. */
  .floating-card { display: none; }
  .top-rated-slider {
    padding: 0 16px 16px;
    scroll-padding-left: 16px;
    -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 40px), transparent 100%);
            mask-image: linear-gradient(to right, black 0, black calc(100% - 40px), transparent 100%);
  }
  .top-rated-slider .review-card { flex: 0 0 220px; }
  .hero-badge { font-size: 0.75rem; padding: 5px 12px; }
  .hero-title { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .hero-description { font-size: 0.95rem; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { padding: 10px 20px; font-size: 0.9rem; }
}
