/* ==========================================
   TIERSTRATEGY — Pokémon Pokédex
   Bloque 1: Identidad y descripción
   Mobile-first
========================================== */

.ts-single-pokemon-pokedex {
    width: min(calc(100% - 32px), var(--ts-container));
    margin: 0 auto;
}

/* ------------------------------------------
   Identidad
------------------------------------------ */

.ts-pokedex-identity {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 32px 0 28px;
}

.ts-pokedex-identity__number {
    color: var(--ts-text-soft);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ts-pokedex-identity__content {
    min-width: 0;
}

.ts-pokedex-identity__name {
    margin: 0;
    color: var(--ts-text);
    font-size: clamp(2.25rem, 9vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ts-pokedex-identity__types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ts-pokedex-identity__types .ts-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--ts-border);
    border-radius: 999px;
    color: var(--ts-text);
    background: var(--ts-bg-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.ts-pokedex-identity__types .ts-type-badge:hover,
.ts-pokedex-identity__types .ts-type-badge:focus-visible {
    border-color: var(--ts-blue);
    color: var(--ts-blue-dark);
}

/* ------------------------------------------
   Sprite
------------------------------------------ */

.ts-pokedex-identity__sprite {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 20px 8px 8px;
}

.ts-pokedex-identity__sprite img {
    display: block;
    width: min(100%, 300px);
    height: auto;
    max-height: 280px;
    object-fit: contain;
}

/* ------------------------------------------
   Descripción
------------------------------------------ */

.ts-pokedex-description {
    padding: 0 0 40px;
}

.ts-pokedex-description__title {
    margin: 0 0 16px;
    color: var(--ts-text);
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ts-pokedex-description__content {
    max-width: 760px;
    color: var(--ts-text-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.ts-pokedex-description__content p {
    margin: 0;
}

/* ------------------------------------------
   Tablet / desktop
------------------------------------------ */

@media (min-width: 769px) {

    .ts-single-pokemon-pokedex {
        width: min(calc(100% - 40px), var(--ts-container));
    }

    .ts-pokedex-identity {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
        grid-template-areas:
            "number sprite"
            "content sprite";
        column-gap: 48px;
        align-items: center;
        padding: 48px 0 48px;
    }

    .ts-pokedex-identity__number {
        grid-area: number;
        align-self: end;
    }

    .ts-pokedex-identity__content {
        grid-area: content;
        align-self: start;
    }

    .ts-pokedex-identity__sprite {
        grid-area: sprite;
        min-height: 0;
    }

    .ts-pokedex-identity__sprite img {
        width: min(100%, 380px);
        max-height: 360px;
    }

    .ts-pokedex-description {
        padding-bottom: 48px;
    }
}


/* ==========================================
   TIERSTRATEGY — Pokédex
   Bloque 2A: Información general
========================================== */

.ts-pokedex-general {
    padding: 8px 0 48px;
}

.ts-pokedex-section-title {
    margin: 0 0 20px;
    color: var(--ts-text);
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ts-pokedex-general__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ts-pokedex-info-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
}

.ts-pokedex-info-card__label {
    margin: 0 0 10px;
    color: var(--ts-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ts-pokedex-info-card__value {
    color: var(--ts-text);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.ts-pokedex-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-pokedex-info-list__item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ts-text);
    font-size: 1rem;
    line-height: 1.5;
}

.ts-pokedex-info-link {
    color: var(--ts-text);
    text-decoration: none;
}

.ts-pokedex-info-link:hover,
.ts-pokedex-info-link:focus-visible {
    color: var(--ts-blue-dark);
    text-decoration: underline;
}

.ts-pokedex-info-tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border: 1px solid var(--ts-border);
    border-radius: 999px;
    color: var(--ts-text-soft);
    background: var(--ts-bg-soft);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.ts-pokedex-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ts-pokedex-info-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--ts-border);
    border-radius: 999px;
    color: var(--ts-text);
    background: var(--ts-bg-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

@media (min-width: 769px) {

    .ts-pokedex-general {
        padding-bottom: 56px;
    }

    .ts-pokedex-general__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .ts-pokedex-info-card--wide {
        grid-column: 1 / -1;
    }

    .ts-pokedex-info-card {
        padding: 22px;
    }
}


/* ==========================================
   TIERSTRATEGY — Pokédex
   Bloque 3: Estadísticas base
========================================== */

.ts-pokedex-stats {
    padding: 0 0 48px;
}

.ts-pokedex-stats__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ts-pokedex-stat-card {
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
}

.ts-pokedex-stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ts-pokedex-stat-card__name {
    margin: 0;
    color: var(--ts-text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ts-pokedex-stat-card__value {
    color: var(--ts-text);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

@media (min-width: 769px) {

    .ts-pokedex-stats {
        padding-bottom: 64px;
    }

    .ts-pokedex-stats__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .ts-pokedex-stat-card {
        padding: 20px 22px;
    }
}





/* ==========================================
   TIERSTRATEGY — Pokédex
   Bloque 5: Movimientos / Learnset
========================================== */

.ts-pokedex-learnset {
    padding: 0 0 48px;
}

/* ------------------------------------------
   Filtros del Learnset
------------------------------------------ */

/* ------------------------------------------
   Filtros del Learnset
------------------------------------------ */

.ts-pokedex-learnset__filters {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg-soft);
}

.ts-pokedex-learnset__filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ts-pokedex-learnset__filters-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ts-pokedex-learnset__filters-grid label > span {
    color: var(--ts-text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ts-pokedex-learnset__filters select {
    width: 100%;
    min-height: 42px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    color: var(--ts-text);
    background: var(--ts-bg);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.ts-pokedex-learnset__filters select:hover {
    border-color: var(--ts-blue);
}

.ts-pokedex-learnset__filters select:focus {
    outline: 2px solid var(--ts-blue);
    outline-offset: 1px;
    border-color: var(--ts-blue);
}

.ts-pokedex-learnset__filters-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 14px;
}

.ts-pokedex-learnset__filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    color: var(--ts-text);
    background: var(--ts-bg);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.ts-pokedex-learnset__filter-reset:hover,
.ts-pokedex-learnset__filter-reset:focus-visible {
    border-color: var(--ts-blue);
    color: var(--ts-blue-dark);
}

@media (min-width: 769px) {

    .ts-pokedex-learnset__filters {
        padding: 18px 20px;
    }

    .ts-pokedex-learnset__filters-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 16px;
    }

    .ts-pokedex-learnset__filters-actions {
        justify-content: flex-end;
        margin-top: 16px;
    }
}

.ts-pokedex-learnset__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Tarjeta del movimiento */
.ts-pokedex-learnset__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "move details"
        "data data";
    align-items: start;
    gap: 12px 16px;
    min-width: 0;
    padding: 16px 20px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
}

/* Nombre del movimiento */
.ts-pokedex-learnset__move {
    grid-area: move;
    min-width: 0;
}

.ts-pokedex-learnset__move-link {
    color: var(--ts-text);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.ts-pokedex-learnset__move-link:hover,
.ts-pokedex-learnset__move-link:focus-visible {
    color: var(--ts-blue-dark);
    text-decoration: underline;
}

/* Método y nivel */
.ts-pokedex-learnset__details {
    grid-area: details;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.ts-pokedex-learnset__method,
.ts-pokedex-learnset__level {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--ts-border);
    border-radius: 999px;
    color: var(--ts-text-soft);
    background: var(--ts-bg-soft);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Datos del movimiento */
.ts-pokedex-learnset__move-data {
    grid-area: data;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 14px;
    min-width: 0;
    margin-top: 2px;
    padding-top: 11px;
    border-top: 1px solid var(--ts-border);
}

.ts-pokedex-learnset__move-data-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    color: var(--ts-text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.ts-pokedex-learnset__move-data-item strong {
    color: var(--ts-text);
    font-weight: 600;
}

@media (min-width: 769px) {

    .ts-pokedex-learnset {
        padding-bottom: 64px;
    }

    .ts-pokedex-learnset__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 16px;
    }

    .ts-pokedex-learnset__item {
        padding: 18px 22px;
        gap: 14px 20px;
    }

    .ts-pokedex-learnset__move-data {
        gap: 8px 18px;
    }

}

/* ==========================================
   TIERSTRATEGY — Pokédex
   Bloque 6: Evoluciones
========================================== */

.ts-pokedex-evolutions {
    padding: 0 0 48px;
}

.ts-pokedex-evolutions__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ts-pokedex-evolution-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
}

.ts-pokedex-evolution-card__pokemon {
    min-width: 0;
}

.ts-pokedex-evolution-card__pokemon-link {
    color: var(--ts-text);
    font-size: 1rem;
    line-height: 1.4;
    text-decoration: none;
}

.ts-pokedex-evolution-card__pokemon-link:hover,
.ts-pokedex-evolution-card__pokemon-link:focus-visible {
    color: var(--ts-blue-dark);
    text-decoration: underline;
}

.ts-pokedex-evolution-card__method {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ts-text-soft);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.ts-pokedex-evolution-card__arrow {
    color: var(--ts-text-soft);
    font-size: 1rem;
}

@media (min-width: 769px) {

    .ts-pokedex-evolutions {
        padding-bottom: 64px;
    }

    .ts-pokedex-evolutions__list {
        gap: 16px;
    }

    .ts-pokedex-evolution-card {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 20px;
        padding: 18px 22px;
    }

    .ts-pokedex-evolution-card__method {
        justify-content: center;
    }
}


/* ==========================================
   TIERSTRATEGY — Pokédex
   Bloque 7: Ubicaciones
========================================== */

.ts-pokedex-locations {
    padding: 0 0 48px;
}

/* ------------------------------------------
   Filtros de ubicaciones
------------------------------------------ */

.ts-pokedex-locations .location-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg-soft);
}

.ts-pokedex-locations .location-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ts-pokedex-locations .location-filters label > span {
    color: var(--ts-text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ts-pokedex-locations .location-filters select {
    width: 100%;
    min-height: 42px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    color: var(--ts-text);
    background: var(--ts-bg);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.ts-pokedex-locations .location-filters select:hover {
    border-color: var(--ts-blue);
}

.ts-pokedex-locations .location-filters select:focus {
    outline: 2px solid var(--ts-blue);
    outline-offset: 1px;
    border-color: var(--ts-blue);
}

/* ------------------------------------------
   Tabla de encuentros
------------------------------------------ */

.ts-pokedex-locations .location-encounters {
    width: 100%;
    min-width: 0;
}

.ts-pokedex-locations .location-table-wrapper {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    background: var(--ts-bg);
    -webkit-overflow-scrolling: touch;
}

.ts-pokedex-locations .location-table {
    width: 100%;
    min-width: 820px;
    margin: 0;
    border-collapse: collapse;
    border-spacing: 0;
    color: var(--ts-text);
    font-size: 13px;
    line-height: 1.4;
}

.ts-pokedex-locations .location-table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--ts-border);
    color: var(--ts-text-soft);
    background: var(--ts-bg-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.ts-pokedex-locations .location-table td {
    padding: 12px;
    border-bottom: 1px solid var(--ts-border);
    color: var(--ts-text);
    vertical-align: middle;
}

.ts-pokedex-locations .location-table tbody tr:last-child td {
    border-bottom: 0;
}

.ts-pokedex-locations .location-table tbody tr:hover {
    background: var(--ts-bg-soft);
}

.ts-pokedex-locations .location-table td:first-child,
.ts-pokedex-locations .location-table th:first-child {
    min-width: 170px;
}

.ts-pokedex-locations .location-table td:first-child {
    font-weight: 600;
}

.ts-pokedex-locations .location-table td:first-child a {
    color: var(--ts-text);
    text-decoration: none;
}

.ts-pokedex-locations .location-table td:first-child a:hover,
.ts-pokedex-locations .location-table td:first-child a:focus-visible {
    color: var(--ts-blue-dark);
    text-decoration: underline;
}

.ts-pokedex-locations .location-table td:nth-child(2),
.ts-pokedex-locations .location-table td:nth-child(3),
.ts-pokedex-locations .location-table td:nth-child(5),
.ts-pokedex-locations .location-table td:nth-child(6),
.ts-pokedex-locations .location-table td:nth-child(7),
.ts-pokedex-locations .location-table td:nth-child(8),
.ts-pokedex-locations .location-table td:nth-child(9) {
    white-space: nowrap;
}

.ts-pokedex-locations .location-table td:nth-child(7),
.ts-pokedex-locations .location-table td:nth-child(8),
.ts-pokedex-locations .location-table td:nth-child(9),
.ts-pokedex-locations .location-table th:nth-child(7),
.ts-pokedex-locations .location-table th:nth-child(8),
.ts-pokedex-locations .location-table th:nth-child(9) {
    text-align: center;
}

/* ------------------------------------------
   Tablet / desktop
------------------------------------------ */

@media (min-width: 769px) {

    .ts-pokedex-locations {
        padding-bottom: 64px;
    }

    .ts-pokedex-locations .location-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 16px;
        padding: 18px 20px;
    }

    .ts-pokedex-locations .location-table {
        font-size: 14px;
    }

    .ts-pokedex-locations .location-table th {
        padding: 12px 14px;
    }

    .ts-pokedex-locations .location-table td {
        padding: 13px 14px;
    }
}
