/* ==========================================================================
   HAVEN MALL - Categories Section (Perfume-Plug Inspired Layout)
   ========================================================================== */

.categories-section {
  padding: 2.5rem 0 1.5rem 0;
  background-color: var(--bg-light, #f8fafc);
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.categories-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.categories-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-color, #1e293b);
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.categories-title-group h2 i {
  color: var(--primary-accent, #ff4757);
}

.categories-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

/* ─── GRID LAYOUT ───────────────────────────────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* ─── CATEGORY CARD ─────────────────────────────────────────────────────── */
.category-card {
  position: relative;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  text-decoration: none;
  background-color: #1e293b;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

/* Card Background Image & Zoom */
.category-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-card-img {
  transform: scale(1.08);
}

/* Soft bottom scrim only under the text — image stays visible */
.category-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.72) 0%,
    rgba(15, 23, 42, 0.28) 45%,
    transparent 100%
  );
  pointer-events: none;
  transition: height 0.3s ease, background 0.3s ease;
}

.category-card:hover .category-card-overlay {
  height: 58%;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.78) 0%,
    rgba(15, 23, 42, 0.32) 50%,
    transparent 100%
  );
}

/* Icon Badge */
.category-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: all 0.3s ease;
}

.category-card:hover .category-card-badge {
  background: var(--primary-accent, #ff4757);
  border-color: var(--primary-accent, #ff4757);
  transform: scale(1.1);
}

/* Content Text Box */
.category-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  z-index: 2;
  color: #ffffff;
}

.category-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(0, 0, 0, 0.35);
  -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.25);
}

.category-card-subtext {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.8),
    0 0 8px rgba(0, 0, 0, 0.3);
}

/* ─── RESPONSIVE MOBILE VIEW (2 IN A ROW) ────────────────────────────────── */
@media (max-width: 992px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .categories-section {
    padding: 1.8rem 0 1rem 0;
  }

  .categories-header {
    margin-bottom: 1rem;
  }

  .categories-title-group h2 {
    font-size: 1.35rem;
  }

  /* 2 CARDS IN A ROW ON MOBILE VIEW (PERFUME-PLUG STYLE) */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .category-card {
    height: 155px;
    border-radius: 14px;
  }

  .category-card-content {
    padding: 10px 10px 10px 10px;
  }

  .category-card-title {
    font-size: 0.88rem;
    margin-bottom: 2px;
  }

  .category-card-subtext {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
  }

  .category-card-badge {
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
}
