:root {
    /* Brand Colors */
    --primary: #ec4899; /* Vibrant Pink/Rose */
    --primary-light: #fbcfe8;
    --primary-dark: #be185d;
    
    --secondary: #10b981; /* Emerald Green */
    --accent: #f59e0b; /* Festive Gold */
    --accent-blue: #3b82f6; /* Direction Blue */
    --accent-purple: #8b5cf6; /* Special Purple */
    
    /* UI Colors */
    --bg-color: #f8fafc;
    --surface: rgba(255, 255, 255, 0.85); /* Glassmorphism base */
    --surface-solid: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    
    /* Layout */
    --header-height: 140px;
    --bottom-sheet-height: 280px;
    --border-radius: 20px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-color);
    overflow: hidden; /* Prevent scrolling, map handles it */
    height: 100vh;
    width: 100vw;
}

h1, h2, h3, h4, .outfit {
    font-family: var(--font-heading);
}

/* =========================================
   HEADER & NAVIGATION
========================================= */
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 1rem 1rem 1rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 70%, rgba(255,255,255,0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none; /* Let map clicks through where no elements exist */
}

.header-content {
    pointer-events: auto;
    margin-bottom: 1rem;
}

.app-logo {
    height: 60px; /* Adjust based on image aspect ratio */
    width: auto;
    display: block;
    margin-bottom: 4px;
}

.logo-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary-dark);
    line-height: 1.1;
}

.logo-title span {
    color: var(--accent);
    font-weight: 800;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Filters Scroll */
.filter-scroll {
    pointer-events: auto;
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}
.filter-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.filter-pill i {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}



.filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
    transform: translateY(-2px);
}

.filter-pill.active i {
    color: white;
}

/* Filter icon colors */
.filter-pill[data-category="all"] i,
.filter-pill[data-category="flower"] i { color: var(--primary); }
.filter-pill[data-category="parking"] i { color: var(--accent-blue); }
.filter-pill[data-category="food"] i { color: var(--accent); }
.filter-pill[data-category="baby"] i { color: var(--accent-purple); }
.filter-pill[data-category="sponsors"] i { color: #f58220; }
.filter-pill[data-category="stage"] i { color: #7c3aed; }
.filter-pill[data-category="business"] i { color: #475569; }

/* Corresponding colors when selected */
.filter-pill[data-category="food"].active { background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.filter-pill[data-category="parking"].active { background: var(--accent-blue); border-color: var(--accent-blue); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }
.filter-pill[data-category="wc"].active { background: var(--secondary); border-color: var(--secondary); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }
.filter-pill[data-category="baby"].active { background: var(--accent-purple); border-color: var(--accent-purple); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4); }
.filter-pill[data-category="sponsors"].active { background: #f58220; border-color: #f58220; box-shadow: 0 4px 12px rgba(245, 130, 32, 0.4); }
.filter-pill[data-category="stage"].active { background: #7c3aed; border-color: #7c3aed; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4); }
.filter-pill[data-category="business"].active { background: #475569; border-color: #475569; box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4); }

.filter-pill[data-category="all"].active i,
.filter-pill[data-category="flower"].active i,
.filter-pill[data-category="parking"].active i,
.filter-pill[data-category="food"].active i,
.filter-pill[data-category="baby"].active i,
.filter-pill[data-category="sponsors"].active i,
.filter-pill[data-category="stage"].active i,
.filter-pill[data-category="business"].active i { color: #ffffff; }
/* =========================================
   MAP
========================================= */
#map {
    height: 100vh;
    width: 100vw;
    z-index: 1; /* Below UI */
    background-color: #e5e5e5;
}

/* Standard map attributions hidden or moved for mobile aesthetic */
.leaflet-control-attribution {
    display: none;
}
.leaflet-control-zoom {
    display: none !important; /* Hide zoom controls for cleaner mobile UI */
}

/* Custom Marker CSS */
.custom-marker {
    background: none;
    border: none;
}

.marker-wrapper {
    position: relative;
    width: 44px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: bottom center;
    transition: transform 0.2s;
    animation: markerPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes markerPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -18px 0 0 -18px;
    box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.marker-icon {
    position: absolute;
    z-index: 2;
    color: white;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
}

.marker-icon-pair {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 1px;
    color: white;
    transform: translate(-50%, -60%);
}
.marker-icon-pair svg {
    width: 13px;
    height: 13px;
}

.marker-text-icon {
    position: absolute; z-index: 2; color: white;
    font-size: 0.72rem; font-weight: 700; line-height: 1;
    top: 50%; left: 50%; transform: translate(-50%, -52%);
}

.marker-wrapper.wc .marker-text-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1 !important;
    filter: none;
    font-family: Arial, sans-serif;
    font-size: 0.84rem;
    font-weight: 650;
    letter-spacing: 0.015em;
    top: 52%;
    transform: translate(-50%, -52%);
    text-shadow: none;
}
/* Marker Variations */
.marker-wrapper.flower .marker-pin { background: var(--primary); }
.marker-wrapper.food .marker-pin { background: var(--accent); }
.marker-wrapper.coffee .marker-pin { background: #ffffff; border-color: #d1d5db; } /* Delta White */
.marker-wrapper.parking .marker-pin { background: var(--accent-blue); }
.marker-wrapper.wc .marker-pin { background: var(--secondary); }
.marker-wrapper.baby .marker-pin { background: var(--accent-purple); }
.marker-wrapper.sponsor .marker-pin { background: #f58220; border-color: #ffffff; }
.marker-wrapper.stage .marker-pin { background: #7c3aed; border-color: #ffffff; }
.marker-wrapper.business .marker-pin { background: #0f766e; border-color: #ffffff; }
.marker-wrapper.commerce .marker-pin { background: #475569; border-color: #ffffff; }
.marker-wrapper.commerce .marker-icon { color: #ffffff; }
.marker-wrapper.emergency .marker-pin { background: #ef4444; border-color: #ffffff; }
.marker-wrapper.emergency .marker-icon { color: #ffffff; }
.marker-wrapper.sweets .marker-pin { background: #fde68a; border-color: #ffffff; }
.marker-wrapper.sweets .marker-icon {
    color: #92400e;
    width: 21px;
    height: 21px;
    top: 52%;
    transform: translate(-50%, -55%);
}
.marker-wrapper.tasquinha .marker-pin { background: #1e3a8a; border-color: #ffffff; }
.marker-wrapper.sagres .marker-pin { background: #da0e1f; border-color: #ffffff; }

.marker-logo {
    position: absolute;
    z-index: 2;
    width: 27px;
    height: 27px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -59%);
    object-fit: contain;
}

.marker-wrapper.sagres .marker-logo {
    width: 24px;
    height: 24px;
    top: 52%;
    transform: translate(-50%, -54%);
}

.marker-custom-icon {
    width: 26px;
    height: 26px;
}

/* Selected marker animation */
.marker-wrapper.selected {
    z-index: 1000 !important;
}
.marker-wrapper.selected .marker-pin {
    transform: rotate(-45deg) scale(1.2);
    box-shadow: -4px 4px 12px rgba(0,0,0,0.4);
}
.marker-wrapper.selected .marker-icon,
.marker-wrapper.selected .marker-logo {
    transform: translate(-50%, -60%) scale(1.2);
}
.marker-wrapper.sweets.selected .marker-icon {
    transform: translate(-50%, -55%) scale(1.2);
}
.marker-wrapper.sagres.selected .marker-logo {
    transform: translate(-50%, -54%) scale(1.2);
}
.marker-wrapper.selected .marker-icon-pair {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 1px;
    color: white;
    transform: translate(-50%, -60%);
}
.marker-icon-pair svg {
    width: 13px;
    height: 13px;
}

.marker-text-icon {
    transform: translate(-50%, -52%) scale(1.2);
}

.marker-wrapper.wc.selected .marker-text-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1 !important;
    transform: translate(-50%, -52%);
}
/* Floating Controls */
.btn-recenter {
    position: absolute;
    right: 1.5rem;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 2rem);
    z-index: 900;
    background: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s, bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-recenter:active {
    transform: scale(0.9);
}

/* Push recenter button up when bottom sheet is active */
body.sheet-open .btn-recenter {
    bottom: calc(var(--bottom-sheet-height) + 1.5rem);
}


/* =========================================
   BOTTOM SHEET
========================================= */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 1rem 1rem 1.25rem 1rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.sheet-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

body.sheet-open .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 0 auto 1.5rem auto;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

#sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sheet-category {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
}

.category-icon-large {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon-large.food { background: #fef3c7; color: #d97706; }
.category-icon-large.coffee { background: #ffffff; color: #78350f; border: 1px solid #e5e7eb; }
.category-icon-large.parking { background: #dbeafe; color: #2563eb; }
.category-icon-large.wc { background: #d1fae5; color: #059669; }
.category-icon-large.baby { background: #ede9fe; color: #7c3aed; }
.category-icon-large.sponsor { background: #fff4e8; color: #f58220; }
.category-icon-large.stage { background: #ede9fe; color: #7c3aed; }
.category-icon-large.business { background: #ccfbf1; color: #0f766e; }
.category-icon-large.commerce { background: #475569; color: #ffffff; }
.category-icon-large.emergency { background: #ef4444; color: #ffffff; }
.category-icon-large.sweets { background: #fde68a; color: #92400e; border: 1px solid #f59e0b; }
.category-icon-large.tasquinha { background: #1e3a8a; color: #ffffff; }
.category-icon-large.sagres { background: #da0e1f; color: #ffffff; }

.sheet-wc-symbol {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1;
}
.sheet-wc-symbol svg {
    width: 18px;
    height: 18px;
}
.sheet-wc-symbol span {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.sheet-icon-pair {
    display: flex;
    align-items: center;
    gap: 2px;
}
.sheet-icon-pair svg {
    width: 19px;
    height: 19px;
}

.sheet-sponsor-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.category-icon-large i {
    width: 24px;
    height: 24px;
}

.sheet-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.85rem;
}

/* Action Buttons */
.sheet-actions {
    display: flex;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    padding: 0.5rem 0;
    margin-bottom: -0.5rem;
    z-index: 10;
}

.btn-primary {
    flex: 1;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary i {
    width: 20px;
    height: 20px;
}

/* Visited Marker Styles */
.marker-wrapper.is-visited .marker-pin {
    background: #94a3b8 !important; /* gray out visited */
    border-color: #f8fafc;
}
.marker-wrapper.is-visited .marker-icon,
.marker-wrapper.is-visited .marker-logo,
.marker-wrapper.is-visited .marker-icon-pair,
.marker-wrapper.is-visited .marker-icon-pair {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 1px;
    color: white;
    transform: translate(-50%, -60%);
}
.marker-icon-pair svg {
    width: 13px;
    height: 13px;
}

.marker-text-icon {
    opacity: 0.5;
}
.marker-visited-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.marker-visited-badge i {
    width: 12px;
    height: 12px;
}

/* Secondary Action Button */
.btn-secondary {
    flex: 1;
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary.is-visited {
    background: #ecfdf5;
    color: #059669;
    border-color: #34d399;
}

/* =========================================
   NAVIGATION OVERLAY
========================================= */
.nav-overlay {
    position: absolute;
    top: calc(var(--header-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-solid);
    border-radius: 999px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: auto;
    border: 2px solid var(--accent-blue);
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 0.95rem;
}

.nav-spinner {
    animation: spinNav 2s linear infinite;
}
@keyframes spinNav {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-stop {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-stop i {
    width: 14px;
    height: 14px;
}

/* Hide default routing text instructions */
.leaflet-routing-container {
    display: none !important;
}

/* Custom route line style overriding leaflet default */
/* To override SVG paths we must use JS options */

/* =========================================
   CAMERA & GALLERY
========================================= */
.sheet-camera-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.btn-camera {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f1f5f9;
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-camera:active {
    background: #e2e8f0;
    transform: scale(0.97);
}

.btn-camera i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.sheet-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
    transition: transform 0.2s;
    border: 2px solid white;
}

.gallery-thumb:active {
    transform: scale(0.92);
}

/* Fullscreen Modal */
.photo-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.photo-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.photo-modal img {
    max-width: 95%;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}

.photo-modal-close {
    position: absolute;
    top: env(safe-area-inset-top, 20px);
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.marker-wrapper.wc.is-visited .marker-text-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1 !important;
}

.marker-wrapper.parking .marker-text-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1 !important;
    filter: none;
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    top: 51%;
    transform: translate(-50%, -52%);
    text-shadow: none;
}

.marker-wrapper.parking.selected .marker-text-icon,
.marker-wrapper.parking.is-visited .marker-text-icon {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1 !important;
    transform: translate(-50%, -52%);
}

/* Entradas */
.filter-pill[data-category="entrance"] i { color: #0891b2; }
.filter-pill[data-category="entrance"].active {
    background: #0891b2;
    border-color: #0891b2;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
}
.filter-pill[data-category="entrance"].active i { color: #ffffff; }
.marker-wrapper.entrance .marker-pin { background: #0891b2; border-color: #ffffff; }
.marker-wrapper.entrance .marker-icon { color: #ffffff; }
.category-icon-large.entrance { background: #cffafe; color: #0891b2; }

/* A visitar para além das flores */
.filter-pill[data-category="visit"] i { color: #9333ea; }
.filter-pill[data-category="visit"].active {
    background: #9333ea;
    border-color: #9333ea;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
}
.filter-pill[data-category="visit"].active i { color: #ffffff; }
.marker-wrapper.visit .marker-pin { background: #9333ea; border-color: #ffffff; }
.marker-wrapper.visit .marker-icon { color: #ffffff; }
.category-icon-large.visit { background: #f3e8ff; color: #9333ea; }

/* Paladin sponsor marker */
.marker-wrapper.paladin .marker-pin {
    background: #ffffff;
    border-color: #ef233c;
}
.marker-wrapper.paladin .marker-logo {
    width: 21px;
    height: 27px;
    object-fit: contain;
    object-position: center;
    top: 49%;
    transform: translate(-50%, -58%);
    border-radius: 0;
    clip-path: none;
}
.marker-wrapper.paladin.selected .marker-logo {
    transform: translate(-50%, -58%) scale(1.04);
}
.category-icon-large.paladin {
    width: 118px;
    height: 68px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #ef233c;
    border-radius: 16px;
}
.category-icon-large.paladin .sheet-sponsor-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}



/* =========================================
   MOBILE POLISH
========================================= */
@media (max-width: 768px) {
    :root {
        --header-height: 116px;
        --bottom-sheet-height: 360px;
        --border-radius: 18px;
    }

    html,
    body {
        height: 100%;
        height: 100dvh;
        overscroll-behavior: none;
        background: #eef2f7;
    }

    .app-header {
        padding: calc(env(safe-area-inset-top, 0px) + 0.7rem) 0 0.75rem 0;
        background: linear-gradient(to bottom, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.9) 72%, rgba(255,255,255,0) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .header-content {
        margin: 0 0 0.55rem 0;
        padding: 0 0.9rem;
    }

    .app-logo {
        height: 46px;
        margin-bottom: 1px;
    }

    .subtitle {
        font-size: 0.72rem;
        line-height: 1.15;
        letter-spacing: -0.01em;
    }

    .filter-scroll {
        gap: 0.45rem;
        padding: 0.15rem 0.85rem 0.7rem 0.85rem;
        scroll-padding-inline: 0.85rem;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
    }

    .filter-pill {
        min-height: 40px;
        padding: 9px 13px;
        gap: 6px;
        flex: 0 0 auto;
        scroll-snap-align: start;
        font-size: 0.78rem;
        border-radius: 999px;
        background: rgba(255,255,255,0.94);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    }

    .filter-pill i {
        width: 15px;
        height: 15px;
    }

    .filter-pill.active {
        transform: translateY(-1px);
    }

    #map {
        height: 100vh;
        height: 100dvh;
    }

    .leaflet-pane,
    .leaflet-control-container {
        font-family: var(--font-body);
    }

    .marker-wrapper {
        filter: drop-shadow(0 4px 5px rgba(15, 23, 42, 0.22));
    }

    .btn-recenter {
        right: 1rem;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
        width: 46px;
        height: 46px;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.20);
    }

    body.sheet-open .btn-recenter {
        bottom: calc(min(var(--bottom-sheet-height), 52vh) + env(safe-area-inset-bottom, 0px) + 0.8rem);
    }

    .bottom-sheet {
        max-height: min(62vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 24px 24px 0 0;
        padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)) 1rem;
        box-shadow: 0 -18px 45px rgba(15, 23, 42, 0.18);
        transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .sheet-handle {
        width: 36px;
        height: 4px;
        margin-bottom: 1rem;
        background: #cbd5e1;
    }

    .sheet-header {
        gap: 0.85rem;
        align-items: center;
        margin-bottom: 0.65rem;
    }

    .sheet-header > div:first-child {
        min-width: 0;
    }

    #sheet-title {
        font-size: clamp(1.12rem, 5vw, 1.45rem);
        line-height: 1.08;
        letter-spacing: -0.02em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .sheet-category {
        font-size: 0.78rem;
        font-weight: 700;
        margin-top: 0.2rem;
    }

    .category-icon-large {
        width: 50px;
        height: 50px;
        min-width: 50px;
        border-radius: 16px;
    }

    .category-icon-large.paladin {
        width: 86px;
        height: 54px;
        min-width: 86px;
    }

    .sheet-description {
        font-size: 0.9rem;
        line-height: 1.45;
        margin-bottom: 1rem;
    }

    .sheet-actions {
        gap: 0.65rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-camera {
        min-height: 48px;
        border-radius: 15px;
        font-size: 0.95rem;
    }

    .btn-primary {
        padding: 13px 14px;
    }

    .btn-secondary {
        padding: 12px 14px;
    }

    .sheet-camera-section {
        padding-top: 0.85rem;
        margin-top: 0.85rem;
    }

    .sheet-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.45rem;
    }
}

@media (max-width: 430px) {
    :root {
        --header-height: 108px;
        --bottom-sheet-height: 390px;
    }

    .app-logo {
        height: 40px;
    }

    .filter-pill {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.74rem;
    }

    .filter-pill i {
        width: 14px;
        height: 14px;
    }

    .bottom-sheet {
        max-height: 68vh;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .sheet-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .category-icon-large {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }

    .sheet-sponsor-logo {
        max-width: 100%;
        max-height: 100%;
    }
}
/* Navigation overlay refinement */
.nav-overlay {
    max-width: calc(100vw - 2rem);
}

@media (max-width: 768px) {
    .nav-overlay {
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
        transform: none;
        justify-content: space-between;
        border: 1px solid rgba(59, 130, 246, 0.22);
        border-radius: 20px;
        padding: 10px 10px 10px 14px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 14px 35px rgba(15, 23, 42, 0.22);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .nav-info {
        min-width: 0;
        font-size: 0.95rem;
        line-height: 1.15;
        gap: 7px;
    }

    .nav-info span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-stop {
        min-height: 42px;
        padding: 8px 13px;
        border-radius: 16px;
        font-size: 0.9rem;
        flex: 0 0 auto;
    }

    body.sheet-open .nav-overlay {
        bottom: calc(min(var(--bottom-sheet-height), 52vh) + env(safe-area-inset-bottom, 0px) + 0.8rem);
    }
}
/* User location marker and feedback */
.user-location-marker {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-location-heading {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transition: transform 0.1s linear;
}

.user-location-dot {
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 999px;
    background: #2563eb;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}


.btn-recenter.is-loading i,
.btn-recenter.is-loading svg {
    animation: spinNav 1s linear infinite;
}

.map-toast {
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 5.2rem);
    transform: translate(-50%, 12px);
    z-index: 1200;
    max-width: min(360px, calc(100vw - 2rem));
    padding: 11px 15px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-toast.active {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.sheet-open .map-toast {
    bottom: calc(min(var(--bottom-sheet-height), 52vh) + env(safe-area-inset-bottom, 0px) + 1rem);
}
/* Filter category colors before selection */
.filter-pill:not(.active) {
    background: rgba(255, 255, 255, 0.94);
}

.filter-pill[data-category="all"]:not(.active) {
    background: #fdf2f8;
    border-color: #f9a8d4;
    color: #be185d;
}

.filter-pill[data-category="flower"]:not(.active) {
    background: #fdf2f8;
    border-color: #f9a8d4;
    color: #be185d;
}

.filter-pill[data-category="visit"]:not(.active) {
    background: #f3e8ff;
    border-color: #d8b4fe;
    color: #7e22ce;
}

.filter-pill[data-category="entrance"]:not(.active) {
    background: #ecfeff;
    border-color: #67e8f9;
    color: #0e7490;
}

.filter-pill[data-category="parking"]:not(.active) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.filter-pill[data-category="food"]:not(.active) {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
}

.filter-pill[data-category="wc"]:not(.active) {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #059669;
}

.filter-pill[data-category="baby"]:not(.active) {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #7c3aed;
}

.filter-pill[data-category="sponsors"]:not(.active) {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

.filter-pill[data-category="stage"]:not(.active) {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.filter-pill[data-category="business"]:not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.filter-pill:not(.active) i {
    opacity: 1;
}
/* Segurança e Emergência Médica filter */
.filter-pill[data-category="emergency"] i { color: #ef4444; }
.filter-pill[data-category="emergency"].active {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}
.filter-pill[data-category="emergency"].active i { color: #ffffff; }
.filter-pill[data-category="emergency"]:not(.active) {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}
/* Photo upload/gallery robustness */
.gallery-thumb-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: #f1f5f9;
}

.gallery-thumb-wrap .gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-local-badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
}