/* MAH · Buscador / Galería pública de perdidas y encontradas */

.mah-buscador {
    margin: 1.5rem 0;
}
.mah-buscador * { box-sizing: border-box; }

/* Mapa al inicio */
.mah-buscador-mapa {
    margin-bottom: 2rem;
}

/* ============================================
 * FILTROS
 * ============================================ */
.mah-buscador-filtros {
    background: white;
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 4px 20px rgba(27, 58, 47, 0.08);
    margin-bottom: 1.5rem;
    position: sticky;
    top: 80px; /* offset for sticky header */
    z-index: 50;
}

.mah-buscador-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.mah-buscador-tab {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1rem;
    background: #f5f0e0;
    color: #555 !important;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none !important;
    transition: all .2s;
}
.mah-buscador-tab:hover {
    background: #ebe2c8;
    color: #1B3A2F !important;
}
.mah-buscador-tab.is-active {
    background: #1B3A2F;
    color: white !important;
}
.mah-buscador-tab.mah-tab-perdida.is-active { background: #F57921; color: white !important; }
.mah-buscador-tab.mah-tab-encontrada.is-active { background: #E8B547; color: #1A1A1A !important; }
.mah-tab-count {
    background: rgba(0,0,0,0.12);
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.mah-buscador-tab.is-active .mah-tab-count {
    background: rgba(255,255,255,0.25);
}
.mah-buscador-cta {
    margin-left: auto;
    padding: .55rem 1.1rem;
    background: white;
    color: #1B3A2F !important;
    border: 2px solid #1B3A2F;
    border-radius: 999px;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none !important;
    transition: all .2s;
}
.mah-buscador-cta:hover {
    background: #1B3A2F;
    color: white !important;
}

/* Search bar + filters */
.mah-buscador-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
    gap: .6rem;
    align-items: stretch;
}
.mah-buscador-search {
    position: relative;
}
.mah-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: .6;
}
.mah-buscador-search input {
    width: 100%;
    padding: .7rem .8rem .7rem 2.5rem;
    border: 1.5px solid #e0d8c4;
    border-radius: 8px;
    font-size: .92rem;
    font-family: inherit;
}
.mah-buscador-search input:focus {
    outline: none;
    border-color: #F57921;
    box-shadow: 0 0 0 3px rgba(245, 121, 33, 0.15);
}
.mah-select {
    padding: .7rem .8rem;
    border: 1.5px solid #e0d8c4;
    border-radius: 8px;
    font-size: .9rem;
    background: white;
    font-family: inherit;
    cursor: pointer;
}
.mah-select:focus {
    outline: none;
    border-color: #F57921;
}
.mah-buscador-btn {
    padding: .7rem 1.4rem;
    background: #F57921;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    white-space: nowrap;
}
.mah-buscador-btn:hover {
    background: #D86813;
    transform: translateY(-1px);
}
.mah-buscador-clear {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f5f0e0;
    color: #888 !important;
    font-weight: 700;
    text-decoration: none !important;
    transition: all .2s;
}
.mah-buscador-clear:hover {
    background: #c44;
    color: white !important;
}

/* Stats */
.mah-buscador-stats {
    margin: 1.5rem 0 1rem;
    color: #666;
    font-size: .92rem;
}
.mah-buscador-stats strong { color: #1B3A2F; font-size: 1.05rem; }
.mah-buscador-stats em { color: #aaa; font-style: italic; }

/* ============================================
 * GRID DE CARDS
 * ============================================ */
.mah-buscador-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.mah-bcard {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(27, 58, 47, 0.08);
    transition: transform .35s cubic-bezier(.2,0,.2,1), box-shadow .35s;
    display: flex;
    flex-direction: column;
}
.mah-bcard:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(27, 58, 47, 0.18);
}
.mah-bcard-resuelto { opacity: 0.78; }

.mah-bcard-link {
    display: flex;
    flex-direction: column;
    color: inherit !important;
    text-decoration: none !important;
}

.mah-bcard-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    background: #f5f0e0;
}
.mah-bcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.mah-bcard:hover .mah-bcard-img img { transform: scale(1.06); }

.mah-bcard-noimg {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 4rem;
    color: #c5b896;
}

/* Badges */
.mah-bcard-badges {
    position: absolute;
    top: .7rem;
    left: .7rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    z-index: 2;
}
.mah-bcard-badge {
    display: inline-block;
    padding: .3rem .8rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mah-bcard-badge-perdida    { background: #F57921; color: white; }
.mah-bcard-badge-encontrada { background: #E8B547; color: #1A1A1A; }
.mah-bcard-badge-resuelto   { background: #2a7a4a; color: white; }

.mah-bcard-photos {
    position: absolute;
    top: .7rem;
    right: .7rem;
    background: rgba(17, 40, 34, 0.85);
    color: white;
    padding: .25rem .6rem;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
}

.mah-bcard-body {
    padding: 1rem 1.1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.mah-bcard-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: #1B3A2F;
    margin: 0 0 .5rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.mah-bcard-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 .6rem;
    font-size: .8rem;
    color: #888;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.mah-bcard-meta li { line-height: 1.4; }
.mah-bcard-meta-loc { color: #555; font-weight: 500; }

.mah-bcard-desc {
    color: #666;
    font-size: .87rem;
    line-height: 1.5;
    margin: .3rem 0 0;
    flex: 1;
}

.mah-bcard-wapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: #25D366;
    color: white !important;
    padding: .75rem 1rem;
    font-weight: 700;
    font-size: .85rem;
    text-decoration: none !important;
    transition: background .2s;
    margin: 0;
}
.mah-bcard-wapp:hover { background: #1aa850; }
.mah-bcard-wapp span { font-size: 1.1rem; }

/* ============================================
 * PAGINACIÓN
 * ============================================ */
.mah-buscador-paginacion {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.mah-buscador-paginacion a,
.mah-buscador-paginacion span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .8rem;
    border-radius: 8px;
    font-weight: 600;
    color: #1B3A2F;
    border: 1.5px solid #e0d8c4;
    background: white;
    text-decoration: none !important;
    transition: all .2s;
    font-size: .9rem;
}
.mah-buscador-paginacion a:hover {
    background: #fdead6;
    border-color: #F57921;
    color: #F57921;
}
.mah-buscador-paginacion .current {
    background: #F57921;
    border-color: #F57921;
    color: white;
}
.mah-buscador-paginacion .dots {
    border: none;
    background: transparent;
    color: #aaa;
}

/* ============================================
 * EMPTY STATE
 * ============================================ */
.mah-buscador-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #fafaf5;
    border-radius: 12px;
}
.mah-buscador-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.mah-buscador-empty h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    color: #1B3A2F;
    margin: 0 0 .5rem;
    font-weight: 500;
}
.mah-buscador-empty p {
    color: #888;
    margin: 0 0 1.5rem;
}
.mah-buscador-empty-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.mah-buscador-empty .mah-btn {
    display: inline-block;
    padding: .8rem 1.5rem;
    background: #F57921;
    color: white !important;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
}
.mah-buscador-empty .mah-btn:hover { background: #D86813; }
.mah-buscador-empty .mah-btn-ghost {
    display: inline-block;
    padding: .8rem 1.5rem;
    background: transparent;
    color: #1B3A2F !important;
    border: 2px solid #1B3A2F;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none !important;
}
.mah-buscador-empty .mah-btn-ghost:hover {
    background: #1B3A2F;
    color: white !important;
}

/* ============================================
 * GALERÍA EN SINGLE-PERDIDA
 * ============================================ */
.mah-galeria-extra {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.mah-galeria-extra h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: #1B3A2F;
    margin: 0 0 1rem;
}
.mah-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .8rem;
}
.mah-galeria-item {
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    transition: transform .25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.mah-galeria-item:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.mah-galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
 * MOBILE
 * ============================================ */
@media (max-width: 900px) {
    .mah-buscador-bar {
        grid-template-columns: 1fr 1fr;
    }
    .mah-buscador-search { grid-column: 1 / -1; }
    .mah-buscador-btn { grid-column: 1 / -1; }
    .mah-buscador-clear { grid-column: 1 / -1; width: 100%; }

    .mah-buscador-filtros {
        position: relative;
        top: auto;
    }
}
@media (max-width: 600px) {
    .mah-buscador-grid {
        grid-template-columns: 1fr;
    }
    .mah-buscador-tabs {
        gap: .3rem;
    }
    .mah-buscador-tab {
        padding: .45rem .8rem;
        font-size: .82rem;
    }
    .mah-buscador-cta {
        margin-left: 0;
        margin-top: .5rem;
        flex-basis: 100%;
        text-align: center;
    }
    .mah-buscador-bar {
        grid-template-columns: 1fr;
    }
    .mah-buscador-filtros {
        padding: 1rem;
    }
}
