/* Categorías públicas MAGANDHI · paleta única, sin color por categoría. */
.mg-category-strip{max-width:1200px;margin:38px auto 0;padding:0 24px}
.mg-category-strip__head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin:0 0 14px}
.mg-category-strip__eyebrow,.mg-category-section__eyebrow{display:block;color:var(--acento);font-size:10px;font-weight:700;letter-spacing:.18em;text-transform:uppercase}
.mg-category-strip__title{margin:3px 0 0;color:var(--negro);font-size:18px;line-height:1.25}
.mg-category-strip__all{min-height:44px;padding:0 2px;display:inline-flex;align-items:center;color:var(--rojo);font-size:12px;font-weight:600;text-decoration:none;text-underline-offset:4px}
.mg-category-strip__all:hover{text-decoration:underline}
.mg-category-strip__viewport{position:relative}
.mg-category-strip__track{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px}
.mg-category-card{position:relative;min-width:0;min-height:112px;padding:14px 10px;overflow:hidden;border:1px solid var(--ml-borde);border-radius:16px;background:linear-gradient(155deg,#fff 0%,#fff 66%,var(--hueso) 100%);color:var(--tinta);box-shadow:var(--ml-sombra);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;text-decoration:none;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,color .18s ease}
.mg-category-card::before{content:"";position:absolute;top:0;left:22%;right:22%;height:2px;border-radius:0 0 4px 4px;background:var(--acento);opacity:.72}
.mg-category-card:hover{transform:translateY(-3px);border-color:rgba(166,51,46,.34);box-shadow:var(--ml-sombra-hover);color:var(--rojo)}
.mg-category-card:focus-visible,.mg-category-strip__all:focus-visible{outline:3px solid rgba(194,138,58,.52);outline-offset:3px}
.mg-category-card[aria-current="true"],.mg-category-card[aria-current="page"]{border-color:var(--rojo);background:var(--red-50);color:var(--rojo);box-shadow:0 0 0 1px rgba(166,51,46,.12)}
.mg-category-card__icon{width:44px;height:44px;border:1px solid rgba(166,51,46,.08);border-radius:14px;background:var(--red-50);color:var(--rojo);display:flex;align-items:center;justify-content:center;flex:none}
.mg-category-card__icon svg{display:block;width:24px;height:24px}
.mg-category-card__name{max-width:16ch;font-size:12px;font-weight:600;line-height:1.25}
.mg-category-card--more .mg-category-card__icon{border-color:rgba(194,138,58,.16);background:var(--acento-sombra);color:var(--acento)}
/* Espera de la portada: ocupa el mismo espacio que una tarjeta real. */
.mg-category-card--espera{pointer-events:none;border-color:rgba(17,17,17,.05);background:rgba(255,255,255,.62);box-shadow:none;animation:mg-category-espera 1.1s ease-in-out infinite alternate}
.mg-category-card--espera::before{display:none}
/* En PC el carril de la portada usa la misma proporción vertical que en móvil. */
.mg-category-strip .mg-category-card{aspect-ratio:5/6;min-height:0}

/* Tarjeta con fotografía a sangre (portada y página de categorías): la imagen
   llega a los cuatro bordes y el nombre, en HTML, se apoya sobre un velo
   inferior (contraste ≥ 4.5:1). Sin foto, la tarjeta conserva su ícono. */
.mg-category-card__foto{display:none}
.mg-category-card--foto{padding:0 12px 14px;justify-content:flex-end;isolation:isolate;border-color:rgba(17,17,17,.12);background:linear-gradient(180deg,var(--rojo) 0%,var(--rojo-prof) 100%);color:#fff}
.mg-category-card--foto::before{z-index:3}
.mg-category-card--foto::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,rgba(17,17,17,0) 36%,rgba(17,17,17,.3) 58%,rgba(17,17,17,.76) 100%)}
.mg-category-card--foto .mg-category-card__icon,.mg-category-card--foto .mg-category-card__copy{display:none}
.mg-category-card--foto .mg-category-card__foto{position:absolute;inset:0;z-index:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center;opacity:0;transition:opacity .25s ease,transform .35s ease}
.mg-category-card--foto .mg-category-card__foto[data-cargada]{opacity:1}
.mg-category-card--foto .mg-category-card__name{position:relative;z-index:2;width:100%;max-width:none;font-size:13px;line-height:1.2;letter-spacing:.01em;text-shadow:0 1px 2px rgba(17,17,17,.5);overflow-wrap:break-word;hyphens:auto;display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.mg-category-card--foto:hover{color:#fff;border-color:rgba(17,17,17,.2)}
.mg-category-card--foto[aria-current="true"],.mg-category-card--foto[aria-current="page"]{border-color:var(--negro);background:linear-gradient(180deg,var(--rojo) 0%,var(--rojo-prof) 100%);color:#fff;box-shadow:0 0 0 2px var(--fondo-pagina),0 0 0 4px var(--negro)}

/* Rejilla de la página /categorias/: la misma tarjeta fotográfica de la portada. */
.mg-category-grid[hidden],.mg-category-section__state[hidden]{display:none}
.mg-category-section{max-width:1200px;margin:44px auto 0;padding:0 24px}
.mg-category-section__head{max-width:720px;margin-bottom:20px}
.mg-category-section__title{margin:5px 0 0;color:var(--negro);font-size:clamp(23px,3vw,34px);line-height:1.15;letter-spacing:-.5px}
.mg-category-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
.mg-category-grid .mg-category-card{aspect-ratio:5/6;min-height:0;padding:18px 12px}
.mg-category-grid .mg-category-card--foto{padding:0 12px 14px}
.mg-category-grid .mg-category-card__icon{width:52px;height:52px;border-radius:16px}
.mg-category-grid .mg-category-card__icon svg{width:28px;height:28px}
.mg-category-grid .mg-category-card__name{font-size:13.5px}
.mg-category-grid .mg-category-card--foto .mg-category-card__name{font-size:14px}
.mg-category-card__copy{margin:-2px 0 0;max-width:26ch;color:var(--gris);font-size:10.5px;line-height:1.45}
.mg-category-card:hover .mg-category-card__copy,.mg-category-card[aria-current="page"] .mg-category-card__copy{color:inherit}
.mg-category-section__state{min-height:154px;padding:24px;border:1px solid var(--ml-borde);border-radius:16px;background:#fff;color:var(--gris);box-shadow:var(--ml-sombra);display:flex;align-items:center;justify-content:center;gap:14px;text-align:left}
.mg-category-section__state>svg{width:30px;height:30px;flex:none;color:var(--acento)}
.mg-category-section__state strong{display:block;color:var(--negro);font-size:14px}
.mg-category-section__state span{display:block;margin-top:3px;font-size:12px}
.mg-category-section__state button{min-height:44px;margin-top:12px;padding:9px 15px;border:1px solid rgba(166,51,46,.24);border-radius:10px;background:#fff;color:var(--rojo);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
@keyframes mg-category-espera{to{opacity:.5}}

@media(min-width:1025px) and (max-width:1280px){
  .mg-category-strip,.mg-category-section{padding-inline:24px}
}
@media(min-width:761px) and (max-width:1024px){
  .mg-category-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .mg-category-strip .mg-category-card--foto{padding:0 6px 10px}
  .mg-category-strip .mg-category-card--foto .mg-category-card__name{font-size:12px}
}
@media(max-width:760px){
  .mg-category-strip{margin-top:27px;padding:0 0 0 12px;overflow:hidden}
  .mg-category-strip__head{padding-right:12px;margin-bottom:11px}
  .mg-category-strip__title{font-size:16px}
  .mg-category-strip__viewport::after{content:"";position:absolute;z-index:2;top:0;right:0;width:34px;height:100%;pointer-events:none;background:linear-gradient(90deg,rgba(239,231,221,0),var(--fondo-pagina))}
  /* Ancho fluido: tres tarjetas completas y un tercio de la cuarta asomando
     (≈104px a 390px de pantalla), para que el carril invite a deslizar. */
  .mg-category-strip{--mg-cat-ancho:clamp(88px,calc((100vw - 42px) / 3.35),128px)}
  .mg-category-strip__track{display:flex;gap:10px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x mandatory;scroll-padding-inline:12px;padding:2px 38px 12px 0;scrollbar-width:none}
  .mg-category-strip__track::-webkit-scrollbar{display:none}
  .mg-category-strip .mg-category-card{flex:0 0 var(--mg-cat-ancho);width:var(--mg-cat-ancho);height:calc(var(--mg-cat-ancho) * 1.2);aspect-ratio:auto;min-height:0;padding:11px 8px;border-radius:16px;scroll-snap-align:start}
  .mg-category-strip .mg-category-card--foto{padding:0 8px 10px}
  .mg-category-strip .mg-category-card--foto .mg-category-card__name{font-size:12px}
  .mg-category-card__icon{width:40px;height:40px;border-radius:12px}
  .mg-category-card__name{font-size:11px}
  .mg-category-section{padding:0 12px;margin-top:34px}
  .mg-category-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .mg-category-grid .mg-category-card{padding:12px 8px}
  .mg-category-grid .mg-category-card--foto{padding:0 8px 11px}
  .mg-category-grid .mg-category-card__icon{width:44px;height:44px}
  .mg-category-grid .mg-category-card__name{font-size:12px}
  .mg-category-grid .mg-category-card--foto .mg-category-card__name{font-size:12.5px}
  .mg-category-grid .mg-category-card__copy{display:none}
  .mg-category-section__state{align-items:flex-start;min-height:142px;padding:20px;text-align:left}
}
@media(max-width:390px){
  .mg-category-strip__all{font-size:11px}
}
@media(hover:hover){
  .mg-category-card--foto:hover .mg-category-card__foto{transform:scale(1.04)}
}
@media(prefers-reduced-motion:reduce){
  .mg-category-card{transition:none;animation:none}
  .mg-category-card:hover{transform:none}
  .mg-category-card--foto .mg-category-card__foto{transition:none}
  .mg-category-card--foto:hover .mg-category-card__foto{transform:none}
}
