/* ==========================================================================
   LA CAPITAL RP — Hoja de estilos v22
   Identidad: plata cincelada, oro, contorno negro y cinta verde / roja.
   ========================================================================== */

:root {
  /* Metales y fondos */
  --hierro: #181b20;
  --hierro-2: #1e2228;
  --acero: #2a2f37;
  --acero-claro: #3b424c;
  --negro: #000;

  /* Texto */
  --plata: #e6e8ec;
  --texto: #c8ccd2;
  --texto-suave: #9aa1ab;

  /* Oro */
  --oro: #d4a63c;
  --oro-claro: #f2d27a;
  --oro-oscuro: #8a6416;

  /* Bandera (solo como acento de cinta) */
  --verde: #12a05a;
  --rojo: #d92b37;

  /* Superficies */
  --placa: linear-gradient(165deg, #2d3239 0%, #23272e 55%, #1d2026 100%);
  --placa-borde: 0 0 0 1px var(--negro), inset 0 0 0 1px rgba(212, 166, 60, 0.38),
    inset 0 1px 0 1px rgba(255, 255, 255, 0.05);
  --sombra: 0 22px 44px -26px rgba(0, 0, 0, 0.9);
  --oro-metal: linear-gradient(180deg, #fbe39a 0%, #e2b955 38%, #b98a2c 72%, #8f6519 100%);
  --plata-metal: linear-gradient(180deg, #ffffff 0%, #dfe2e7 45%, #a9afb8 100%);
  --cinta: linear-gradient(90deg, var(--verde) 0 44%, var(--oro) 44% 56%, var(--rojo) 56% 100%);

  /* Tipografía */
  --f-display: "Grenze Gotisch", "Old English Text MT", Georgia, "Times New Roman", serif;
  --f-body: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-ui: "Barlow Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;

  --header-h: 72px;
  --contenedor: 1180px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--hierro);
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px);
  color: var(--texto);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.menu-open,
body.cart-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--oro);
  color: #1a1306;
}

:focus-visible {
  outline: 2px solid var(--oro-claro);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--plata);
  line-height: 1.08;
}

h1,
h2 {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: 0.005em;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
}

h3 {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.container {
  width: min(var(--contenedor), 100% - 40px);
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--oro);
}

/* Placa metálica: contorno negro + filo dorado, como el logo */
.plate {
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
}

/* Cinta verde · oro · rojo en forma de rombo alargado */
.section-heading::after,
.page-hero-text h1::after,
.rules-teaser-content h2::after {
  content: "";
  display: block;
  width: 220px;
  max-width: 70%;
  height: 7px;
  margin-top: 18px;
  background: var(--cinta);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}

/* ---------- Botones ---------- */

.button {
  --punta: 14px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0.7rem 1.9rem;
  border: 0;
  background: none;
  color: #1c1405;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: filter 0.18s ease, color 0.18s ease;
}

.button::before,
.button::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: polygon(var(--punta) 0, calc(100% - var(--punta)) 0, 100% 50%,
      calc(100% - var(--punta)) 100%, var(--punta) 100%, 0 50%);
}

.button::before {
  inset: 0;
  background: var(--negro);
}

.button::after {
  inset: 2px;
  background: var(--oro-metal);
}

.button:hover {
  filter: brightness(1.1);
}

.button:active {
  filter: brightness(0.95);
}

.button-outline {
  color: var(--plata);
}

.button-outline::before {
  background: linear-gradient(180deg, var(--oro-claro), var(--oro-oscuro));
}

.button-outline::after {
  background: linear-gradient(180deg, #2f343c, #1d2026);
}

.button-outline:hover {
  color: var(--oro-claro);
  filter: none;
}

.button-small,
.button-compact {
  --punta: 11px;
  min-height: 40px;
  padding: 0.45rem 1.4rem;
  font-size: 1rem;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(0.85) brightness(0.7);
}

/* ---------- Encabezado ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: rgba(24, 27, 32, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(22, 25, 30, 0.94);
  box-shadow: 0 1px 0 var(--negro), 0 2px 0 rgba(212, 166, 60, 0.35);
}

.nav-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img {
  width: auto;
  height: 42px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.brand span {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  background: var(--plata-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--texto);
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-link:hover {
  color: var(--oro-claro);
}

.nav-link.is-current {
  color: var(--oro-claro);
}

.nav-link.is-current::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  height: 8px;
  background: var(--oro);
  transform: translateX(-50%) rotate(45deg);
}

.main-nav .button-small {
  margin-left: 10px;
}

.menu-button {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--negro);
  border-radius: 3px;
  background: var(--acero);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.35);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--plata);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Portada (inicio) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 40px) 0 72px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 42% at 50% 34%, rgba(212, 166, 60, 0.2), transparent 70%),
    radial-gradient(ellipse 38% 28% at 18% 62%, rgba(18, 160, 90, 0.08), transparent 70%),
    radial-gradient(ellipse 38% 28% at 82% 62%, rgba(217, 43, 55, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 30%, transparent 75%, var(--hierro));
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.hero-wordmark-wrap {
  position: relative;
  display: block;
  width: min(100%, 940px);
  animation: corona-entrada 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-wordmark {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.65));
}

/* Destello metálico que recorre el logotipo una sola vez */
.hero-wordmark-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 248, 220, 0.75) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: 120% 0;
  -webkit-mask: url("assets/img/logo-horizontal.webp") center / 100% 100% no-repeat;
  mask: url("assets/img/logo-horizontal.webp") center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  animation: destello 1.6s 0.7s ease-in-out both;
  pointer-events: none;
}

.hero-tagline {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.1;
  background: var(--plata-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: aparecer 0.8s 0.5s ease both;
}

.hero-text {
  max-width: 56ch;
  margin-top: 14px;
  font-size: 1.15rem;
  color: var(--texto);
  animation: aparecer 0.8s 0.65s ease both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
  margin-top: 30px;
  animation: aparecer 0.8s 0.8s ease both;
}

.server-box {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 12px 12px 12px 22px;
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
  text-align: left;
  animation: aparecer 0.8s 0.95s ease both;
}

.server-box-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.server-label {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--texto-suave);
}

.server-box strong {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--oro-claro);
}

.copy-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: linear-gradient(180deg, #3a4049, #262a31);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.4);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1rem;
  color: var(--plata);
  cursor: pointer;
  transition: color 0.18s ease;
}

.copy-button:hover {
  color: var(--oro-claro);
}

.hero-steps-link {
  margin-top: 26px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--texto-suave);
  text-decoration: underline;
  text-decoration-color: rgba(212, 166, 60, 0.6);
  text-underline-offset: 5px;
  animation: aparecer 0.8s 1.05s ease both;
}

.hero-steps-link:hover {
  color: var(--oro-claro);
}

@keyframes corona-entrada {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes destello {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -20% 0;
  }
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Secciones del inicio ---------- */

.section {
  padding: 104px 0;
}

.section-steel {
  background: var(--hierro-2);
  box-shadow: 0 -1px 0 var(--negro), 0 -2px 0 rgba(212, 166, 60, 0.22),
    0 1px 0 var(--negro), 0 2px 0 rgba(212, 166, 60, 0.22);
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 680px;
  margin: 0 auto 52px;
  text-align: center;
}

.section-heading > p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--texto);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.feature-card {
  padding: 30px 28px 32px;
}

.feature-card h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.75rem;
}

.feature-card h3::before {
  content: "";
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  background: var(--oro-metal);
  box-shadow: 0 0 0 1px var(--negro);
  transform: rotate(45deg);
}

.feature-card p {
  color: var(--texto);
}

/* Normativas en el inicio */
.rules-teaser {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 64px;
}

.rules-teaser-emblem {
  justify-self: center;
  width: min(100%, 400px);
  border-radius: 50%;
}

.rules-teaser-emblem img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.7));
  transition: filter 0.25s ease;
}

.rules-teaser-emblem:hover img {
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.7)) brightness(1.06);
}

.rules-teaser-content h2::after {
  margin-top: 16px;
}

.rules-teaser-content > p:not(.eyebrow) {
  max-width: 54ch;
  margin-top: 18px;
}

.rules-category-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
}

.rules-category-preview a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  border-radius: 2px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--plata);
  text-decoration: none;
  transition: box-shadow 0.18s ease, color 0.18s ease;
}

.rules-category-preview a::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--oro);
  transform: rotate(45deg);
}

.rules-category-preview a:hover {
  color: var(--oro-claro);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.6);
}

/* Pasos */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px 28px 32px;
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  color: #1c1405;
  background: var(--oro-metal);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.step h3 {
  margin-bottom: 8px;
  font-family: var(--f-display);
  font-size: 1.7rem;
}

.inline-link {
  color: var(--oro-claro);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Comunidad */
.community-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  align-items: center;
  gap: 40px;
  padding: 56px;
  overflow: hidden;
}

.community-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--verde) 0 33.3%, #c9ced6 33.3% 66.6%, var(--rojo) 66.6%);
}

.community-content > p:not(.eyebrow) {
  max-width: 56ch;
  margin-top: 16px;
}

.community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-top: 30px;
}

.community-logo {
  justify-self: center;
  width: min(100%, 230px);
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.7));
}

/* ---------- Pie de página ---------- */

.site-footer {
  padding: 36px 0 40px;
  background: #15181c;
  box-shadow: 0 -1px 0 var(--negro), 0 -2px 0 rgba(212, 166, 60, 0.28);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-brand img {
  width: auto;
  height: 34px;
}

.footer-brand span {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--plata);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.footer-nav a {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--texto);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--oro-claro);
}

.site-footer p {
  font-size: 0.95rem;
  color: var(--texto-suave);
}

/* ---------- Aviso flotante ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  padding: 12px 22px;
  background: var(--placa);
  box-shadow: var(--placa-borde), 0 18px 40px rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--oro-claro);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast:empty {
  display: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Portada de páginas internas (normativas y tienda)
   ========================================================================== */

.page-hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--header-h) + 64px) 0 64px;
  overflow: hidden;
}

.page-hero .hero-backdrop {
  background:
    radial-gradient(ellipse 40% 60% at 80% 45%, rgba(212, 166, 60, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 60%);
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr);
  align-items: center;
  gap: 48px;
}

.page-hero-text h1 {
  font-size: clamp(2.8rem, 6.4vw, 4.8rem);
  line-height: 1;
  background: var(--plata-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero-intro {
  max-width: 58ch;
  margin-top: 20px;
  font-size: 1.12rem;
}

.page-hero-logo {
  justify-self: center;
  width: min(100%, 300px);
  height: auto;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.7));
}

.page-hero-monogram {
  width: min(100%, 230px);
}

/* ==========================================================================
   Normativas
   ========================================================================== */

.rules-directory-section {
  padding: 8px 0 56px;
}

.rules-directory-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: 26px;
}

.rules-directory-heading h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
}

.rules-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 420px);
}

.rules-search span {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--texto-suave);
}

.rules-search input,
.cart-code-control input {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: #121519;
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.3);
  color: var(--plata);
  font-size: 1rem;
}

.rules-search input::placeholder,
.cart-code-control input::placeholder {
  color: #737a85;
}

.rules-search input:focus,
.cart-code-control input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--oro);
}

.rules-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.rules-category-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px 26px;
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
  text-decoration: none;
  transition: box-shadow 0.18s ease;
}

.rules-category-card:hover {
  box-shadow: 0 0 0 1px var(--negro), inset 0 0 0 1px var(--oro), var(--sombra);
}

.rules-category-number {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1;
  background: var(--oro-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rules-category-card h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.rules-category-card p {
  font-size: 0.97rem;
  color: var(--texto-suave);
}

.rules-content-section {
  padding: 0 0 110px;
}

.rules-content-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
}

.rules-side-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  box-shadow: inset 2px 0 0 var(--acero-claro);
}

.rules-side-nav span {
  padding: 0 0 8px 18px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--oro);
}

.rules-side-nav a {
  padding: 7px 0 7px 18px;
  margin-left: 0;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--texto);
  text-decoration: none;
  transition: color 0.18s ease, box-shadow 0.18s ease;
}

.rules-side-nav a:hover {
  color: var(--oro-claro);
  box-shadow: inset 2px 0 0 var(--oro);
}

.rules-articles {
  min-width: 0;
}

.rule-category-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.rule-category-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.rule-category-header > span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: #1c1405;
  background: var(--oro-metal);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.rule-category-header h2 {
  font-size: clamp(2rem, 3.6vw, 2.7rem);
}

.rule-category-header p {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--texto-suave);
}

.general-rules-summary,
.delictiva-rules-summary,
.marine-rules-summary,
.ems-rules-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px 78px;
}

.general-rules-summary span,
.delictiva-rules-summary span,
.marine-rules-summary span,
.ems-rules-summary span {
  padding: 5px 12px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--texto);
}

.rule-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-detail {
  background: var(--placa);
  box-shadow: 0 0 0 1px var(--negro), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  border-radius: 3px;
}

.rule-detail[open] {
  box-shadow: 0 0 0 1px var(--negro), inset 0 0 0 1px rgba(212, 166, 60, 0.4), var(--sombra);
}

.rule-detail summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.25;
  color: var(--plata);
  list-style: none;
  cursor: pointer;
}

.rule-detail summary::-webkit-details-marker {
  display: none;
}

.rule-detail summary::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-left: auto;
  border-right: 2px solid var(--oro);
  border-bottom: 2px solid var(--oro);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.2s ease;
}

.rule-detail[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.rule-detail summary:hover {
  color: var(--oro-claro);
}

.rule-detail summary > span {
  min-width: 3.2ch;
  font-weight: 700;
  color: var(--oro);
}

.rule-detail-content {
  padding: 4px 24px 24px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rule-detail-content > * {
  max-width: 78ch;
}

.rule-detail-content p {
  margin: 0.9em 0 0;
  line-height: 1.68;
}

.rule-subheading {
  margin: 1.5em 0 0.2em;
  font-size: 1.2rem;
  color: var(--oro-claro);
}

/* Listas de reglas */
.rule-list,
.rule-code-list,
.rule-code-priority-list,
.rule-rank-list,
.rule-article-list {
  margin: 0.9em 0 0;
  padding: 0;
  list-style: none;
}

.rule-list li,
.rule-code-list li,
.rule-code-priority-list li {
  position: relative;
  padding-left: 22px;
  margin: 0.45em 0;
  line-height: 1.6;
}

.rule-list li::before,
.rule-code-list li::before,
.rule-code-priority-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--oro);
  transform: rotate(45deg);
}

.rule-prohibited-list li::before,
.rule-sanctions-list li::before,
.rule-red-zone-list li::before {
  background: var(--rojo);
}

.rule-green-zone-list li::before {
  background: var(--verde);
}

.rule-example-list li::before {
  background: #b9bec6;
}

.rule-warning-list li::before {
  background: var(--oro-claro);
}

.rule-code-list li,
.rule-code-priority-list li {
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 1.1rem;
}

.rule-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: rango;
}

.rule-rank-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  border-radius: 2px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--plata);
  counter-increment: rango;
}

.rule-rank-list li::before {
  content: counter(rango);
  min-width: 2ch;
  font-weight: 700;
  color: var(--oro);
}

.rule-article-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.62;
}

.rule-article-list li:last-child {
  border-bottom: 0;
}

/* Avisos destacados */
.rule-emphasis-paragraph,
.rule-warning-paragraph,
.rule-important-notice,
.rule-uppercase-callout,
.rule-danger-callout,
.rule-detail-content p.rule-emphasis-paragraph,
.rule-detail-content p.rule-warning-paragraph {
  padding: 12px 16px;
  border-radius: 2px;
}

.rule-emphasis-paragraph {
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 3px 0 0 #b9bec6;
  color: var(--plata);
}

.rule-warning-paragraph {
  background: rgba(212, 166, 60, 0.08);
  box-shadow: inset 3px 0 0 var(--oro);
  color: var(--plata);
}

.rule-important-notice {
  background: rgba(212, 166, 60, 0.1);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.55);
  color: var(--oro-claro);
  font-weight: 500;
}

.rule-uppercase-callout,
.rule-danger-callout {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.rule-uppercase-callout {
  background: rgba(212, 166, 60, 0.1);
  box-shadow: inset 3px 0 0 var(--oro);
  color: var(--oro-claro);
}

.rule-danger-callout {
  background: rgba(217, 43, 55, 0.12);
  box-shadow: inset 3px 0 0 var(--rojo);
  color: #ffb3b8;
}

/* Términos de roleplay */
.roleplay-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 1em;
  max-width: none;
}

.roleplay-terms-grid-two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.roleplay-term {
  padding: 18px 18px 20px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  border-radius: 2px;
}

.roleplay-term h3 {
  color: var(--oro-claro);
  font-size: 1.2rem;
}

.roleplay-term p {
  margin-top: 0.6em;
  font-size: 0.98rem;
}

.roleplay-term-label {
  display: block;
  margin-top: 14px;
  font-family: var(--f-ui);
  font-weight: 600;
  color: var(--texto-suave);
}

.roleplay-term .rule-list {
  margin-top: 0.3em;
  font-size: 0.97rem;
}

.roleplay-term-note {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--texto-suave);
  font-style: italic;
}

/* Límites de robo */
.robbery-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 12px;
  margin-top: 1em;
  max-width: none;
}

.robbery-limit-card {
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  border-radius: 2px;
}

.robbery-limit-card h4 {
  margin-bottom: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--plata);
  overflow-wrap: anywhere;
}

.robbery-limit-card div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.robbery-limit-card span {
  font-family: var(--f-ui);
  font-weight: 600;
  color: var(--texto-suave);
}

.robbery-limit-card strong {
  white-space: nowrap;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--oro-claro);
}

/* Dudas y sin resultados */
.rules-help-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: 40px;
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.rules-help-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--verde) 0 33.3%, #c9ced6 33.3% 66.6%, var(--rojo) 66.6%);
}

.rules-help-card h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
}

.rules-help-card p:not(.eyebrow) {
  max-width: 54ch;
  margin-top: 10px;
}

.rules-no-results {
  padding: 40px;
  text-align: center;
  background: var(--placa);
  box-shadow: var(--placa-borde);
  border-radius: 3px;
}

.rules-no-results strong {
  display: block;
  font-family: var(--f-ui);
  font-size: 1.3rem;
  color: var(--plata);
}

.rules-no-results p {
  margin-top: 6px;
  color: var(--texto-suave);
}

.rules-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--negro);
  border-radius: 3px;
  background: var(--oro-metal);
  color: #1c1405;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.rules-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* ==========================================================================
   Tienda
   ========================================================================== */

.store-login-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  max-width: 720px;
  margin-top: 30px;
  padding: 22px 24px;
}

.store-login-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 260px;
}

.store-login-label {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--oro);
}

.store-login-info strong {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--plata);
}

.store-login-info small {
  font-size: 0.93rem;
  color: var(--texto-suave);
}

.store-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body:not(.tebex-authenticated) #tebexLogoutButton,
body.tebex-authenticated #tebexLoginButton {
  display: none !important;
}

.store-section {
  padding: 24px 0 110px;
}

.store-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: 26px;
}

.store-heading p:not(.eyebrow) {
  max-width: 58ch;
  margin-top: 12px;
}

.store-heading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}

.store-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--texto-suave);
}

.store-status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #6c737d;
  transform: rotate(45deg);
}

.store-status.is-connected::before {
  background: var(--verde);
}

.store-status.is-error::before {
  background: var(--rojo);
}

.inline-cart-count,
.cart-nav-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--oro-claro);
}

.store-notice {
  margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(212, 166, 60, 0.08);
  box-shadow: inset 3px 0 0 var(--oro);
  border-radius: 2px;
  color: var(--plata);
}

.store-notice[data-type="success"] {
  background: rgba(18, 160, 90, 0.1);
  box-shadow: inset 3px 0 0 var(--verde);
}

.store-notice[data-type="error"] {
  background: rgba(217, 43, 55, 0.1);
  box-shadow: inset 3px 0 0 var(--rojo);
}

.store-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.store-categories:empty {
  display: none;
}

.store-filter {
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: linear-gradient(180deg, #30353d, #22262c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--texto);
  cursor: pointer;
  transition: color 0.18s ease;
}

.store-filter:hover {
  color: var(--oro-claro);
}

.store-filter.is-active {
  background: var(--oro-metal);
  box-shadow: none;
  color: #1c1405;
}

.tebex-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tebex-product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--placa);
  box-shadow: var(--placa-borde), var(--sombra);
  border-radius: 3px;
  overflow: hidden;
}

.tebex-product-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(212, 166, 60, 0.16), transparent 70%),
    #15181c;
  box-shadow: inset 0 -1px 0 var(--negro);
}

.tebex-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tebex-product-media img.is-fallback {
  object-fit: contain;
  padding: 22px;
}

.tebex-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.75);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.5);
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--oro-claro);
}

.tebex-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}

.tebex-product-body h3 {
  font-size: 1.35rem;
}

.tebex-product-body p {
  flex: 1;
  font-size: 0.97rem;
  color: var(--texto-suave);
}

.tebex-product-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.tebex-product-price {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--oro-claro);
}

.tebex-buy-button {
  --punta: 11px;
  min-height: 42px;
  padding: 0.45rem 1.3rem;
  font-size: 1rem;
}

.tebex-loading-card,
.tebex-empty-state,
.store-noscript {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 52px 24px;
  text-align: center;
  background: var(--placa);
  box-shadow: var(--placa-borde);
  border-radius: 3px;
}

.tebex-loading-card strong,
.tebex-empty-state strong {
  font-family: var(--f-ui);
  font-size: 1.3rem;
  color: var(--plata);
}

.tebex-loading-card p,
.tebex-empty-state p {
  color: var(--texto-suave);
}

.tebex-empty-state .button {
  margin-top: 12px;
}

.tebex-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border: 3px solid rgba(212, 166, 60, 0.2);
  border-top-color: var(--oro);
  border-radius: 50%;
  animation: girar 0.9s linear infinite;
}

@keyframes girar {
  to {
    transform: rotate(360deg);
  }
}

/* Botón del carrito en la barra */
.cart-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-left: 10px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: linear-gradient(180deg, #30353d, #22262c);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.4);
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--plata);
  cursor: pointer;
}

.cart-nav-button:hover {
  color: var(--oro-claro);
}

.cart-nav-icon {
  color: var(--oro);
}

.cart-nav-button.has-items strong {
  background: var(--oro-metal);
  color: #1c1405;
}

/* Carrito lateral */
.cart-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.cart-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  background: var(--hierro-2);
  box-shadow: -1px 0 0 var(--negro), inset 1px 0 0 rgba(212, 166, 60, 0.4),
    -30px 0 60px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cart-drawer.is-open {
  transform: none;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 1px 0 var(--negro);
}

.cart-drawer-header .eyebrow {
  margin-bottom: 2px;
}

.cart-drawer-header h2 {
  font-size: 2.2rem;
}

.cart-close-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: var(--acero);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.35);
  color: var(--plata);
  cursor: pointer;
}

.cart-close-button:hover {
  color: var(--oro-claro);
}

.cart-auth-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--f-ui);
  font-weight: 600;
}

.cart-auth-summary span {
  color: var(--texto-suave);
}

.cart-auth-summary strong {
  color: var(--plata);
  text-align: right;
  overflow-wrap: anywhere;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 22px;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--placa);
  box-shadow: 0 0 0 1px var(--negro), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.cart-item img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 2px;
  background: #15181c;
}

.cart-item-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.cart-item-content strong {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--plata);
  overflow-wrap: anywhere;
}

.cart-item-content span {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.cart-item-content small {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1rem;
  color: var(--oro-claro);
}

.cart-remove-button,
.cart-clear-button,
.cart-code-applied button {
  padding: 6px 8px;
  border: 0;
  background: none;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--texto-suave);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cart-remove-button:hover,
.cart-clear-button:hover:not(:disabled),
.cart-code-applied button:hover {
  color: #ff9aa1;
}

.cart-remove-button:disabled,
.cart-clear-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-empty {
  padding: 36px 12px;
  text-align: center;
}

.cart-empty strong {
  display: block;
  font-family: var(--f-ui);
  font-size: 1.25rem;
  color: var(--plata);
}

.cart-empty p {
  margin-top: 4px;
  color: var(--texto-suave);
}

.cart-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding: 20px 22px 24px;
  box-shadow: 0 -1px 0 var(--negro), 0 -2px 0 rgba(212, 166, 60, 0.22);
}

.cart-discounts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px var(--acero-claro);
  border-radius: 2px;
}

.cart-discounts-heading span {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--oro);
}

.cart-discounts-heading h3 {
  font-size: 1.2rem;
}

.cart-discounts-heading p {
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.cart-code-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-code-form label {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--texto);
}

.cart-code-control {
  display: flex;
  gap: 8px;
}

.cart-code-control input {
  min-height: 42px;
  min-width: 0;
  flex: 1;
}

.cart-code-control button {
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: linear-gradient(180deg, #3a4049, #262a31);
  box-shadow: inset 0 0 0 1px rgba(212, 166, 60, 0.4);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 1rem;
  color: var(--plata);
  cursor: pointer;
}

.cart-code-control button:hover:not(:disabled) {
  color: var(--oro-claro);
}

.cart-code-control button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.cart-code-applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  background: rgba(18, 160, 90, 0.1);
  box-shadow: inset 3px 0 0 var(--verde);
  border-radius: 2px;
  font-size: 0.95rem;
}

.cart-code-applied strong {
  font-family: var(--f-ui);
  font-weight: 700;
  color: var(--oro-claro);
  letter-spacing: 0.03em;
}

.cart-code-applied button {
  margin-left: auto;
}

.cart-code-status {
  font-size: 0.92rem;
  color: var(--texto);
}

.cart-code-status[data-type="error"] {
  color: #ff9aa1;
}

.cart-code-status[data-type="success"] {
  color: #7fdcaa;
}

.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.15rem;
}

.cart-total-row strong {
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--oro-claro);
}

.cart-tax-note {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

.cart-checkout-button {
  width: 100%;
}

.cart-clear-button {
  align-self: center;
}

/* Ventana emergente de autorización (regreso de FiveM) */
.auth-return-screen {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
  background: var(--hierro);
}

.auth-return-screen strong {
  font-family: var(--f-display);
  font-size: 2rem;
  color: var(--oro-claro);
}

.auth-return-screen p {
  color: var(--texto-suave);
}

.auth-return-screen button {
  margin-top: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--negro);
  border-radius: 2px;
  background: var(--oro-metal);
  font-family: var(--f-ui);
  font-weight: 700;
  color: #1c1405;
  cursor: pointer;
}

/* ==========================================================================
   Adaptación a pantallas
   ========================================================================== */

@media (max-width: 1080px) {
  .rules-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .menu-button {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100vh - var(--header-h));
    padding: 16px 20px 28px;
    background: #16191e;
    box-shadow: 0 1px 0 var(--negro), 0 2px 0 rgba(212, 166, 60, 0.35),
      0 30px 50px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .main-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .site-header:has(.main-nav.is-open) {
    background: rgba(22, 25, 30, 0.98);
  }

  .nav-link {
    padding: 12px 6px;
    font-size: 1.25rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .nav-link.is-current::after {
    left: auto;
    right: 8px;
    bottom: 50%;
    transform: translateY(50%) rotate(45deg);
  }

  .main-nav .button-small,
  .cart-nav-button {
    margin: 14px 0 0;
    justify-content: center;
  }

  .feature-grid,
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 620px;
    margin-inline: auto;
  }

  .rules-teaser {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .rules-teaser-emblem {
    width: min(70%, 300px);
  }

  .community-card {
    grid-template-columns: 1fr;
    padding: 44px 32px;
  }

  .community-logo {
    grid-row: 1;
    justify-self: start;
    width: 120px;
  }

  .page-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .page-hero-logo {
    grid-row: 1;
    justify-self: start;
    width: 150px;
  }

  .page-hero-monogram {
    width: 120px;
  }

  .rules-content-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .rules-side-nav {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    flex-direction: row;
    gap: 4px;
    margin: 0 -20px;
    padding: 10px 20px;
    background: rgba(24, 27, 32, 0.96);
    box-shadow: 0 1px 0 var(--negro);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rules-side-nav span {
    display: none;
  }

  .rules-side-nav a {
    flex-shrink: 0;
    padding: 6px 12px;
    box-shadow: inset 0 0 0 1px var(--acero-claro);
    border-radius: 2px;
  }

  .rules-side-nav a:hover {
    box-shadow: inset 0 0 0 1px var(--oro);
  }

  .rule-category-section,
  .rules-help-card {
    scroll-margin-top: calc(var(--header-h) + 70px);
  }

  .general-rules-summary,
  .delictiva-rules-summary,
  .marine-rules-summary,
  .ems-rules-summary {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }

  body {
    font-size: 1rem;
  }

  .brand img {
    height: 36px;
  }

  .brand span {
    font-size: 1.35rem;
  }

  .section {
    padding: 76px 0;
  }

  .hero {
    padding-bottom: 56px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px;
  }

  .server-box {
    width: 100%;
    max-width: 360px;
    padding-left: 16px;
  }

  .server-box-text {
    flex: 1;
  }

  .server-box strong {
    font-size: 1.2rem;
    white-space: nowrap;
  }

  .rules-category-preview,
  .rules-category-grid {
    grid-template-columns: 1fr;
  }

  .community-card {
    padding: 40px 22px;
  }

  .community-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .rule-category-header {
    gap: 14px;
  }

  .rule-category-header > span {
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }

  .rule-detail summary {
    padding: 14px 16px;
    font-size: 1.08rem;
  }

  .rule-detail-content {
    padding: 2px 16px 20px;
  }

  .rules-help-card {
    padding: 32px 22px;
  }

  .store-login-actions,
  .store-login-actions .button {
    width: 100%;
  }

  .store-heading-tools {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero-wordmark-wrap::after {
    display: none;
  }

  .tebex-spinner {
    animation: girar 1.6s linear infinite !important;
    animation-duration: 1.6s !important;
  }
}
