/* limonar-anuncios v2.1 — mobile-first */

/* ============================================================
   VARIABLES Y BASE
   ============================================================ */
.limonar-an-wrap,
.limonar-an-home-wrap { max-width: 100%; box-sizing: border-box; }

/* ============================================================
   TICKER HORIZONTAL
   ============================================================ */
.limonar-an-ticker-wrap {
    display: flex;
    align-items: stretch;
    background: var(--lu-color, #207daf);
    color: #fff;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 18px;
    min-height: 48px; /* tap target generoso en móvil */
}
.limonar-an-ticker-label {
    flex-shrink: 0;
    padding: 0 14px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    gap: 5px;
}
.limonar-an-ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}
/* Gradiente de fade en los bordes */
.limonar-an-ticker-viewport::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 100%;
    background: linear-gradient(to right, transparent, var(--lu-color, #207daf));
    pointer-events: none;
}
.limonar-an-ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    /* --limonar-an-ticker-dur se inyecta inline desde PHP */
    animation: limonar-an-scroll var(--limonar-an-ticker-dur, 40s) linear infinite;
    will-change: transform;
    padding: 8px 0;
}
@keyframes limonar-an-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
/* Pausa al hover (solo en dispositivos con puntero fino) */
@media (hover: hover) and (pointer: fine) {
    .limonar-an-ticker-wrap:hover .limonar-an-ticker-track {
        animation-play-state: paused;
    }
}
.limonar-an-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px 0 0;
    font-size: 0.875rem;
    text-decoration: none;
    color: #fff;
    min-height: 44px; /* touch target iOS */
    touch-action: manipulation;
}
.limonar-an-ticker-item:hover,
.limonar-an-ticker-item:focus { color: rgba(255,255,255,.85); outline: none; }
.limonar-an-ticker-titulo { font-weight: 500; }
.limonar-an-ticker-loc { opacity: .75; font-size: 0.82rem; }
.limonar-an-ticker-sep {
    padding-right: 20px;
    opacity: .35;
    font-size: 0.6rem;
    flex-shrink: 0;
}

/* ============================================================
   TIRA HOME (cabecera + grid)
   ============================================================ */
.limonar-an-home-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.limonar-an-home-titulo {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lu-text, #27272a);
}
.limonar-an-home-ver-todos {
    font-size: 0.9rem;
    color: var(--lu-color, #207daf);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
}
.limonar-an-home-ver-todos:hover { text-decoration: underline; }
.limonar-an-home-grid {
    display: grid;
    /* 2 col en móvil pequeño, 3-4 col en escritorio */
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 640px) {
    .limonar-an-home-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* ============================================================
   GRID PÁGINA /anuncios/
   ============================================================ */
.limonar-an-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.limonar-an-total { margin: 0; color: var(--lu-muted, #6b7280); font-size: 0.875rem; }

.limonar-an-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
@media (min-width: 480px) {
    .limonar-an-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .limonar-an-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
}

/* ============================================================
   TARJETA (usada en grid, home y búsqueda)
   ============================================================ */
.limonar-an-card {
    background: #fff;
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
@media (hover: hover) {
    .limonar-an-card:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,.10);
        transform: translateY(-2px);
    }
}
/* Imagen / placeholder */
.limonar-an-card__img-wrap {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (hover: hover) {
    .limonar-an-card:hover .limonar-an-card__img { transform: scale(1.03); transition: transform .25s; }
}
.limonar-an-card__img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}
.limonar-an-card__tipo-icon { font-size: 2.2rem; opacity: .5; }

.limonar-an-card__img-placeholder--venta      { background: #eff6ff; }
.limonar-an-card__img-placeholder--compra     { background: #f5f3ff; }
.limonar-an-card__img-placeholder--alquiler   { background: #fffbeb; }
.limonar-an-card__img-placeholder--perdido    { background: #fff1f2; }
.limonar-an-card__img-placeholder--encontrado { background: #f0fdf4; }
.limonar-an-card__img-placeholder--regalo     { background: #fdf2f8; }
.limonar-an-card__img-placeholder--servicio   { background: #f0f9ff; }
.limonar-an-card__img-placeholder--otro       { background: #f9fafb; }

/* Cuerpo */
.limonar-an-card__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}
.limonar-an-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}
.limonar-an-card__urgente {
    font-size: 0.7rem;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 100px;
}
.limonar-an-card__titulo {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
}
.limonar-an-card__titulo a {
    color: var(--lu-text, #27272a);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-card__titulo a:hover { color: var(--lu-color, #207daf); }

.limonar-an-card__desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--lu-muted, #6b7280);
    line-height: 1.5;
    flex: 1;
}
.limonar-an-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}
.limonar-an-card__foot-left {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0; /* evita overflow en flex */
}
.limonar-an-card__ver {
    font-size: 0.85rem;
    color: var(--lu-color, #207daf);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-fecha { font-size: 0.78rem; color: var(--lu-muted, #6b7280); }
.limonar-an-localidad-badge { font-size: 0.8rem; color: var(--lu-muted, #6b7280); }

/* ============================================================
   BADGES DE TIPO
   ============================================================ */
.limonar-an-tipo {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    line-height: 1.4;
}
.limonar-an-tipo--venta      { background: #dbeafe; color: #1d4ed8; }
.limonar-an-tipo--compra     { background: #ede9fe; color: #7c3aed; }
.limonar-an-tipo--alquiler   { background: #fef3c7; color: #b45309; }
.limonar-an-tipo--perdido    { background: #fee2e2; color: #b91c1c; }
.limonar-an-tipo--encontrado { background: #d1fae5; color: #065f46; }
.limonar-an-tipo--regalo     { background: #fce7f3; color: #9d174d; }
.limonar-an-tipo--servicio   { background: #e0f2fe; color: #0369a1; }
.limonar-an-tipo--otro       { background: #f4f4f5; color: #52525b; }

/* Versión blanca para el ticker */
.limonar-an-ticker-item .limonar-an-tipo {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
}

/* ============================================================
   BADGE DE ESTADO
   ============================================================ */
.limonar-an-estado {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    text-transform: uppercase;
}
.limonar-an-estado--mostrada  { background: #d1fae5; color: #065f46; }
.limonar-an-estado--ocultada  { background: #f4f4f5; color: #71717a; }
.limonar-an-estado--expirada  { background: #fee2e2; color: #b91c1c; }

/* ============================================================
   FILTROS
   ============================================================ */
.limonar-an-filtros {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 6px;
}
.limonar-an-filtros select {
    padding: 8px 10px;
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 4px;
    font-size: 1rem; /* ≥16px → evita zoom automático en iOS */
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    flex: 1 1 140px;
    max-width: 100%;
    min-height: 44px;
    touch-action: manipulation;
}
.limonar-an-limpiar {
    font-size: 0.875rem;
    color: var(--lu-muted, #6b7280);
    text-decoration: none;
    padding: 10px 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
}
.limonar-an-limpiar:hover { color: #b91c1c; }

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.limonar-an-pag {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}
.limonar-an-pag__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--lu-text, #27272a);
    text-decoration: none;
    background: #fff;
    transition: background .12s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-pag__item:hover { background: #f3f4f6; }
.limonar-an-pag__item--activo {
    background: var(--lu-color, #207daf);
    color: #fff !important;
    border-color: var(--lu-color, #207daf);
}

/* ============================================================
   VACÍO
   ============================================================ */
.limonar-an-vacio {
    text-align: center;
    color: var(--lu-muted, #6b7280);
    padding: 48px 20px;
    border: 2px dashed var(--lu-border, #d1d5db);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

/* ============================================================
   MIS ANUNCIOS – lista
   ============================================================ */
.limonar-an-mis-cabecera {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.limonar-an-mis-lista { display: flex; flex-direction: column; gap: 12px; }
.limonar-an-mis-item {
    background: #fff;
    border: 1px solid var(--lu-border, #d1d5db);
    border-left: 4px solid var(--lu-color, #207daf);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}
@media (hover: hover) {
    .limonar-an-mis-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
}
.limonar-an-mis-item--ocultada { border-left-color: #9ca3af; background: #fafafa; }
.limonar-an-mis-item--expirada { border-left-color: #f87171; background: #fff9f9; }
.limonar-an-mis-item__info {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.limonar-an-mis-item__badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.limonar-an-mis-item__titulo { margin: 2px 0 0; font-size: 0.975rem; }
.limonar-an-mis-item__titulo a {
    color: var(--lu-text, #27272a);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-mis-item__titulo a:hover { color: var(--lu-color, #207daf); }
.limonar-an-mis-item__meta { margin: 0; font-size: 0.82rem; color: var(--lu-muted, #6b7280); }
.limonar-an-mis-item__acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}
.limonar-an-btn-eliminar {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fff !important;
}
.limonar-an-btn-eliminar:hover,
.limonar-an-btn-eliminar:focus {
    background: #b91c1c !important;
    color: #fff !important;
    border-color: #b91c1c !important;
}

/* ============================================================
   FORMULARIO NUEVO / EDITAR
   ============================================================ */
.limonar-an-form-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}
.limonar-an-volver {
    font-size: 0.875rem;
    color: var(--lu-muted, #6b7280);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
}
.limonar-an-volver:hover { color: var(--lu-color, #207daf); }

.limonar-an-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.limonar-usr-campo--sm { flex: 0 0 200px; min-width: 160px; }
.limonar-usr-campo--lg { flex: 1 1 240px; }
.limonar-an-cancelar {
    font-size: 0.875rem;
    color: var(--lu-muted, #6b7280);
    text-decoration: none;
    margin-left: 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
}
.limonar-an-cancelar:hover { color: #b91c1c; }
.limonar-an-requerido { color: #b91c1c; }

/* ============================================================
   EDITOR ENRIQUECIDO
   ============================================================ */
.limonar-an-editor-wrap {
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}
.limonar-an-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #f9fafb;
    border-bottom: 1px solid var(--lu-border, #d1d5db);
    flex-wrap: wrap;
}
.limonar-an-tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;  /* touch target */
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--lu-text, #27272a);
    transition: background .1s;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.limonar-an-tb-btn:hover { background: #e5e7eb; }
.limonar-an-tb-btn--activo { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.limonar-an-tb-foto { padding: 0 12px; gap: 5px; font-size: 0.85rem; }
.limonar-an-tb-sep { width: 1px; height: 22px; background: var(--lu-border, #d1d5db); margin: 0 3px; flex-shrink: 0; }
.limonar-an-tb-status { font-size: 0.8rem; color: var(--lu-muted, #6b7280); margin-left: 6px; }

.limonar-an-editor {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* scroll suave en iOS */
    padding: 14px;
    font-size: 1rem; /* ≥16px → sin zoom en iOS */
    font-family: inherit;
    line-height: 1.65;
    color: var(--lu-text, #27272a);
    background: #fff;
    outline: none;
}
.limonar-an-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.limonar-an-editor img { max-width: 100%; height: auto; border-radius: 4px; margin: 4px 0; display: block; }
.limonar-an-editor ul, .limonar-an-editor ol { margin: 4px 0 4px 20px; }

/* ============================================================
   IMÁGENES EN EL CONTENIDO DEL ANUNCIO
   ============================================================ */
.limonar-an-img-content { max-width: 100%; height: auto; border-radius: 4px; display: block; }

/* ============================================================
   VISTA INDIVIDUAL
   ============================================================ */
.limonar-an-meta-single {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid var(--lu-border, #d1d5db);
}
.limonar-an-expiry-badge { font-size: 0.85rem; color: var(--lu-muted, #6b7280); }
.limonar-an-contacto-single {
    background: #f0f7fb;
    border: 1px solid #c3dff0;
    border-left: 4px solid var(--lu-color, #207daf);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    word-break: break-word;
}
.limonar-an-contacto-oculto {
    background: #f9fafb;
    border-color: var(--lu-border, #d1d5db);
    border-left-color: var(--lu-muted, #6b7280);
    color: var(--lu-muted, #6b7280);
    font-style: italic;
}

/* ============================================================
   SELECTS Y DATE INPUT EN FORMULARIOS
   ============================================================ */
.limonar-usr-campo select,
.limonar-usr-campo input[type="date"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem; /* ≥16px evita zoom iOS */
    font-family: inherit;
    color: var(--lu-text, #27272a);
    background: #fff;
    border: 1px solid var(--lu-border, #d1d5db);
    border-radius: 4px;
    box-sizing: border-box;
    cursor: pointer;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}
.limonar-usr-campo select:focus,
.limonar-usr-campo input[type="date"]:focus {
    outline: none;
    border-color: var(--lu-color, #207daf);
    box-shadow: 0 0 0 3px rgba(32,125,175,.15);
}

/* ============================================================
   RESPONSIVE ADICIONAL
   ============================================================ */
@media (max-width: 480px) {
    /* Home grid: 1 col en teléfonos muy pequeños */
    .limonar-an-home-grid { grid-template-columns: 1fr; }

    /* Ticker más compacto */
    .limonar-an-ticker-label { padding: 0 10px; font-size: 0.65rem; }
    .limonar-an-ticker-item  { font-size: 0.82rem; padding-right: 16px; }

    /* Mis anuncios: acciones en columna */
    .limonar-an-mis-item { flex-direction: column; }
    .limonar-an-mis-item__acciones { width: 100%; }

    /* Formulario: columna única */
    .limonar-an-form-row { flex-direction: column; }
    .limonar-usr-campo--sm,
    .limonar-usr-campo--lg { flex: 1 1 100%; }

    .limonar-an-mis-cabecera { flex-direction: column; align-items: flex-start; }
}
