/**
 * HAMI DIGITAL - PHASE 2 APPROVED CATEGORY RAIL COMPONENT
 * Digikala-Inspired 7 Boutique Categories with Zero-Box Multiply & Soft White Spotlight Bloom
 */

.category-rail-section {
  width: 100%;
  margin: 32px 0 24px;
  overflow-x: visible;
}

.category-rail-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  align-items: center;
}

@media (max-width: 900px) {
  .category-rail-grid {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    gap: 18px;
    padding: 14px 6px 18px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-rail-grid::-webkit-scrollbar {
    display: none;
  }
  .cat-pedestal-disc {
    border-radius: 50%;
  }
}

.cat-item-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  scroll-snap-align: start;
  flex-shrink: 0;
}

.cat-item-link:hover {
  transform: translateY(-4px);
}

/* Base Light Mode Pedestal */
.cat-pedestal-disc {
  width: 78px;
  height: 78px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.16);
  position: relative;
  overflow: hidden;
  transition: all 220ms ease;
}

.cat-item-link:hover .cat-pedestal-disc {
  border-color: #0284c7;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.35);
  transform: scale(1.06);
}

/* Dark Mode: Mode 2 Soft White Spotlight Bloom (Approved by User) */
[data-theme="dark"] .cat-pedestal-disc,
.dark .cat-pedestal-disc {
  background: #ffffff;
  border: 1.5px solid #ffffff;
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.32),
    0 0 32px rgba(255, 255, 255, 0.16),
    0 6px 20px rgba(0, 0, 0, 0.7);
  transition: all 220ms ease;
}

[data-theme="dark"] .cat-item-link:hover .cat-pedestal-disc,
.dark .cat-item-link:hover .cat-pedestal-disc {
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.55),
    0 0 48px rgba(255, 255, 255, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.85);
  transform: scale(1.06);
}

/* Zero-Box Optical Stage with Radial Edge Dissolve */
.cat-optical-stage {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cat-optical-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(circle at center, black 62%, transparent 98%);
  mask-image: radial-gradient(circle at center, black 62%, transparent 98%);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.12));
  transition: transform 220ms ease;
}

.cat-item-link:hover .cat-optical-stage img {
  transform: scale(1.1);
}

/* Typography Label */
.cat-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.cat-item-link:hover .cat-label {
  color: #0284c7;
}

[data-theme="dark"] .cat-label,
.dark .cat-label {
  color: #f1f5f9;
}

[data-theme="dark"] .cat-item-link:hover .cat-label,
.dark .cat-item-link:hover .cat-label {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
