/* =================================
   CONFIGURACIÓN GENERAL
================================= */

:root {
  color-scheme: dark;
  --bg: #020409;
  --bg-soft: #070c14;
  --surface: #0b1320;
  --surface-soft: #0e1928;
  --surface-glass: rgba(5, 12, 23, 0.94);
  --text: #f5f7fa;
  --text-soft: #a8b3c2;
  --text-muted: #7f8da0;
  --border: rgba(0, 153, 255, 0.2);
  --border-strong: rgba(0, 174, 255, 0.48);
  --blue: #0099ff;
  --blue-dark: #006fc7;
  --green: #25d366;
  --green-dark: #159e4a;
  --purple: #8b7cff;
  --danger: #ff5b70;
  --shadow: 0 24px 58px rgba(0, 0, 0, 0.36);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #edf2f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-glass: rgba(255, 255, 255, 0.95);
  --text: #101828;
  --text-soft: #344054;
  --text-muted: #667085;
  --border: rgba(0, 116, 217, 0.18);
  --border-strong: rgba(0, 116, 217, 0.42);
  --blue: #0074d9;
  --blue-dark: #005cae;
  --green: #159e4a;
  --green-dark: #087a36;
  --purple: #6957df;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-soft);
  background:
    radial-gradient(
      circle at 8% 3%,
      rgba(0, 153, 255, 0.08),
      transparent 28%
    ),
    radial-gradient(
      circle at 95% 35%,
      rgba(37, 211, 102, 0.045),
      transparent 28%
    ),
    var(--bg);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  transition:
    color 0.25s ease,
    background-color 0.25s ease;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(0, 153, 255, 0.35);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* =================================
   ENCABEZADO
================================= */

.prices-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.prices-header-content {
  width: min(100%, 1220px);
  min-height: 76px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.prices-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.prices-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(0, 153, 255, 0.14);
}

.prices-brand div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.prices-brand strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prices-brand span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.prices-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.back-store-link {
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 800;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.back-store-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.back-store-link span {
  color: var(--blue);
  font-size: 1rem;
}

.prices-theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.25rem;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.prices-theme-toggle:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

/* =================================
   CONTENIDO PRINCIPAL
================================= */

.prices-main {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 112px 20px 58px;
}

/* =================================
   PRESENTACIÓN Y DESCUENTOS
================================= */

.prices-hero {
  position: relative;
  isolation: isolate;
  padding: clamp(28px, 5vw, 50px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 25px;
  background:
    radial-gradient(
      circle at 94% 4%,
      rgba(37, 211, 102, 0.13),
      transparent 31%
    ),
    radial-gradient(
      circle at 3% 100%,
      rgba(0, 153, 255, 0.14),
      transparent 35%
    ),
    linear-gradient(145deg, #0d1929 0%, #08121f 53%, #07161b 100%);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .prices-hero {
  background:
    radial-gradient(
      circle at 94% 4%,
      rgba(37, 211, 102, 0.1),
      transparent 32%
    ),
    radial-gradient(
      circle at 3% 100%,
      rgba(0, 116, 217, 0.09),
      transparent 36%
    ),
    linear-gradient(145deg, #ffffff, #f6faff 58%, #f2fbf6);
}

.prices-hero-badge {
  width: fit-content;
  margin-bottom: 13px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(37, 211, 102, 0.23);
  border-radius: 999px;
  color: var(--green);
  background: rgba(37, 211, 102, 0.065);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.prices-hero-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.12);
}

.prices-hero h1 {
  max-width: 750px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.prices-hero > p {
  max-width: 720px;
  margin: 17px 0 28px;
  color: var(--text-soft);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.discount-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.discount-rule {
  min-width: 0;
  padding: 19px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 17px;
}

.discount-rule-fifteen {
  border: 1px solid rgba(0, 153, 255, 0.23);
  background: rgba(0, 153, 255, 0.07);
}

.discount-rule-twenty {
  border: 1px solid rgba(37, 211, 102, 0.23);
  background: rgba(37, 211, 102, 0.07);
}

.discount-percentage {
  width: 65px;
  height: 65px;
  flex: 0 0 65px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.1rem;
  font-weight: 950;
}

.discount-rule-fifteen .discount-percentage {
  color: #55c0ff;
  background: rgba(0, 153, 255, 0.13);
}

.discount-rule-twenty .discount-percentage {
  color: var(--green);
  background: rgba(37, 211, 102, 0.13);
}

.discount-rule div:last-child {
  min-width: 0;
}

.discount-rule span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.discount-rule strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
}

.discount-rule p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

/* =================================
   CATÁLOGO
================================= */

.prices-catalog {
  margin-top: 20px;
  padding: clamp(23px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
}

.catalog-heading > div {
  min-width: 0;
}

.catalog-heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.catalog-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  line-height: 1.2;
}

.catalog-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.77rem;
  line-height: 1.5;
}

/* Buscador y filtros */

.catalog-controls {
  margin-top: 25px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--bg-soft);
}

.prices-search label {
  display: block;
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.prices-search-input {
  position: relative;
}

.prices-search-input svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.prices-search-input input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  font-size: 16px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.prices-search-input input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.prices-search-input input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.11);
}

.prices-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.price-filter {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 850;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.price-filter:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.price-filter.active {
  color: #ffffff;
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 7px 16px rgba(0, 153, 255, 0.16);
}

/* Contador de resultados */

.prices-results-bar {
  margin: 18px 2px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.prices-results-bar p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.prices-results-bar > span {
  color: var(--text-muted);
  font-size: 0.66rem;
}

/* =================================
   TABLA
================================= */

.prices-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--bg-soft);
  scrollbar-color: var(--blue) transparent;
  scrollbar-width: thin;
}

.prices-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  border-spacing: 0;
}

.prices-table th,
.prices-table td {
  padding: 15px 14px;
  text-align: left;
  vertical-align: middle;
}

.prices-table th {
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.prices-table th:first-child {
  border-top-left-radius: 16px;
}

.prices-table th:last-child {
  border-top-right-radius: 16px;
}

.prices-table tbody tr {
  border-top: 1px solid var(--border);
  transition: background-color 0.18s ease;
}

.prices-table tbody tr:hover {
  background: rgba(0, 153, 255, 0.045);
}

.prices-table td {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.prices-table td:first-child {
  color: var(--text);
  font-weight: 850;
}

.service-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.service-name strong {
  color: var(--text);
  font-size: 0.81rem;
}

.service-name span {
  color: var(--text-muted);
  font-size: 0.64rem;
}

.category-label {
  width: fit-content;
  padding: 5px 8px;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(0, 153, 255, 0.055);
  font-size: 0.61rem;
  font-weight: 850;
  text-transform: uppercase;
}

.category-label.category-cuentas {
  color: #a99dff;
  border-color: rgba(139, 124, 255, 0.24);
  background: rgba(139, 124, 255, 0.07);
}

.category-label.category-combos {
  color: var(--green);
  border-color: rgba(37, 211, 102, 0.23);
  background: rgba(37, 211, 102, 0.07);
}

.public-price {
  color: var(--text-soft);
  font-weight: 750;
  white-space: nowrap;
}

.reseller-price {
  color: #55c0ff;
  font-size: 0.83rem;
  font-weight: 900;
  white-space: nowrap;
}

.reseller-price.best-price {
  color: var(--green);
}

.table-discount-label {
  margin-right: 4px;
  padding: 3px 6px;
  display: inline-block;
  border-radius: 999px;
  font-size: 0.57rem;
  font-weight: 950;
}

.table-discount-label.discount-15 {
  color: #55c0ff;
  background: rgba(0, 153, 255, 0.11);
}

.table-discount-label.discount-20 {
  color: var(--green);
  background: rgba(37, 211, 102, 0.11);
}

/* Estado sin resultados */

.prices-empty-state {
  margin-top: 12px;
  padding: 35px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 17px;
  color: var(--text-muted);
  background: var(--bg-soft);
  text-align: center;
}

.prices-empty-state[hidden] {
  display: none;
}

.prices-empty-state div {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 2rem;
}

.prices-empty-state strong {
  display: block;
  color: var(--text);
}

.prices-empty-state p {
  margin: 5px 0 0;
  font-size: 0.76rem;
}

/* Condición final */

.prices-note {
  margin-top: 15px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid rgba(37, 211, 102, 0.19);
  border-radius: 15px;
  background: rgba(37, 211, 102, 0.05);
}

.prices-note strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.77rem;
}

.prices-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: right;
}

/* =================================
   PIE DE PÁGINA
================================= */

.prices-footer {
  width: min(calc(100% - 32px), 1180px);
  margin: 0 auto;
  padding: 23px 16px calc(23px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
}

.prices-footer img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: cover;
}

.prices-footer p {
  margin: 0;
  font-size: 0.71rem;
}

/* =================================
   TABLETAS
================================= */

@media (max-width: 900px) {
  .catalog-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .catalog-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* =================================
   CELULARES
================================= */

@media (max-width: 767px) {
  .prices-header-content {
    min-height: 70px;
    padding:
      calc(8px + env(safe-area-inset-top))
      9px
      8px;
    gap: 8px;
  }

  .prices-brand {
    gap: 7px;
  }

  .prices-brand img {
    width: 41px;
    height: 41px;
    flex-basis: 41px;
    border-radius: 12px;
  }

  .prices-brand strong {
    max-width: 135px;
    font-size: 0.75rem;
  }

  .prices-brand span {
    display: none;
  }

  .prices-header-actions {
    gap: 6px;
  }

  .back-store-link {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 0.65rem;
  }

  .prices-theme-toggle {
    width: 38px;
    height: 38px;
  }

  .prices-main {
    padding:
      calc(91px + env(safe-area-inset-top))
      8px
      38px;
  }

  .prices-hero {
    padding: 25px 16px 17px;
    border-radius: 19px;
  }

  .prices-hero h1 {
    font-size: clamp(1.7rem, 8vw, 2.3rem);
  }

  .prices-hero > p {
    margin: 14px 0 20px;
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .discount-rules {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .discount-rule {
    padding: 14px;
    gap: 12px;
    border-radius: 14px;
  }

  .discount-percentage {
    width: 53px;
    height: 53px;
    flex-basis: 53px;
    border-radius: 15px;
    font-size: 0.92rem;
  }

  .prices-catalog {
    margin-top: 10px;
    padding: 21px 12px 14px;
    border-radius: 19px;
  }

  .catalog-heading > p {
    font-size: 0.72rem;
  }

  .catalog-controls {
    margin-top: 18px;
    padding: 11px;
    gap: 12px;
    border-radius: 14px;
  }

  .prices-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-filter {
    width: 100%;
  }

  .prices-results-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    margin: 15px 2px 9px;
  }

  /* La tabla se convierte en tarjetas */

  .prices-table-wrapper {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .prices-table {
    min-width: 0;
    display: block;
  }

  .prices-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .prices-table tbody {
    display: grid;
    gap: 10px;
  }

  .prices-table tbody tr {
    padding: 14px;
    display: block;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--bg-soft);
  }

  .prices-table tbody tr:hover {
    background: var(--bg-soft);
  }

  .prices-table td {
    width: 100%;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }

  .prices-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.61rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .prices-table td:first-child {
    padding-top: 0;
    display: block;
    border-bottom: 0;
    text-align: left;
  }

  .prices-table td:first-child::before {
    display: none;
  }

  .prices-table td:nth-child(2) {
    padding-top: 4px;
  }

  .prices-table td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .service-name strong {
    font-size: 0.88rem;
  }

  .prices-note {
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .prices-note p {
    text-align: left;
  }

  .prices-footer {
    width: calc(100% - 16px);
    padding-inline: 8px;
  }
}

@media (max-width: 390px) {
  .prices-brand strong {
    max-width: 105px;
  }

  .back-store-link {
    font-size: 0;
  }

  .back-store-link span {
    font-size: 1.1rem;
  }
}

/* =================================
   REDUCIR ANIMACIONES
================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}