/**
 * APRAMP Buscador — recursos.css
 * Especificidad via #apramp-buscador (ID).
 * !important solo donde Salient lo fuerza sin remedio:
 *   · box-sizing reset global
 *   · img max-width (Salient pone img { max-width:100% } globalmente)
 *   · appearance en inputs y selects (reset de browser)
 */

/* ── Reset de box-sizing ───────────────────────────────────────────────
   Salient aplica su propio reset con alta especificidad, no hay otra
   forma limpia de sobreescribirlo dentro del wrapper.
──────────────────────────────────────────────────────────────────────── */
#apramp-buscador *,
#apramp-buscador *::before,
#apramp-buscador *::after {
    box-sizing: border-box !important;
}

/* ── Variables del design system ─────────────────────────────────────── */
#apramp-buscador {
    --color-primary:        #D3007A;
    --color-primary-dark:   #A8005F;
    --color-primary-light:  #FBE5F2;
    --color-neutral-base:   #56434A;
    --color-neutral-500:    #877D81;
    --color-border:         #EDE3E8;
    --color-border-input:   #DDD5D9;
    --color-bg-filters:     #FCF8FA;
    --font:                 Ubuntu, sans-serif;
    --radius-card:          16px;
    --radius-btn:           8px;

    max-width: 1160px;
    margin: 0 auto;
    font-family: var(--font);
}

/* ═══════════════════════════════════════════════════════════════════════
   FILTROS
═══════════════════════════════════════════════════════════════════════ */

/* ── Banda full-width rosita ────────────────────────────────────────── */
/* Necesita margin negativo para romper el contenedor de Salient        */
#apramp-buscador .ab-filtros-band {
    background: var(--color-bg-filters);
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 32px 20px 36px;
    margin-bottom: 40px;
}

/* Centrado interno — mismo ancho máximo que el resto del buscador */
#apramp-buscador .ab-filtros-inner {
    max-width: 1160px;
    margin: 0 auto;
}

/* Caja blanca con sombra suave dentro de la banda rosita */
#apramp-buscador .ab-filtros-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(211, 0, 122, 0.06);
    padding: 20px 24px 18px;
}

#apramp-buscador .ab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Input búsqueda */
/* Input — fondo blanco sobre rosita de la caja */
#apramp-buscador .ab-input-wrap {
    flex: 1 1 280px;
    min-width: 200px;
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-btn);
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#apramp-buscador .ab-input-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(211, 0, 122, 0.1);
}

#apramp-buscador .ab-lupa-icon {
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px;
    color: var(--color-neutral-500);
    flex-shrink: 0;
}

#apramp-buscador .ab-texto {
    flex: 1;
    height: 100%;
    width: 100%;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-neutral-base);
    padding: 0 12px 0 0;
    margin: 0;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#apramp-buscador .ab-texto::placeholder {
    color: var(--color-neutral-500);
    opacity: 1;
}

/* Selects */
/* Selects — fondo blanco, border-radius 8px */
#apramp-buscador .ab-select-wrap {
    flex: 0 1 220px;
    min-width: 160px;
    position: relative;
    display: flex;
    align-items: center;
    height: 44px;
}

#apramp-buscador .ab-select {
    width: 100%;
    height: 100%;
    padding: 0 36px 0 14px;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-neutral-base);
    background: #ffffff;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    margin: 0;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.2s ease;
}

#apramp-buscador .ab-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(211, 0, 122, 0.1);
}

#apramp-buscador .ab-chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 9px;
    color: var(--color-neutral-500);
    line-height: 1;
}

/* Botones de tipo */
#apramp-buscador .ab-tipos-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

#apramp-buscador .ab-tipo-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    background: var(--color-bg-filters);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    color: var(--color-neutral-base);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    box-shadow: none;
    margin: 0;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

#apramp-buscador .ab-tipo-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

#apramp-buscador .ab-tipo-btn.ab-tipo-activo,
#apramp-buscador .ab-tipo-btn.ab-tipo-activo:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTADOR
═══════════════════════════════════════════════════════════════════════ */

#apramp-buscador .ab-contador {
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--color-neutral-500);
    margin: 0 0 18px;
    padding: 0;
    min-height: 18px;
    line-height: 1.5;
    background: none;
    border: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   LOADING
═══════════════════════════════════════════════════════════════════════ */

#apramp-buscador .ab-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    font-size: 14px;
    color: var(--color-neutral-500);
    grid-column: 1 / -1;
}

#apramp-buscador .ab-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: abSpin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ═══════════════════════════════════════════════════════════════════════
   GRID DE TARJETAS
═══════════════════════════════════════════════════════════════════════ */

#apramp-buscador .ab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    #apramp-buscador .ab-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #apramp-buscador .ab-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   TARJETA
═══════════════════════════════════════════════════════════════════════ */

#apramp-buscador .ab-card {
    background: #fff;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}

#apramp-buscador .ab-card:hover {
    box-shadow: 0 8px 32px rgba(211, 0, 122, 0.12);
    transform: translateY(-4px);
}

/* Imagen */
#apramp-buscador .ab-card-img-link {
    display: block;
    line-height: 0;
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
}

#apramp-buscador .ab-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #F9F0F5;
}

/* Salient fuerza img { max-width: 100%; height: auto } globalmente.
   Necesitamos !important solo en estas dos propiedades para que
   object-fit funcione correctamente. */
#apramp-buscador .ab-card-img img.ab-card-photo {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    max-width: none !important;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    transition: transform 0.4s ease;
}

#apramp-buscador .ab-card:hover .ab-card-img img.ab-card-photo {
    transform: scale(1.05);
}

#apramp-buscador .ab-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #D3B8C5;
}

/* Cuerpo */
#apramp-buscador .ab-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 20px 24px;
}

/* Meta: badge + año */
#apramp-buscador .ab-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    line-height: 1;
}

/* Badge — todos iguales, sin variantes por tipo */
#apramp-buscador .ab-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    margin: 0;
    border: none;
    box-shadow: none;
    text-decoration: none;
}

/* Año */
#apramp-buscador .ab-card-anno {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    color: var(--color-neutral-500);
    margin: 0;
    padding: 0;
}

#apramp-buscador .ab-card-anno svg,
#apramp-buscador .ab-card-arrow svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    overflow: visible;
}

/* Título — máx. 2 líneas */
#apramp-buscador .ab-card-titulo {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    color: var(--color-neutral-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 64px;
    margin: 0 0 8px;
    padding: 0;
    background: none;
    border: none;
}

#apramp-buscador .ab-card-titulo a {
    color: var(--color-neutral-base);
    text-decoration: none;
    transition: color 0.18s ease;
}

#apramp-buscador .ab-card-titulo a:hover {
    color: var(--color-primary);
}

/* Extracto */
#apramp-buscador .ab-card-extracto {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--color-neutral-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 16px;
    padding: 0;
    background: none;
}

/* Footer — div wrapper que empuja el botón al fondo */
#apramp-buscador .ab-card-footer {
    margin-top: auto;
    padding-top: 8px;
}

/* Flecha */
#apramp-buscador .ab-card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
    text-decoration: none;
    margin-top: 0;
    align-self: flex-start;
    padding: 0;
    box-shadow: none;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#apramp-buscador .ab-card-arrow:hover {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.1);
}

/* Sin resultados */
#apramp-buscador .ab-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-neutral-500);
    font-family: var(--font);
    font-size: 15px;
    padding: 50px 20px;
    border: 1.5px dashed var(--color-border);
    border-radius: 10px;
    background: #fafafa;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   PAGINACIÓN
═══════════════════════════════════════════════════════════════════════ */

#apramp-buscador .ab-pag {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0 40px;
    margin: 0;
}

#apramp-buscador .ab-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid var(--color-border-input);
    border-radius: 8px;
    background: #fff;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-neutral-base);
    cursor: pointer;
    box-shadow: none;
    margin: 0;
    line-height: 1;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

#apramp-buscador .ab-pag-btn:hover:not([disabled]) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

#apramp-buscador .ab-pag-btn.ab-pag-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

#apramp-buscador .ab-pag-btn[disabled] {
    opacity: 0.3;
    cursor: default;
}

#apramp-buscador .ab-pag-dots {
    font-size: 16px;
    color: var(--color-neutral-500);
    padding: 0 4px;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   PÁGINA DETALLE (single-apramp_recurso)
═══════════════════════════════════════════════════════════════════════ */

.apramp-detalle-wrap { padding: 40px 20px 60px; }
.apramp-detalle-inner { max-width: 1100px; margin: 0 auto; }
.apramp-detalle-breadcrumb { font-family: Ubuntu, sans-serif; font-size: 13px; color: #877D81; margin-bottom: 32px; }
.apramp-detalle-breadcrumb a { color: #877D81; text-decoration: none; }
.apramp-detalle-breadcrumb a:hover { color: #D3007A; }
.apramp-detalle-layout { display: grid; grid-template-columns: 360px 1fr; gap: 48px; margin-bottom: 56px; align-items: start; }
@media (max-width: 900px) { .apramp-detalle-layout { grid-template-columns: 1fr; } }
.apramp-detalle-imagen img { width: 100%; border-radius: 10px; box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.apramp-detalle-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.apramp-detalle-anno { font-family: Ubuntu, sans-serif; font-size: 13px; color: #877D81; }
.apramp-detalle-titulo { font-family: Ubuntu, sans-serif; font-size: 26px; font-weight: 700; line-height: 1.3; margin: 0 0 18px; color: #56434A; }
.apramp-detalle-descripcion { font-family: Ubuntu, sans-serif; font-size: 16px; line-height: 1.7; color: #877D81; margin-bottom: 28px; }
.apramp-btn-acceso { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; background: #D3007A; color: #fff; border-radius: 10px; font-family: Ubuntu, sans-serif; font-size: 15px; font-weight: 600; text-decoration: none; transition: background 0.18s ease; }
.apramp-btn-acceso:hover { background: #A8005F; color: #fff; }
.apramp-relacionados { border-top: 1px solid #F0E8EC; padding-top: 40px; }
.apramp-relacionados-titulo { font-family: Ubuntu, sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 24px; color: #56434A; }
