/* =====================================================
   MAPA DE CEMENTERIOS - ESTILOS MEJORADOS
   ===================================================== */

:root {
    --primary: #0f172a;
    /* Slate 900 */
    --primary-light: #1e293b;
    /* Slate 800 */
    --accent: #f43f5e;
    /* Rose 500 */
    --accent-hover: #e11d48;
    /* Rose 600 */
    --success: #10b981;
    /* Emerald 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --info: #3b82f6;
    /* Blue 500 */

    --bg-body: #f1f5f9;
    /* Slate 100 */
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-main: #0f172a;
    --text-muted: #64748b;
    /* Slate 500 */
    --text-invert: #ffffff;

    --border: #e2e8f0;
    /* Slate 200 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius: 16px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Relief and Depth Tokens */
    --shadow-relief: 0 10px 20px -5px rgba(0, 0, 0, 0.2), 0 5px 10px -5px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --text-relief: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 0, 0, 0.05);
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background: var(--bg-body);
    /* Fallback */
}

/* Background Gradients */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image:
        radial-gradient(at 0% 0%, rgba(244, 63, 94, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
    background-size: cover;
    pointer-events: none;
}



/* ===== HEADER ===== */
header {
    background: rgba(15, 23, 42, 0.8);
    color: white;
    padding: 0.75rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

header:hover {
    background: rgba(15, 23, 42, 0.95);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.3));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.nav-btn.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.nav-btn.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.4);
}

.nav-btn.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.nav-select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-select:hover {
    background-color: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-select option {
    background: #0f172a;
    color: white;
    padding: 10px;
}

.nav-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4);
    background-color: rgba(15, 23, 42, 0.9);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-display {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 99px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    font-weight: 500;
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-search-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-search-input:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--accent);
    width: 240px;
    outline: none;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.2);
}

.nav-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-search {
    padding: 0.6rem 1rem !important;
    font-size: 1.1rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MAIN CONTENT ===== */
main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}



/* ===== CONTROLS SECTION ===== */


/* ===== MAP ===== */
.map-section {
    border-radius: 0 !important;
    overflow: hidden;
    margin-bottom: 0 !important;
    border: none !important;
    position: relative;
    background: var(--bg-body);
    width: 100% !important;
}

#map {
    height: calc(100vh - 70px) !important;
    min-height: 600px;
    width: 100% !important;
    z-index: 10;
}



.map-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.map-section.fullscreen #map {
    height: 100vh !important;
}

#fullscreenBtn {
    transition: var(--transition);
}

#fullscreenBtn .icon {
    font-size: 1.2rem;
    line-height: 1;
}

#fullscreenBtn.active {
    display: none;
    /* Ocultamos el botón derecho en pantalla completa según pedido */
}

#returnNormalBtn {
    display: none;
}

.map-section.fullscreen #returnNormalBtn {
    display: flex;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    align-items: center;
    gap: 0.5rem;
}

.map-section.fullscreen #returnNormalBtn:hover {
    transform: scale(1.05);
    background: var(--bg-body);
}

.map-stats-badge {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 100;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}


#returnNormalBtn .icon {
    font-size: 1.2rem;
    color: var(--accent);
}



/* ===== MARKER TYPES ===== */
.custom-marker-icon.musulman {
    background: rgba(0, 150, 136, 0.9);
    border-color: #00796B;
}

.custom-marker-icon.musulman span {
    color: #E0F2F1;
}

.custom-marker-icon.judio {
    background: rgba(63, 81, 181, 0.9);
    border-color: #283593;
}

.custom-marker-icon.judio span {
    color: #E8EAF6;
}

.custom-marker-icon.civil {
    background: rgba(121, 85, 72, 0.9);
    border-color: #4E342E;
}

.custom-marker-icon.civil span {
    color: #EFEBE9;
}

/* ===== MARKER CLUSTERS & MARKERS ===== */
.marker-cluster-small {
    background-color: rgba(15, 23, 42, 0.4);
}

.marker-cluster-small div {
    background-color: rgba(15, 23, 42, 0.9);
}

.marker-cluster-medium {
    background-color: rgba(244, 63, 94, 0.4);
}

.marker-cluster-medium div {
    background-color: rgba(244, 63, 94, 0.9);
}

.marker-cluster-large {
    background-color: rgba(16, 185, 129, 0.4);
}

.marker-cluster-large div {
    background-color: rgba(16, 185, 129, 0.9);
}

.marker-cluster {
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 40px;
    height: 40px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font: bold 14px 'Inter', sans-serif;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.marker-cluster span {
    line-height: 36px;
}



/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* Slate 900 with opacity */
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.map-section.compact #map {
    height: 50vh !important;
    min-height: 400px !important;
}


.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border);
}

.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--accent);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    margin: -2.5rem -2.5rem 2rem -2.5rem;
    padding: 2rem 2.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    border-bottom: none;
    box-shadow: inset 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: var(--text-relief);
}

.modal-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Text center for confirmation modal */
.text-center {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.highlight-email {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 0.5rem 0;
}

/* ===== NOTICES ===== */
.notice {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1.5rem;
    text-align: center;
}

.notice.warning {
    background: #fff3cd;
    border: 1px solid var(--warning);
    color: #856404;
}

.notice p {
    margin-bottom: 0.75rem;
}

/* ===== FORMS ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

input,
select,
textarea {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-body);
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-footer {
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.form-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #3db893;
}

.btn-full {
    width: 100%;
    padding: 0.8rem;
}

.btn-danger-outline {
    background: transparent !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
}

.btn-danger-outline:hover {
    background: var(--accent) !important;
    color: white !important;
}

.btn-delete-anuncio {
    margin-top: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-delete-anuncio:hover {
    background: #fecaca;
    color: #7f1d1d;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0;
    margin-left: 0.5rem;
}

/* Map Preview */
.map-preview {
    margin: 1rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--success);
}

.map-preview #previewMap {
    height: 200px;
    width: 100%;
}

.preview-info {
    background: #d4edda;
    padding: 0.75rem;
    margin: 0;
    font-size: 0.9rem;
    color: #155724;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== ANUNCIOS GRID ===== */
.anuncios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.anuncio-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.anuncio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.anuncio-card.venta::before {
    background: var(--accent);
}

.anuncio-card.alquiler::before {
    background: var(--primary);
}

.anuncio-card.cesion::before {
    background: var(--success);
}

.anuncio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.anuncio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.anuncio-tipo {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    letter-spacing: 0.5px;
}

.venta .anuncio-tipo {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent);
}

.alquiler .anuncio-tipo {
    background: rgba(15, 23, 42, 0.1);
    color: var(--primary);
}

.cesion .anuncio-tipo {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.anuncio-precio {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.anuncio-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.anuncio-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background: var(--bg-body);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-state::before {
    content: '📭';
    display: block;
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}

/* ===== LEAFLET CUSTOM ===== */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
}

.popup-content {
    text-align: center;
    padding: 0.5rem;
}

.popup-content h3 {
    margin: 0 0 0.25rem 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.popup-content p {
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

.popup-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.popup-btn:hover {
    background: var(--accent);
}

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE & MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
        padding: 1rem;
    }

    .logo {
        justify-content: center;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-btn {
        flex: 1 1 auto;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-width: 100px;
    }

    /* Hero Responsive */
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .hero-section::before {
        top: -20%;
        right: -30%;
        width: 200px;
        height: 200px;
    }

    .hero-content {
        order: 1;
    }

    .hero-content h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-stats {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 2rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
    }

    .search-box {
        width: 100%;
    }

    .filters-group {
        flex-direction: column;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .view-controls {
        justify-content: center;
        width: 100%;
    }

    .view-btn {
        flex: 1;
    }

    .stats {
        width: 100%;
        text-align: center;
    }

    #map {
        height: 55vh;
        min-height: 350px;
    }

    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
        width: 95%;
    }

    /* Ensure forms are comfortable on mobile */
    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.85rem;
    }
}

/* ===== ANIMATIONS & EFFECTS ===== */
html {
    scroll-behavior: smooth;
}

body {
    /* Mesh Gradient Background */
    background-image:
        radial-gradient(at 0% 0%, rgba(244, 63, 94, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Initial Load Animation */
.hero-section {
    animation: fadeScaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.controls-section {
    animation: fadeScaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.map-section {
    animation: fadeScaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hover Scale Effect for Cards */
.cementerio-card,
.anuncio-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.cementerio-card:hover,
.anuncio-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent);
}

/* Pulse Animation for CTA Buttons */
@keyframes pulse-subtle {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(244, 63, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
    }
}

.btn-primary.pulse {
    animation: pulse-subtle 2s infinite;
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

body.dark-mode .glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===== NUEVOS ESTILOS - MEJORAS ===== */

/* Filtros Avanzados */
.filters-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    min-width: 150px;
}

body.dark-mode .filter-select {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.filter-select:hover {
    border-color: var(--accent);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* Botones de Vista */
.view-controls {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

body.dark-mode .view-controls {
    background: var(--bg-dark);
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    opacity: 0.5;
}

.view-btn:hover {
    opacity: 0.8;
    background: rgba(233, 69, 96, 0.1);
}

.view-btn.active {
    opacity: 1;
    background: var(--accent);
}

/* Botón de Agrandar Mapa */
#fullscreenBtn.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#fullscreenBtn.active {
    width: auto !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 99px !important;
}


/* ===== NOTIFICATIONS (TOAST) ===== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    z-index: 10000;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--primary);
    /* Fallback */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.toast-notification.success {
    background: rgba(16, 185, 129, 0.9);
}

.toast-notification.error {
    background: rgba(244, 63, 94, 0.9);
}

.toast-notification.warning {
    background: rgba(245, 158, 11, 0.9);
}

.toast-notification.info {
    background: rgba(15, 23, 42, 0.9);
}

@keyframes slideInToast {
    from {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutToast {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== CUSTOM MARKERS ===== */
.custom-marker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    background: var(--primary);
    /* default */
}

.custom-marker-icon:hover {
    transform: rotate(-45deg) scale(1.1);
    z-index: 1000;
}

.custom-marker-icon.has-ads {
    background: var(--accent);
}

.custom-marker-icon.catedral {
    background: #ff00ff;
    /* Magenta */
}

.custom-marker-icon span {
    transform: rotate(45deg);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== MAP FLOATING FILTERS ===== */
.map-filter-controls {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.7) !important;
    padding: 0.5rem;
    border-radius: 99px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-filter-controls:hover {
    background: rgba(15, 23, 42, 0.8) !important;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.map-section.fullscreen .map-filter-controls {
    top: 30px;
}

.map-filter-btn {
    padding: 0.6rem 1.4rem;
    border: none;
    background: transparent;
    border-radius: 99px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.map-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.map-filter-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.map-filter-btn.active[data-filter="catedral"] {
    background: rgba(255, 0, 255, 0.3);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 0, 255, 0.2);
}

.map-filter-btn.active[data-filter="iglesia"] {
    background: rgba(16, 185, 129, 0.3);
    /* Emerald 500 */
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.map-filter-btn.active[data-filter="cementerio"] {
    background: rgba(15, 23, 42, 0.4);
    color: white;
}

/* ===== POPUP CONTENT REFINED ===== */
.map-popup {
    text-align: center;
    min-width: 220px;
    padding: 0;
}

.popup-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    margin: -15px -20px 15px -20px;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    color: white;
    box-shadow: var(--shadow-relief);
}

.popup-header h3 {
    margin: 5px 0 0 0 !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: white !important;
    text-shadow: var(--text-relief);
    text-transform: uppercase;
}

.map-popup p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Badge in relief */
.popup-badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
    display: inline-block;
    margin-bottom: 5px;
}

.map-popup .popup-btn {
    width: 100%;
    margin-top: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.map-popup .popup-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.list-section {
    margin-bottom: 1.5rem;
}

.cementerios-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.cementerio-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

body.dark-mode .cementerio-card {
    background: var(--bg-dark);
}

.cementerio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.cementerio-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

body.dark-mode .cementerio-card h3 {
    color: var(--text-primary);
}

.cementerio-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.cementerio-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.venta {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
}

.badge.alquiler {
    background: rgba(26, 26, 46, 0.1);
    color: var(--primary);
}

body.dark-mode .badge.alquiler {
    background: rgba(78, 204, 163, 0.2);
    color: var(--success);
}

.badge.cesion {
    background: rgba(78, 204, 163, 0.1);
    color: var(--success);
}

/* Sistema de Notificaciones Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    border-left: 4px solid var(--info);
    min-width: 300px;
}

body.dark-mode .toast {
    background: var(--bg-dark);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--accent);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, #2d2d44 25%, #1a1a2e 50%, #2d2d44 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Mejoras de Accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mejoras en Modales para Dark Mode */
body.dark-mode .modal-content {
    background: var(--bg-dark);
    color: var(--text-primary);
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.85);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--border);
}

body.dark-mode .info-panel {
    background: var(--bg-dark);
}

body.dark-mode .stats {
    background: var(--bg-dark);
    color: var(--text-primary);
}

body.dark-mode #cityFilter {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Visible para mejor accesibilidad */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Animaciones de entrada para elementos */
/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(15, 23, 42, 0.4);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* ===== RESTORED UTILITIES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

@media (max-width: 768px) {
    .toast-container {
        top: 80px;
        right: 1rem;
        left: 1rem;
        max-width: none;
        width: auto;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .cementerios-list {
        grid-template-columns: 1fr;
    }
}

/* ===== TRASH LIST STYLES ===== */
.trash-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.trash-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    transition: var(--transition);
}

.trash-item-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--warning);
}

.trash-item-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.trash-item-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.trash-item-info small {
    display: block;
    margin-top: 0.5rem;
    color: var(--warning);
    font-weight: 500;
}

.trash-item-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-restore {
    flex: 1;
    background: var(--success);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-restore:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-delete-perm {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-delete-perm:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}