/* ==========================================================================
   Mercedes de Torres — Paisajismo Palma de Mallorca
   Hoja de Estilos Unificada
   ========================================================================== */

:root {
    --primary: #2d5a3d;
    --primary-dark: #1e3b28;
    --accent: #4a7c59;
    --accent-earth: #8a6b3d;
    --bg: #faf8f5;
    --border-color: #e5dfd5;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: #2b332b;
}

a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1ede6; }
::-webkit-scrollbar-thumb { background: #cbd5c8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ================== HEADER ================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
}
.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-link { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(45,90,61,0.25);
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}
.brand-subtitle {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #708471;
    margin-top: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-short { display: none; }
.nav-full { display: inline; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(45,90,61,0.25); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--accent); border: 1px solid #cfc4b0; }
.btn-outline:hover { background: #f5efe4; }
.btn-ghost { background: #eae4d8; color: var(--primary-dark); }
.btn-ghost:hover { background: #d5cbb6; }
.btn-secondary { background: #f4efe6; color: #4d5c4f; }
.btn-secondary:hover { background: #eae3d5; }

.btn-back {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.btn-back:hover { background: #f5efe4; color: var(--primary-dark); }

.btn-share-active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.25);
}
.btn-share-active:hover { background: #3d6749; }

.btn-share-inactive {
    background: #d4a574;
    color: #2b332b;
    box-shadow: 0 3px 8px rgba(212, 165, 116, 0.25);
}
.btn-share-inactive:hover { background: #c49360; }

/* ================== TOAST ================== */
.mdt-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f7a4c;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 8px;
}
.mdt-toast.show { display: flex; animation: toastIn 0.25s ease; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================== MAIN LAYOUT ================== */
.site-main { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 70px); }

/* ================== MAPA Y BARRA DE BUSQUEDA ================== */
.map-filters-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.map-filters-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    pointer-events: auto;
}
.map-filters-row { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start;
    gap: 12px; 
    flex-wrap: nowrap; 
}
.map-search-input-wrapper { 
    position: relative; 
    flex: 1; 
    min-width: 220px; 
}
.map-search-input-wrapper input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    font-size: 13px;
    border: 1px solid #e0d8cb;
    border-radius: 12px;
    background: var(--bg);
    outline: none;
    font-family: inherit;
}
.map-search-input-wrapper input:focus { border-color: var(--primary); }
.map-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #999; font-size: 13px; }

.status-pills { 
    display: inline-flex; 
    background: #f0eade; 
    padding: 3px; 
    border-radius: 12px; 
    flex-shrink: 0;
}
.status-pill {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: #6b6355;
    cursor: pointer;
    white-space: nowrap;
}
.status-pill.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.status-pill.active.finalizado { color: #137333; }
.status-pill.active.en_curso { color: #b06000; }

.category-pills { 
    display: flex; 
    gap: 6px; 
    overflow-x: auto; 
    width: 100%;
    justify-content: flex-start;
}
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 11px;
    background: #f4efe6;
    color: #4d5c4f;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.category-pill.active { background: var(--primary); color: #fff; }
.category-select-mobile {
    display: none;
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid #e2d9ca;
    background: var(--bg);
    font-family: var(--font-sans);
    font-size: 13px;
    color: #2b332b;
}

.map-container-full {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    background: #e9e3d7;
}
.map-view-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - var(--header-h, 70px));
    height: calc(100dvh - var(--header-h, 70px));
    min-height: 450px;
}
.leaflet-container { width: 100% !important; height: 100% !important; background: #e9e3d7 !important; }
.leaflet-popup-content-wrapper {
    border-radius: 16px;
    padding: 4px;
    box-shadow: 0 10px 25px -5px rgba(45, 90, 61, 0.15);
    border: 1px solid #e5dfd5;
}
.custom-marker { display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.custom-marker:hover { transform: scale(1.15); }

.map-summary-pill {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.map-summary-inner {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
    animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ================== PANEL DE ADMINISTRACION ================== */
.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 60px 16px;
}
.admin-hero {
    background: #ffffff;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.admin-hero-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #708471;
    display: block;
}
.admin-hero-title {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 4px 0 0 0;
    line-height: 1.1;
}
.admin-hero-subtitle {
    font-size: 13px;
    color: #708471;
    margin-top: 4px;
}
.admin-search-bar {
    background: #ffffff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.admin-search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 380px;
}
.admin-search-input-wrapper input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    font-size: 13px;
    border: 1px solid #ded5c6;
    border-radius: 10px;
    background: #faf8f5;
    outline: none;
    font-family: inherit;
}
.admin-search-input-wrapper input:focus {
    border-color: var(--primary);
    background: #ffffff;
}
.admin-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}
.admin-total-count {
    font-size: 13px;
    color: #666;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.admin-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 90, 61, 0.08);
}
.admin-card-body {
    padding: 24px;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.admin-card-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 6px 0;
    line-height: 1.25;
}
.admin-card-client {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-earth);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.admin-card-address {
    font-size: 12px;
    color: #777;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.admin-card-desc {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    background: #faf8f5;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ede7dc;
    margin: 10px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}
.category-jardin { background: rgba(45, 90, 61, 0.12); color: #2d5a3d; }
.category-terraza { background: rgba(194, 123, 56, 0.12); color: #c27b38; }
.category-piscina { background: rgba(37, 117, 157, 0.12); color: #25759d; }
.category-otro { background: rgba(74, 124, 89, 0.12); color: #4a7c59; }

.status-badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
}
.status-finalizado { background: #eaf5ec; color: #1a6b32; border: 1px solid #c8e6ce; }
.status-en_curso { background: #fef7e0; color: #b06000; border: 1px solid #fde293; }

.photo-badge-wrapper { margin-bottom: 8px; }
.photo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}
.photo-badge-success {
    background: #eaf5ec;
    color: #1a6b32;
    border: 1px solid #c8e6ce;
}
.photo-badge-empty {
    background: #f4efe6;
    color: #7d7568;
    border: 1px solid #e2d9ca;
}

.admin-card-footer {
    background: #fbf9f5;
    border-top: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-card-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.share-active-text { color: #1a6b32; font-weight: 600; }
.share-inactive-text { color: #888; font-weight: 500; }

.btn-copy-link {
    background: var(--accent);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
}
.btn-copy-link:hover { background: #3d6749; }

.admin-card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #ede7dc;
}
.link-view {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.link-view:hover { text-decoration: underline; }

.action-icons { display: flex; gap: 8px; }
.icon-btn {
    padding: 6px 10px;
    border-radius: 8px;
    background: #f4efe6;
    color: #4d5c4f;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.icon-btn:hover { background: #eae3d5; }
.icon-btn-danger:hover { background: #fce8e6; color: #c5221f; }

.no-results {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
}
.alert-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #fad2cf;
}

/* ================== FICHA DE DETALLE (proyecto.php) ================== */
.detail-page {
    padding: 32px 16px 64px 16px;
    background: var(--bg);
}
.container {
    max-width: 1100px;
    margin: 0 auto;
}
.detail-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.detail-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 25px rgba(45, 90, 61, 0.05);
    overflow: hidden;
}
.detail-header {
    padding: 36px 40px 28px 40px;
    border-bottom: 1px solid #f0eae0;
    background: linear-gradient(180deg, #fbf9f5 0%, #ffffff 100%);
}
.badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.date-badge {
    background: #f4efe6;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
}
.detail-title {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 10px 0;
    line-height: 1.15;
}
.detail-address {
    font-size: 14px;
    color: #666;
    margin: 0;
}
.detail-client-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #e6decb;
    font-size: 12px;
    color: var(--accent-earth);
}

.detail-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    padding: 36px 40px;
    align-items: stretch;
}
.detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #708471;
    margin: 0 0 8px 0;
}
.description-box {
    background: #fdfcf9;
    border: 1px solid #ede7dc;
    border-radius: var(--radius-md);
    padding: 20px;
    font-size: 14px;
    line-height: 1.65;
    color: #3e473e;
}
.botanical-note {
    background: #f2f7f3;
    border: 1px solid #d2e3d5;
    border-radius: var(--radius-md);
    padding: 20px;
}
.botanical-note h3 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 6px 0;
}
.botanical-note p {
    font-size: 12px;
    line-height: 1.55;
    color: #3a5841;
    margin: 0;
}

.mini-map-wrapper {
    position: relative;
    z-index: 1;
    isolation: isolate;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 320px;
}
.mini-map {
    position: relative;
    z-index: 1;
    width: 100%;
    flex: 1;
    min-height: 280px;
    background: #e9e3d7;
}
.mini-map-coords {
    background: #faf8f5;
    padding: 8px 12px;
    font-size: 11px;
    color: #777;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
}
.mini-map-empty {
    height: 180px;
    background: #f4efe6;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}
.marker-pin {
    background: var(--primary);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid #ffffff;
}

.gallery-section {
    padding: 36px 40px;
    border-top: 1px solid #f0eae0;
    background: rgba(250, 248, 245, 0.5);
}
.gallery-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.gallery-header h2 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}
.gallery-count {
    font-size: 12px;
    color: #777;
    margin: 0;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #eee;
    cursor: pointer;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
.gallery-empty {
    padding: 36px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #dcd5c7;
    border-radius: var(--radius-md);
    color: #888;
    font-size: 13px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.lightbox.active {
    display: flex;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-content p {
    color: #e5dfd5;
    font-size: 13px;
    margin: 0;
    background: rgba(0,0,0,0.5);
    padding: 6px 14px;
    border-radius: 20px;
}

/* ================== PAGINA DE LOGIN (admin/login.php) ================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg);
}
.login-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -15px rgba(45, 90, 61, 0.12), 0 0 1px 1px rgba(0,0,0,0.02);
    max-width: 420px;
    width: 100%;
    padding: 40px 32px;
    text-align: center;
}
.login-icon-box {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    box-shadow: 0 8px 16px rgba(45, 90, 61, 0.2);
}
.login-title {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 4px 0;
}
.login-subtitle {
    font-size: 13px;
    color: #708471;
    margin-bottom: 28px;
}
.login-form-group {
    text-align: left;
    margin-bottom: 18px;
}
.login-form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5a4c;
    margin-bottom: 6px;
}
.login-form-control {
    width: 100%;
    padding: 10px 14px;
    background: #faf8f5;
    border: 1px solid #e2d9ca;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #2b332b;
    box-sizing: border-box;
    transition: all 0.2s;
    outline: none;
}
.login-form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.12);
}
.login-btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
    margin-top: 8px;
}
.login-btn-submit:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(45, 90, 61, 0.25);
}
.login-btn-back {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: #708471;
    text-decoration: none;
    transition: color 0.2s;
}
.login-btn-back:hover {
    color: var(--primary-dark);
}

/* ================== SELECTOR DE MAPA EN FORMULARIOS ADMIN ================== */
.admin-form-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 25px rgba(45, 90, 61, 0.05);
    padding: 32px;
    max-width: 900px;
    margin: 0 auto;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5a4c;
    margin-bottom: 6px;
}
.form-control,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #faf8f5;
    border: 1px solid #e2d9ca;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #2b332b;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}
.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.12);
}
.form-section-box {
    background: #fbf9f5;
    border: 1px solid #ede7dc;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-dark);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-coords-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

/* Selector de mapa interactivo (alta y edicion de proyecto) */
div.admin-map-picker,
div#admin-map-container.admin-map-picker,
#admin-map-container {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 240px !important;
    min-height: 240px !important;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #e9e3d7;
    z-index: 1;
    isolation: isolate;
    margin-top: 8px;
}

.photo-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.photo-edit-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.photo-edit-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(197, 34, 31, 0.9);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.form-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ================== RESPONSIVE ================== */
@media (max-width: 768px) {
    .detail-body {
        grid-template-columns: 1fr;
    }
    .detail-header {
        padding: 24px 20px;
    }
    .detail-title {
        font-size: 30px;
    }
    .gallery-section {
        padding: 24px 20px;
    }
    .admin-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .form-grid-2, .form-coords-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-full { display: none; }
    .nav-short { display: inline; }
    .category-pills { display: none; }
    .category-select-mobile { display: block; }
    .map-filters-card { width: 100%; }
    .map-filters-row { flex-direction: column; align-items: stretch; }
    .status-pills { justify-content: center; }
}

/* ================== ACCESIBILIDAD ================== */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
[hidden] { display: none !important; }

/* ================== RESUMEN DEL MAPA ================== */
.map-clear-btn {
    pointer-events: auto;
    background: none;
    border: 0;
    padding: 0;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* ================== GALERIA Y VISOR ================== */
button.gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    font: inherit;
    text-align: left;
}
.gallery-item:focus-visible .gallery-overlay { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 640px) {
    .brand-subtitle { display: none; }
    .brand-title { font-size: 19px; line-height: 1.1; }
    .site-header-inner { gap: 8px; }
    .brand-link { min-width: 0; }
    .nav-actions .btn { padding: 8px 12px; white-space: nowrap; }
    .leaflet-bottom.leaflet-right { margin-bottom: 64px; }
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
}

/* ================== LISTADO DE PROYECTOS ================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.map-list-link {
    pointer-events: auto;
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}
.project-list {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    box-sizing: border-box;
    scroll-margin-top: 16px;
}
.project-list-title {
    font-family: var(--font-serif);
    font-size: 32px;
    color: var(--primary-dark);
    margin: 0 0 24px;
}
.project-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.project-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.project-card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.project-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eee;
}
.project-card-body { padding: 16px 18px 20px; }
.project-card-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #708471;
}
.project-card h3 {
    font-family: var(--font-serif);
    font-size: 21px;
    line-height: 1.2;
    color: var(--primary-dark);
    margin: 6px 0 6px;
}
.project-card p { font-size: 13px; line-height: 1.5; color: #555; margin: 0 0 8px; }
.project-card-address { color: #777 !important; }

@media (max-width: 640px) {
    .project-list { padding: 32px 16px 48px; }
    .project-list-title { font-size: 26px; }
}

/* La portada crece por debajo del mapa: el cuerpo no puede quedar limitado a la ventana */
body { height: auto; min-height: 100%; }
.map-view-wrapper { flex: none; }
