/* =============================================================
   PREMIUM CATEGORY CAROUSEL & GRID STYLES
   ============================================================= */

/* ── STRUTURAL WRAPPER ── */
.advanced-cat-section {
  padding: 80px 0;
  position: relative;
  background: transparent;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

.adv-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  position: relative;
}

.adv-cat-header::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #8b5cf6) 100%);
  border-radius: 4px;
}

.adv-cat-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary, #111827);
  margin: 0;
}

/* Base HTML.dark or prefers-color-scheme resets */
html[data-theme="dark"] .adv-cat-title { color: #f8fafc; }

.adv-cat-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary, #6366f1);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 16px;
  background: rgba(99,102,241,0.08);
  border-radius: 30px;
}
.adv-cat-view-all:hover {
  background: var(--primary, #6366f1);
  color: #fff;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ── CAROUSEL JAVASCRIPT BINDINGS ── */
/* These classes are strictly required by category-carousel.js */
.cc-carousel-wrap { position: relative; }
.cc-viewport {
  overflow: hidden;
  margin: 0 -15px; 
  padding: 20px 15px;
  cursor: grab;
}
.cc-viewport.is-dragging { cursor: grabbing; user-select: none; }
.cc-track {
  display: flex;
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

/* Responsive Grid Logic */
.cc-item { flex: 0 0 calc(16.666% - 17px); min-width: 150px; }
@media(max-width: 1200px) { .cc-item { flex: 0 0 calc(20% - 16px); } }
@media(max-width: 992px) { .cc-item { flex: 0 0 calc(25% - 15px); } }
@media(max-width: 768px) { .cc-item { flex: 0 0 calc(33.333% - 14px); } }
@media(max-width: 576px) { .cc-item { flex: 0 0 calc(45% - 10px); } }

/* ── PREMIUM CATEGORY CARDS ── */
.adv-cat-card {
  display: block;
  text-decoration: none;
  position: relative;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  height: 100%;
}

html[data-theme="dark"] .adv-cat-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
}

.adv-cat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--primary, #6366f1);
}
html[data-theme="dark"] .adv-cat-card:hover { border-color: var(--primary, #6366f1); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); }

/* ── DOMINANT IMAGE GLOW ── */
.adv-cat-img-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 18px;
  transition: all 0.5s ease;
}

html[data-theme="dark"] .adv-cat-img-wrap {
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.adv-cat-card:hover .adv-cat-img-wrap {
  background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #8b5cf6) 100%);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.2), 0 10px 20px rgba(99,102,241,0.3);
}

.adv-cat-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.1));
  position: relative;
  z-index: 2;
}

.adv-cat-icon-placeholder {
  font-size: 2.5rem;
  color: var(--primary, #6366f1);
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
}

.adv-cat-card:hover .adv-cat-icon-placeholder {
  color: #ffffff;
  transform: scale(1.15) rotate(5deg);
}

.adv-cat-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #1f2937);
  transition: color 0.3s ease;
  display: block;
  line-height: 1.3;
}
html[data-theme="dark"] .adv-cat-name { color: #f8fafc; }

.adv-cat-card:hover .adv-cat-name { color: var(--primary, #6366f1); }
.adv-cat-card:hover .adv-cat-img { transform: scale(1.15); }

/* ── NAVIGATION ARROWS ── */
.adv-cat-arrows-group {
  display: flex;
  gap: 12px;
  margin-left: 20px;
}
.cc-prev-btn, .cc-next-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  color: var(--text-primary, #374151);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
html[data-theme="dark"] .cc-prev-btn, html[data-theme="dark"] .cc-next-btn {
  background: rgba(30,41,59,0.9);
  border-color: rgba(255,255,255,0.1);
  color: #f8fafc;
}

.cc-prev-btn:hover:not(:disabled), .cc-next-btn:hover:not(:disabled) {
  background: var(--primary, #6366f1);
  color: #ffffff;
  border-color: var(--primary, #6366f1);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(99,102,241,0.4);
}

.cc-prev-btn:disabled, .cc-next-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── RESPONSIVE DOTS ── */
.cc-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.cc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}
html[data-theme="dark"] .cc-dot { background: rgba(255,255,255,0.2); }

.cc-dot.active {
  background: linear-gradient(135deg, var(--primary, #6366f1) 0%, var(--secondary, #8b5cf6) 100%);
  width: 24px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}

/* ── ANIMATION FOR ENTRY ── */
@keyframes ccFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cc-animated { animation: ccFadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ── CATEGORIES LISTING PAGE GRID ── */
.categories-grid-page { padding: 60px 0 100px; }
.categories-page-header { text-align: center; margin-bottom: 3rem; }
.categories-page-title { font-size: 3rem; font-weight: 800; margin-bottom: 15px; letter-spacing: -1px; }
.categories-page-subtitle { color: var(--text-muted); font-size: 1.2rem; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 768px) ──────────────────────────────────── */
@media (max-width: 768px) {
  .advanced-cat-section      { padding: 48px 0; }
  .adv-cat-header            { margin-bottom: 2rem; }
  .adv-cat-title             { font-size: 1.6rem; }
  .adv-cat-view-all          { font-size: 0.85rem; padding: 7px 14px; }
  /* Categories listing page */
  .categories-grid-page      { padding: 40px 0 60px; }
  .categories-page-title     { font-size: 2.2rem; letter-spacing: -0.5px; }
  .categories-page-subtitle  { font-size: 1.05rem; }
}

/* ── Mobile (≤ 576px) ──────────────────────────────────── */
@media (max-width: 576px) {
  .advanced-cat-section      { padding: 36px 0; }
  .adv-cat-header            { margin-bottom: 1.5rem; flex-wrap: wrap; gap: 12px; align-items: center; }
  .adv-cat-title             { font-size: 1.35rem; letter-spacing: -0.3px; }
  .adv-cat-view-all          { font-size: 0.8rem; padding: 6px 12px; }
  .adv-cat-img-wrap          { width: 80px; height: 80px; padding: 14px; margin-bottom: 0.875rem; }
  .adv-cat-icon-placeholder  { font-size: 2rem; }
  .adv-cat-name              { font-size: 0.88rem; }
  .adv-cat-card              { padding: 1.2rem 0.75rem; border-radius: 18px; }
  /* Categories listing page */
  .categories-page-title     { font-size: 1.8rem; }
  .categories-page-subtitle  { font-size: 0.95rem; }
}

/* ── Small mobile (≤ 480px) ────────────────────────────── */
@media (max-width: 480px) {
  .advanced-cat-section      { padding: 28px 0; }
  .adv-cat-title             { font-size: 1.2rem; }
  .adv-cat-header::after     { width: 56px; height: 3px; }
  .adv-cat-img-wrap          { width: 68px; height: 68px; padding: 12px; margin-bottom: 0.75rem; }
  .adv-cat-icon-placeholder  { font-size: 1.75rem; }
  .adv-cat-name              { font-size: 0.82rem; font-weight: 700; }
  .adv-cat-card              { padding: 0.875rem 0.5rem; border-radius: 16px; }
  /* Categories listing page */
  .categories-grid-page      { padding: 28px 0 48px; }
  .categories-page-title     { font-size: 1.6rem; }
  .categories-page-subtitle  { font-size: 0.9rem; }
}
