/* =====================================================================
   SANCIONES · normativa  (CSS propio de este módulo)
   Estructura:  [ banner + buscador ] ~transición~ [ sección clara: categorías · reglas · cierre ]
   Solo usa de la web global: la barra de navegación, el pie y el fondo
   de banner del <body> (styles.css). Todo lo demás está definido aquí
   y cuelga de body.sx-page, así que no afecta a otras páginas.
   ===================================================================== */

.sx-page {
  --sx-blue: #5ca8ff;
  --sx-ink: #0f1424;          /* texto sobre fondo claro */
  --sx-muted: #5a6582;
  --sx-paper: #ffffff;        /* fondo de la sección clara (debe ser igual al de la transición) */
  --sx-card: #f3f7ff;
  --sx-line: #e2e9f7;
  --sx-radius: 28px;
  --sx-gap: 18px;
}

/* Colores por categoría (los comparten los botones de categoría y las reglas).
   --tone: acento · --tint: fondo de etiqueta · --tag: texto de etiqueta (legible sobre blanco)
   --from/--to: degradado · --edge: borde · --glow: sombra */
.sx-c-pvp  { --tone: #ff5d5d; --tint: #ffe4e1; --tag: #a3221b; --from: #fff8f7; --to: #ffe3df; --edge: #f6c9c4; --glow: 214, 60, 60; }
.sx-c-chat { --tone: #ff7eb6; --tint: #ffe4f1; --tag: #a3205f; --from: #fff7fb; --to: #ffe3f0; --edge: #f8c8de; --glow: 222, 70, 140; }
.sx-c-eco  { --tone: #36cfe6; --tint: #d8f6fb; --tag: #0b6577; --from: #f3fcff; --to: #d9f5fb; --edge: #b8e8f2; --glow: 18, 160, 190; }

/* sin esto, el display de algunos contenedores ignora el atributo hidden */
.sx-page [hidden] { display: none !important; }
.sx-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ===== 1. BANNER (el fondo es el banner global del <body>) ===== */
.sx-banner {
  position: relative;
  padding: 140px 20px clamp(120px, 15vw, 180px);
  text-align: center;
  color: #fff;
  animation: rise .7s ease both;
}
.sx-banner h1 {
  font-family: 'Oxanium', sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 8.5vw, 64px);
  line-height: 1.08;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .5);
}
.sx-banner h1 span { color: var(--sx-blue); }
.sx-banner p.sx-sub {
  max-width: 660px;
  margin: 14px auto 0;
  font-size: clamp(15px, 3.6vw, 18px);
  color: #d5daf0;
}

/* buscador */
.sx-search {
  position: relative;
  max-width: 560px;
  margin: 26px auto 0;
}
.sx-search input {
  width: 100%;
  height: 54px;
  padding: 0 52px;
  font: inherit;
  font-size: 16px;                       /* 16px: evita el zoom automático en iOS */
  color: #fff;
  background: rgba(16, 18, 30, .72);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  -webkit-appearance: none; appearance: none;
  transition: border-color .25s, box-shadow .25s;
}
.sx-search input::placeholder { color: #aab1cf; }
.sx-search input::-webkit-search-cancel-button { display: none; }
.sx-search input:hover { border-color: rgba(92, 168, 255, .55); }
.sx-search input:focus-visible { outline: 2px solid var(--sx-blue); outline-offset: 2px; border-color: var(--sx-blue); }
.sx-search-ico {
  position: absolute; left: 18px; top: 50%;
  width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: var(--sx-blue); stroke-width: 2.2; stroke-linecap: round;
  pointer-events: none;
}
.sx-clear {
  position: absolute; right: 8px; top: 50%;
  display: grid; place-items: center;
  width: 38px; height: 38px; transform: translateY(-50%);
  color: #c9cde4; background: rgba(255, 255, 255, .08);
  border-radius: 12px; cursor: pointer; transition: background .2s, color .2s;
}
.sx-clear:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.sx-clear:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sx-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* ===== OLA divisoria (igual que Inicio y Sugerencias): dos capas · quieta en PC, con movimiento en móvil ===== */
.sx-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;          /* -1px: sin línea entre la ola y la sección clara */
  height: clamp(70px, 10vw, 120px);
  overflow: hidden;
  pointer-events: none;
}
.sx-wave svg {
  position: absolute;
  bottom: 0; left: 0;
  display: block;
  width: 200%; height: 100%;                /* el dibujo se repite 2 veces: -50% encaja sin saltos */
}
.sx-wave .back  { fill: rgba(255, 255, 255, .45); }
.sx-wave .front { fill: var(--sx-paper); }
@media (max-width: 759px) {                /* movimiento SOLO en móvil */
  .sx-wave svg { animation: sxDrift 16s linear infinite; }
  .sx-wave .back { animation-duration: 26s; animation-direction: reverse; }
}
@keyframes sxDrift { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sx-wave svg { animation: none; } }

/* ===== 3. SECCIÓN CLARA ===== */
.sx-light {
  background: var(--sx-paper);
  color: var(--sx-ink);
  padding: 20px 14px 50px;
}
.sx-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
}

/* --- 3a. Categorías (también son los filtros) --- */
.sx-cats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.sx-cat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 112px;
  padding: 16px 90px 16px 18px;
  font: inherit;
  text-align: left;
  color: var(--sx-ink);
  background: linear-gradient(135deg, var(--from), var(--to));
  border: 1px solid var(--edge);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(var(--glow), .12);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.sx-cat::before {                       /* resplandor suave detrás del mob */
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(var(--glow), .24), transparent 68%);
  pointer-events: none;
}
.sx-cat:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(var(--glow), .22); }
.sx-cat:focus-visible { outline: 3px solid var(--sx-ink); outline-offset: 3px; }
.sx-cat[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tone), 0 18px 40px rgba(var(--glow), .22); }
.sx-cat-name { position: relative; z-index: 1; font-size: clamp(17px, 4.2vw, 20px); font-weight: 800; line-height: 1.15; letter-spacing: -.3px; }
.sx-cat-name::before {                  /* pequeño detalle de color, como en Sugerencias */
  content: "";
  display: block;
  width: 30px; height: 5px;
  margin-bottom: 10px;
  border-radius: 99px;
  background: var(--tone);
}
.sx-cat-count { position: relative; z-index: 1; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--sx-muted); }
.sx-mob {
  position: absolute; right: 14px; top: 50%; z-index: 1;
  width: 72px; height: 72px;
  object-fit: contain;
  transform: translateY(-50%);
  filter: drop-shadow(0 8px 8px rgba(var(--glow), .28));
  transition: transform .3s ease;
}
.sx-cat:hover .sx-mob,
.sx-cat[aria-pressed="true"] .sx-mob { transform: translateY(-50%) scale(1.08) rotate(-3deg); }

/* --- 3b. Estado del filtro --- */
.sx-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 4px; }
.sx-status { font-size: 14px; font-weight: 600; color: var(--sx-muted); }
.sx-reset {
  padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--sx-ink); background: var(--sx-card);
  border: 1px solid var(--sx-line); border-radius: 99px;
  cursor: pointer; transition: border-color .2s;
}
.sx-reset:hover { border-color: var(--sx-blue); }
.sx-reset:focus-visible { outline: 2px solid var(--sx-blue); outline-offset: 2px; }

/* --- 3c. Reglas ---
   Flex con wrap y centrado: si en la última fila sobran tarjetas (17 reglas, o un filtro
   con 5), quedan centradas en vez de pegadas a un lado. Todas las de una fila miden lo mismo. */
.sx-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sx-gap);
}
.sx-rule {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  min-height: 250px;
  padding: 26px 24px;
  background: #fff;
  border: 1px solid var(--sx-line);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(36, 60, 120, .07);
  transition: transform .3s ease, border-color .3s, box-shadow .3s;
  animation: sxIn .35s ease both;
}
.sx-rule::before {                      /* tinte suave de la categoría */
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, var(--from), #fff 55%);
}
.sx-rule:hover { transform: translateY(-4px); border-color: var(--tone); box-shadow: 0 16px 36px rgba(var(--glow), .18); }
@keyframes sxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sx-rule-head { display: flex; flex-direction: column; gap: 8px; }
.sx-tag {
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--tag); background: var(--tint);
  border-radius: 99px;
}
.sx-rule h3 { font-size: clamp(19px, 4.6vw, 22px); font-weight: 800; line-height: 1.25; letter-spacing: -.3px; color: var(--sx-ink); }
.sx-rule p { max-width: 46ch; font-size: 14.5px; line-height: 1.55; color: var(--sx-muted); }

/* ===== ESCALA PROGRESIVA (lista limpia con línea punteada) ===== */
.sx-ladder {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  border-top: 1px solid var(--sx-line);
}
.sx-ladder li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; }
/* Reincidencia a la izquierda + línea punteada que llega hasta la sanción */
.sx-ladder span {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--sx-muted);
}
.sx-ladder span::after { content: ""; flex: 1; border-bottom: 1px dotted #c3d0ea; transform: translateY(-3px); }
/* Sanción a la derecha: lo único en negrita */
.sx-ladder b { flex: none; text-align: right; font-size: 15px; font-weight: 800; color: var(--sx-ink); }
.sx-ladder b.warn,
.sx-ladder b.perm { padding: 2px 10px; font-size: 13.5px; font-weight: 700; border-radius: 99px; }
.sx-ladder b.warn { color: #7a5200; background: #fff3c4; }
.sx-ladder b.perm { color: #a3221b; background: #ffe4e1; }
.sx-ladder b.na { font-weight: 500; color: #6b7694; }

/* sin resultados */
.sx-empty {
  padding: 34px 22px;
  text-align: center;
  background: var(--sx-card);
  border: 1px dashed #c5d4f0;
  border-radius: 22px;
}
.sx-empty h3 { font-size: 19px; font-weight: 800; }
.sx-empty p { margin-top: 6px; font-size: 15px; color: var(--sx-muted); }
.sx-empty a { font-weight: 700; color: #1f4fb8; text-decoration: underline; text-underline-offset: 3px; }

/* nota inferior */
.sx-note {
  max-width: 720px;
  margin: 4px auto 0;
  padding: 14px 20px;
  text-align: center;
  font-size: 14.5px; line-height: 1.55; color: var(--sx-muted);
  background: var(--sx-card);
  border: 1px solid var(--sx-line);
  border-radius: 18px;
}
.sx-note strong { color: var(--sx-ink); }

/* ===== 4. BLOQUE FINAL (mismo diseño que el del FAQ y el bloque azul de Sugerencias) ===== */
.sx-cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 28%, 170px);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 30px 14px 30px 24px;
  background: linear-gradient(135deg, #f7faff, #dfecff);
  border: 1px solid #cfe0fb;
  border-radius: var(--sx-radius);
  box-shadow: 0 10px 30px rgba(47, 102, 214, .12);
}
.sx-cta::before {
  content: "";
  position: absolute; right: -50px; top: 50%;
  width: 300px; height: 300px; transform: translateY(-50%);
  background: radial-gradient(circle, rgba(92, 168, 255, .3), transparent 68%);
  pointer-events: none;
}
.sx-cta-copy { position: relative; z-index: 1; min-width: 0; }
.sx-cta h2 { font-size: clamp(22px, 5.2vw, 30px); font-weight: 800; line-height: 1.15; letter-spacing: -.4px; }
.sx-cta p { max-width: 56ch; margin-top: 8px; font-size: 15.5px; color: var(--sx-muted); }
.sx-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.sx-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 15px; font-weight: 800; white-space: nowrap;
  color: #06101f; background: var(--sx-blue);
  border: 1px solid var(--sx-blue); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(92, 168, 255, .45);
  transition: transform .25s, filter .25s, border-color .25s;
}
.sx-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.sx-btn.ghost { background: #fff; border-color: #cfe0fb; box-shadow: none; }
.sx-btn.ghost:hover { border-color: var(--sx-blue); filter: none; }
.sx-btn:focus-visible { outline: 3px solid var(--sx-ink); outline-offset: 3px; }
.sx-cta-mob {
  position: relative; z-index: 1;
  width: 100%; height: auto;
  filter: drop-shadow(0 12px 12px rgba(30, 70, 160, .25));
  animation: sxFloat 5s ease-in-out infinite;
}
@keyframes sxFloat { 50% { transform: translateY(-6px); } }

/* ===== 4b. PIE: fondo blanco continuo y, por encima, la caja oscura del footer ===== */
.sx-foot {
  display: flow-root;
  padding: 10px 14px 34px;
  background: var(--sx-paper);             /* mismo blanco que la sección clara: se ve continuo */
}
.sx-foot footer {
  margin: 0 auto;                          /* el espacio lo da .sx-foot */
  background: #10121e;                     /* sólido: sobre blanco el translúcido original se vería gris */
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 18px 44px rgba(16, 24, 56, .28);
}

/* ===== 5. TABLET ===== */
@media (min-width: 760px) {
  .sx-light { padding: 30px 20px 60px; }
  .sx-inner { gap: 26px; }
  .sx-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .sx-cat { min-height: 150px; padding: 20px; }
  .sx-mob { right: 14px; top: 14px; width: 80px; height: 80px; transform: none; }
  .sx-cat:hover .sx-mob,
  .sx-cat[aria-pressed="true"] .sx-mob { transform: scale(1.08) rotate(-3deg); }
  .sx-rules { --sx-gap: 20px; }
  .sx-rule { flex-basis: calc((100% - var(--sx-gap)) / 2); padding: 30px 28px; min-height: 260px; }
  .sx-cta { padding: 38px 24px 38px 40px; }
}

/* ===== 6. ESCRITORIO ===== */
@media (min-width: 1040px) {
  .sx-cat { min-height: 180px; }
  .sx-mob { width: 104px; height: 104px; }
  .sx-rule { flex-basis: calc((100% - 2 * var(--sx-gap)) / 3); }
}

/* ===== 6b. EQUILIBRIO VISUAL DE LAS ILUSTRACIONES (referencia: el panda, que no se toca) =====
   Los WebP tienen márgenes transparentes distintos (el dibujo opaco ocupa del lienzo: panda ~93 % de ancho,
   devastador ~69 %, breeze ~40 %, sniffer ~45 %), así que con la misma caja se veían desiguales.
   Cada imagen se agranda con su propio --sx-fit, escrito DENTRO de transform (orden: translateY, luego scale)
   para que el centrado vertical de móvil no se multiplique. transform-origin = centro del dibujo opaco,
   así crecen sin cambiar de sitio. La sombra se divide entre la escala: se ve igual que la del panda.
   Se selecciona por nombre de archivo: funciona en la tarjeta donde esté cada imagen. */
.sx-mob[src*="sanciones-devastador"] { --sx-fit: 1.3;  transform-origin: 47.6% 49.5%; }
.sx-mob[src*="sanciones-breeze"]     { --sx-fit: 1.75; transform-origin: 51% 51.3%; }
.sx-mob[src*="sanciones-sniffer"]    { --sx-fit: 2.15; transform-origin: 51.1% 54.3%; }

.sx-mob[src*="sanciones-devastador"],
.sx-mob[src*="sanciones-breeze"],
.sx-mob[src*="sanciones-sniffer"] {
  transform: translateY(-50%) scale(var(--sx-fit));            /* móvil: centrado vertical + escala */
  filter: drop-shadow(0 calc(8px / var(--sx-fit)) calc(8px / var(--sx-fit)) rgba(var(--glow), .28));
}
.sx-cat:hover .sx-mob[src*="sanciones-devastador"],
.sx-cat:hover .sx-mob[src*="sanciones-breeze"],
.sx-cat:hover .sx-mob[src*="sanciones-sniffer"],
.sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-devastador"],
.sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-breeze"],
.sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-sniffer"] {
  transform: translateY(-50%) scale(calc(var(--sx-fit) * 1.08)) rotate(-3deg);
}
@media (min-width: 760px) {                                    /* tablet y escritorio: imagen anclada arriba, sin translateY */
  .sx-mob[src*="sanciones-devastador"],
  .sx-mob[src*="sanciones-breeze"],
  .sx-mob[src*="sanciones-sniffer"] { transform: scale(var(--sx-fit)); }
  .sx-cat:hover .sx-mob[src*="sanciones-devastador"],
  .sx-cat:hover .sx-mob[src*="sanciones-breeze"],
  .sx-cat:hover .sx-mob[src*="sanciones-sniffer"],
  .sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-devastador"],
  .sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-breeze"],
  .sx-cat[aria-pressed="true"] .sx-mob[src*="sanciones-sniffer"] { transform: scale(calc(var(--sx-fit) * 1.08)) rotate(-3deg); }
}

/* ===== 7. MÓVIL PEQUEÑO Y MOVIMIENTO REDUCIDO ===== */
@media (max-width: 420px) {
  .sx-cta { grid-template-columns: minmax(0, 1fr) 84px; padding: 24px 8px 24px 20px; }
  .sx-actions { gap: 10px; }
  .sx-btn { padding: 11px 18px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-banner, .sx-rule, .sx-cta-mob { animation: none; }
  .sx-rule, .sx-cat, .sx-mob, .sx-btn { transition: none; }
}