/* ==========================================================================
   LIST.CSS
   Estilos específicos para el directorio de anuncios (List View)
   ========================================================================== */

/* ── Fuente ── */
.al-wrap * {
    box-sizing: border-box;
}

.al-wrap {
    font-family: 'Nunito', sans-serif;
    background: #f4f2ee;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ══════════════════════════════════════
   HEADER / TOP BAR
══════════════════════════════════════ */
.al-header {
    background: #D59825;
    padding: 15px 10px 1px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(255, 98, 0, .25);
}

/* Línea 1: Título */
.al-header-title {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    text-align: left;
    letter-spacing: .3px;
    margin-bottom: 10px;
}

/* Línea 2: Botones de acción del header.
   Genérico a propósito: sirve tanto para 2 botones (avisos-list-view.php:
   "Nuevo anuncio" + "Ver en mapa") como para 3 (clasificado-list-view.php:
   "Nuevo" + "Mis Clasificados" + "Filtros"). Cada hijo directo (link, botón
   o form) se reparte el espacio en partes iguales gracias a flex:1. */
.al-header-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.al-header-btns>a.al-hbtn,
.al-header-btns>button.al-hbtn,
.al-header-btns>form {
    flex: 1;
    min-width: 0;
}

.al-hbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .35);
    border-radius: 12px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.al-hbtn:active {
    background: rgba(255, 255, 255, .3);
}

.al-hbtn:hover {
    color: #fff;
}

.al-hbtn i {
    font-size: 15px;
    flex-shrink: 0;
}

.al-hbtn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* En mobile, cuando hay 3 botones en la fila (clasificados: Nuevo /
   Mis Clasificados / Filtros) el espacio es más ajustado que con 2
   (avisos: Nuevo anuncio / Ver en mapa). Por eso este ajuste de
   tipografía se aísla con el modificador ".al-header-btns--3" y NO
   afecta el tamaño de los botones de avisos-list-view.php */
@media (max-width: 639px) {
    .al-header-btns--3 .al-hbtn {
        font-size: 12px;
        padding: 0 8px;
        gap: 4px;
    }

    .al-header-btns--3 .al-hbtn i {
        font-size: 14px;
    }
}

/* Línea 3: Ocupa todo el ancho en mobile (select de zona, si está activo) */
.al-linea-zona {
    width: 100%;
    margin-bottom: 8px;
}

/* Línea 4: Grilla horizontal para el input de búsqueda y sus botones
   (usada por avisos-list-view.php) */
.al-linea-busqueda {
    display: grid;
    grid-template-columns: 1fr 36px auto;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.al-fsel {
    flex: 0 0 auto;
    width: 100%;
    height: 36px !important;
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 0 8px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.al-fsel option {
    color: #333;
    background: #fff;
}

.al-finput {
    height: 36px !important;
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 0 10px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    width: 100%;
    min-width: 0;
    max-width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.al-finput::placeholder {
    font-family: 'Nunito', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0.8 !important;
}

.al-fbtn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: 'Nunito', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.al-fbtn.buscar {
    background: #fff;
    color: #ff6200;
}

.al-fbtn.limpiar {
    background: rgba(255, 255, 255, .2);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .35);
}

/* ══════════════════════════════════════
   RESET DE FORMS EN FILTROS
   (Bootstrap Material Design agrega padding/position propios a
   .bmd-form-group; lo neutralizamos dentro de la barra de búsqueda)
══════════════════════════════════════ */
.al-filters .bmd-form-group,
.al-filters .form-group {
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    position: static !important;
}

.al-fgroup {
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    position: static !important;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* ══════════════════════════════════════
   INFO BAR
══════════════════════════════════════ */
.al-infobar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0 0 0;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, .80);
    font-weight: 600;
    background: transparent;
    border-bottom: none;
}

.al-infobar strong {
    color: #fff;
}

/* ══════════════════════════════════════
   CARDS GRID
══════════════════════════════════════ */
.al-grid {
    padding: 10px 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Tarjeta */
.al-card {
    background: #fff;
    border-radius: 14px;
    border: 0.5px solid #e8e4e0;
    overflow: hidden;
    display: flex;
    height: 130px;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s, box-shadow .12s;
}

.al-card:active {
    transform: scale(.98);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

/* Imagen — 40% */
.al-card-img {
    width: 40%;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.al-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.al-card-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Datos — 60% */
.al-card-body {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-width: 0;
}

.al-card-title {
    font-size: 14px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.al-card-desc {
    font-size: 11px;
    margin-top: 3px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.al-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.al-card-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #888;
    line-height: 1.2;
    min-width: 0;
}

.al-card-row i {
    font-size: 11px;
    color: #ff6200;
    flex-shrink: 0;
}

.al-card-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════════════════════
   PAGINADOR
══════════════════════════════════════ */
.al-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 14px 10px 20px;
    flex-wrap: wrap;
}

.al-pbtn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border: 1.5px solid #e0ddd8;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, border-color .12s, transform .1s;
    flex-shrink: 0;
}

.al-pbtn:hover {
    background: #fff8f3;
    border-color: #ff6200;
    color: #ff6200;
}

.al-pbtn:active {
    transform: scale(.93);
}

.al-pbtn.activo {
    background: #ff6200;
    border-color: #ff6200;
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 98, 0, .35);
}

.al-pbtn.disabled {
    opacity: .35;
    pointer-events: none;
}

.al-pbtn.dots {
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 14px;
    cursor: default;
    pointer-events: none;
}

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.al-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #bbb;
}

.al-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.al-empty p {
    font-size: 14px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   RESPONSIVE DESKTOP (Unificado)
══════════════════════════════════════ */
@media (min-width: 640px) {

    /* Toprow y header (usado por avisos-list-view.php para poner los
       botones y la barra de búsqueda uno al lado del otro) */
    .al-toprow-desktop {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }

    .al-header-btns {
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .al-header-btns--3>a.al-hbtn,
    .al-header-btns--3>button.al-hbtn,
    .al-header-btns--3>form {
        flex: 0 0 auto;
        width: 33%;
        min-width: 150px;
    }

    .al-filters-flex {
        flex: 1;
        min-width: 0;
    }

    .al-linea-busqueda {
        max-width: 480px;
    }

    .al-header {
        padding: 14px 20px 6px;
        top: 50px;
    }

    /* Grilla, layout e infobar */
    .al-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px;
        max-width: 900px;
        margin: 0 auto;
    }

    .al-pager {
        max-width: 900px;
        margin: 0 auto;
    }

    .al-infobar {
        max-width: 900px;
        margin: 10px auto 0;
        padding: 4px 20px 0;
    }

    .al-wrap {
        padding-top: 50px;
    }
}



/* ══════════════════════════════════════
   MODAL DE FILTROS AVANZADOS (#ModalFiltrosAvanzados)
   Bootstrap trae sus estilos default (bg-primary azul, tipografía
   del sistema, etc.), acá los pisamos con la identidad de NUZO:
   header dorado/marca, acento naranja, tipografía Nunito.
   Todo escopeado a #ModalFiltrosAvanzados para no afectar otros
   modales del sitio (ej: #ModalRegistrado).
══════════════════════════════════════ */
#ModalFiltrosAvanzados .modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

/* Bootstrap centra el modal verticalmente con .modal-dialog-centered
   (display:flex; align-items:center). Lo alineamos arriba en cambio,
   con un margen fijo desde el borde superior. */
#ModalFiltrosAvanzados .modal-dialog.modal-dialog-centered {
    align-items: flex-start;
    padding-top: 50px;
}

#ModalFiltrosAvanzados .modal-header {
    background: #D59825 !important;
    border-bottom: none;
    padding: 18px 20px 16px;
}

#ModalFiltrosAvanzados .modal-title {
    font-family: 'Nunito', sans-serif;
    font-size: 17px;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

#ModalFiltrosAvanzados .modal-title i {
    font-size: 15px;
}

#ModalFiltrosAvanzados .close {
    color: #fff;
    opacity: .85;
    text-shadow: none;
    font-weight: 400;
    font-size: 26px;
    line-height: 1;
    transition: opacity .15s;
}

#ModalFiltrosAvanzados .close:hover {
    color: #fff;
    opacity: 1;
}

#ModalFiltrosAvanzados .modal-body {
    padding: 20px;
    background: #fff;
}

/* Neutraliza el padding/position que agrega Bootstrap Material
   Design a .form-group, igual que se hace en forms.css (.fm-field) */
#ModalFiltrosAvanzados .form-group,
#ModalFiltrosAvanzados .bmd-form-group {
    padding-top: 0 !important;
    margin-bottom: 16px !important;
    position: static !important;
}

#ModalFiltrosAvanzados label {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    width: auto !important;
    max-width: none !important;
    white-space: normal !important;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

#ModalFiltrosAvanzados .form-control {
    font-family: 'Nunito', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    border: 1.5px solid #e8e4e0 !important;
    border-radius: 10px !important;
    background: #fafafa !important;
    padding: 9px 12px !important;
    height: 42px !important;
    box-shadow: none !important;
    transition: border-color .15s, background .15s;
}

#ModalFiltrosAvanzados .form-control:focus {
    border-color: #ff6200 !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 98, 0, .12) !important;
}

#ModalFiltrosAvanzados .form-control::placeholder {
    color: #c0bdb8 !important;
    font-weight: 400 !important;
}

#ModalFiltrosAvanzados select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px !important;
}

#ModalFiltrosAvanzados .modal-footer {
    border-top: 1px solid #ede9e4;
    padding: 14px 20px 18px;
    background: #fff;
}

#ModalFiltrosAvanzados .modal-footer .btn {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 800;
    border-radius: 14px;
    padding: 10px 18px;
    border: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s, transform .1s, background .15s;
}

#ModalFiltrosAvanzados .modal-footer .btn:active {
    transform: scale(.97);
}

#ModalFiltrosAvanzados .modal-footer .btn-danger {
    background: #f4f4f0;
    color: #777;
    border: 1.5px solid #e0ddd8;
}

#ModalFiltrosAvanzados .modal-footer .btn-danger:hover {
    background: #ece9e4;
    color: #555;
}

#ModalFiltrosAvanzados .modal-footer .btn-primary {
    background: #D59825;
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 98, 0, .3);
}

#ModalFiltrosAvanzados .modal-footer .btn-primary:hover {
    background: #c28a1f;
}