/* =============================================================
   420CreaStore Categorías v4.0 — CSS
   IMPORTANTE: Los anchos de slides los controla SOLO el JS en px.
   El CSS no define width ni flex-basis en .crea-cat__slide.
   ============================================================= */

:root {
  --crea-cat-accent:    #4A90D9;
  --crea-cat-text:      #1a2332;
  --crea-cat-muted:     #6b7a8d;
  --crea-cat-ease:      cubic-bezier(0.34, 1.20, 0.64, 1);
  --crea-cat-shadow-sm: 0 2px 12px rgba(74,144,217,.08);
  --crea-cat-shadow-md: 0 8px 32px rgba(74,144,217,.15);
}

/* ── Contenedor ──────────────────────────────────────────── */
.crea-cat__wrap {
  width: 100%;
  box-sizing: border-box;
  font-family: 'DM Sans','Nunito',system-ui,sans-serif;
}

/* ── Cabecera ────────────────────────────────────────────── */
.crea-cat__header { margin-bottom: 36px; }

.crea-cat__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--crea-cat-text);
  margin: 0 0 8px;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.crea-cat__subtitle {
  font-size: 1rem;
  color: var(--crea-cat-muted);
  margin: 0;
  font-weight: 400;
}
.crea-cat__description {
  font-size: .9375rem;
  color: #8a97a8;
  margin: 6px 0 0;
}

/* ── GRID ────────────────────────────────────────────────── */
.crea-cat__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ── ITEM (shared grid + slider) ─────────────────────────── */
.crea-cat__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: #fff;
  border-radius: 16px;
  padding: 28px 16px 24px;
  box-shadow: var(--crea-cat-shadow-sm);
  transition: transform .28s var(--crea-cat-ease), box-shadow .28s ease, background .2s ease;
  cursor: pointer;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.crea-cat__item:hover {
  transform: translateY(-4px);
  box-shadow: var(--crea-cat-shadow-md);
  background: #f8fbff;
  text-decoration: none;
  color: inherit;
}

/* ── Círculo ─────────────────────────────────────────────── */
.crea-cat__circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
  transition: transform .3s var(--crea-cat-ease), box-shadow .3s ease;
}
.crea-cat__item:hover .crea-cat__circle {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

/* ── Icono ───────────────────────────────────────────────── */
.crea-cat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}
.crea-cat__icon svg,
.crea-cat__icon img {
  width: 42px;
  height: 42px;
  display: block;
  transition: transform .28s var(--crea-cat-ease);
  overflow: visible;
}
.crea-cat__item:hover .crea-cat__icon svg,
.crea-cat__item:hover .crea-cat__icon img {
  transform: scale(1.12);
}

/* ── Nombre ──────────────────────────────────────────────── */
.crea-cat__name {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--crea-cat-text);
  margin-top: 12px;
  line-height: 1.3;
  transition: color .2s ease;
}
.crea-cat__item:hover .crea-cat__name { color: var(--crea-cat-accent); }

/* ── Subcategorías ───────────────────────────────────────── */
.crea-cat__sublist {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0 0;
  width: 100%;
  border-top: 1px solid rgba(0,0,0,.06);
  transition: opacity .22s ease, max-height .3s ease;
}
.crea-cat__sublist li { margin-bottom: 4px; line-height: 1.4; }
.crea-cat__sublist li:last-child { margin-bottom: 0; }
.crea-cat__sublist li a,
.crea-cat__sublist li span {
  font-size: .8125rem;
  color: var(--crea-cat-muted);
  text-decoration: none;
  display: inline-block;
  transition: color .2s ease;
}
.crea-cat__sublist li a:hover { color: var(--crea-cat-accent); }
.crea-cat__sublist--hover { opacity:0; max-height:0; overflow:hidden; pointer-events:none; }
.crea-cat__item:hover .crea-cat__sublist--hover { opacity:1; max-height:300px; pointer-events:auto; }
.crea-cat__sublist--hidden { display:none; }

/* ── CTA ─────────────────────────────────────────────────── */
.crea-cat__cta-wrap { margin-top: 36px; text-align: center; }
.crea-cat__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: var(--crea-cat-accent);
  color: #fff;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 100px;
  box-shadow: 0 4px 20px rgba(74,144,217,.25);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.crea-cat__cta:hover {
  background: #2a70c0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(74,144,217,.35);
  color: #fff;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   SLIDER
   ═══════════════════════════════════════════════════════════ */

/* Wrapper: solo espacio para las flechas */
.crea-cat__slider-wrapper {
  position: relative;
  padding: 0 56px;
  box-sizing: border-box;
}

/* Track: scroll container */
.crea-cat__track {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: var(--crea-gap, 24px);
  padding-bottom: 48px;
}
.crea-cat__track::-webkit-scrollbar { display: none; }

/*
 * CRÍTICO: .crea-cat__slide NO tiene width ni flex-basis.
 * El JS los asigna vía style.cssText en píxeles exactos.
 * Cualquier valor CSS aquí anularía el cálculo responsive del JS.
 */
.crea-cat__slide {
  flex-shrink: 0;
  min-width: 0;
  scroll-snap-align: start;
  box-sizing: border-box;
}

/* Item dentro del slide */
.crea-cat__slide > .crea-cat__item {
  width: 100%;
  height: 100%;
}

/* ── Dots ────────────────────────────────────────────────── */
.crea-cat__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  margin-top: -40px;
  padding-bottom: 8px;
}
.crea-cat__dot {
  width: 7px;
  height: 7px;
  border-radius: 100px;
  background: #c8d4e0;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .2s, width .25s;
}
.crea-cat__dot--active,
.crea-cat__dot:hover {
  background: var(--crea-cat-accent);
  width: 20px;
}

/* ── Flechas ─────────────────────────────────────────────── */
.crea-cat__arrow {
  position: absolute;
  top: calc(50% - 24px);
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(74,144,217,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: box-shadow .2s, border-color .2s, background .2s, opacity .2s;
  padding: 0;
}
.crea-cat__arrow:hover {
  box-shadow: 0 6px 20px rgba(74,144,217,.2);
  border-color: var(--crea-cat-accent);
  background: #f4f8ff;
}
.crea-cat__arrow svg { width:20px; height:20px; stroke:var(--crea-cat-accent); display:block; }
.crea-cat__arrow--prev { left: 0; }
.crea-cat__arrow--next { right: 0; }
.crea-cat__arrow--disabled { opacity:.3; pointer-events:none; }

/* ── Responsive GRID ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .crea-cat__grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .crea-cat__circle { width: 76px; height: 76px; }
  .crea-cat__icon, .crea-cat__icon svg, .crea-cat__icon img { width: 34px; height: 34px; }
}

@media (max-width: 767px) {
  .crea-cat__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .crea-cat__header { margin-bottom: 24px; }
  .crea-cat__title { font-size: 1.375rem; }
  .crea-cat__circle { width: 68px; height: 68px; margin-bottom: 12px; }
  .crea-cat__icon, .crea-cat__icon svg, .crea-cat__icon img { width: 30px; height: 30px; }
  .crea-cat__name { font-size: .8125rem; margin-top: 8px; }
  .crea-cat__item { padding: 20px 10px 18px; }
  .crea-cat__sublist { display: none; }
  .crea-cat__slider-wrapper { padding: 0 40px; }
  .crea-cat__arrow { width: 36px; height: 36px; }
  .crea-cat__arrow svg { width: 16px; height: 16px; }
}
