
/* ===== CSS RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff9900;
    --primary-hover: #e68800;
    --primary-light: #ffb84d;
    --primary-dark: #cc7700;
    --text: #313131;
    --text-light: #666666;
    --text-muted: #999999;
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --bg-card: #ffffff;
    --border: #e1e5e9;
    --border-soft: #f0f0f0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-lg: 24px;
    --blur: blur(20px);
}

/* ===== BODY & BACKGROUND ===== */
body {
    font-family: 'Poppins', -apple-system, sans-serif;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 50%, #f5f5f5 100%);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== MAP CONTAINER ===== */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
    touch-action: manipulation;
}

/* ===== MOBILE-FIRST FLOATING HEADER COMPATTO ===== */
.command-bar {
    position: fixed;
    top: 60px;
    left: 60px;
    right: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 4px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.8s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.command-btn {
    padding: 8px 4px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 9px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    overflow: hidden;
    min-height: 45px;
    text-align: center;
}

.command-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-radius: 12px;
    z-index: -1;
}

.command-btn:hover::before,
.command-btn:active::before {
    transform: translateY(0);
}

.command-btn:hover,
.command-btn:active {
    color: white;
    transform: scale(0.98);
    box-shadow: var(--shadow);
}

.command-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.command-btn i {
    font-size: 14px;
    margin-bottom: 1px;
}

/* ===== LAYER CARDS COMPATTE PER MOBILE ===== */
.layer-switcher {
    position: fixed;
    top: 100px;
	right: 30px;
	width: 320px;
    /*left: 5px;
     bottom: 5px;*/
    z-index: 1500;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /*  background: rgba(255, 255, 255, 0.10);
    backdrop-filter: var(--blur);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-xl);*/
    overflow-y: auto;
    padding: 12px;
	transform: translateX(350px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-switcher.active {
    transform: translateX(0);
}

.layer-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.layer-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.layer-grid {
    display: grid;
    gap: 8px;
}

.layer-switcher button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 45px;
}

.layer-switcher button:hover,
.layer-switcher button:active {
    border-color: var(--primary-light);
    transform: scale(0.98);
    box-shadow: var(--shadow);
}

.layer-switcher button.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.layer-toggle {
    width: 40px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.layer-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.layer-switcher button.active .layer-toggle {
    background: rgba(255, 255, 255, 0.3);
}

.layer-switcher button.active .layer-toggle::after {
    left: 22px;
}

/* ===== VINCOLI SUBMENU COMPATTO ===== */
.vincoli-container {
    position: relative;
}

.vincoli-submenu {
    display: none;
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 153, 0, 0.05);
    border: 1px solid rgba(255, 153, 0, 0.1);
    border-radius: 8px;
}

.vincoli-container.active .vincoli-submenu {
    display: block;
}

#vincoli-main::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: 6px;
}

.vincoli-container.active #vincoli-main::after {
    transform: rotate(180deg);
}

.vincoli-submenu button {
    margin: 4px 0;
    background: white;
    border-color: var(--border-soft);
    font-size: 11px;
    min-height: 40px;
    padding: 10px 12px;
}

/* ===== MOBILE-OPTIMIZED SEARCH INTERFACE ===== */
.search-tab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	display: none;
}

.search-tab:hover,
.search-tab:active {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.search-tab i {
    font-size: 24px;
    color: white;
}

.pdf-tab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #e67e22 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-tab:hover,
.pdf-tab:active {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.pdf-tab i {
    font-size: 24px;
    color: white;
}

/* ===== FULL-SCREEN MOBILE SEARCH MODAL ===== */
.search-popup {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.1) 0%, rgba(230, 136, 0, 0.5) 100%);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.search-popup.active {
    display: flex;
}

.search-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative; /* Necessario per posizionare il pulsante di chiusura */
}

.search-popup h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-popup p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.6;
}

.search-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.search-popup input {
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    background: var(--bg-soft);
    color: var(--text);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.search-popup input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.1);
    background: white;
}

.search-popup input::placeholder {
    color: var(--text-muted);
}

.search-popup button {
    /*width: 100%;*/
    padding: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.search-popup button:hover,
.search-popup button:active {
    transform: scale(0.98);
    box-shadow: var(--shadow);
}

.search-close {
    position: absolute;
    top: 12px;
    right: 12px; /* Più vicino al bordo destro */
    width: 24px; /* Più piccolo */
    height: 24px; /* Più piccolo */
    border: none;
    background: #ff9900;.00
    border-radius: 50%;
    color: white;
    font-size: 14px; /* Font più piccolo */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover,
.search-close:active {
    background: #ff9900;
    transform: scale(1.1);
}

.search-popup #search-error {
    color: #dc3545;
    margin-top: 16px;
    font-weight: 500;
    font-size: 14px;
}

/* ===== MOBILE-OPTIMIZED SATELLITE OVERLAY ===== */
#satellite-overlay {
    position: fixed;
    bottom: 120px;
    left: 10px;
    right: 10px;
    height: 200px;
    background: var(--bg-card);
    border: 3px solid white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: none;
    box-shadow: var(--shadow-xl);
    z-index: 1500;
}

#satellite-map {
    width: 100%;
    height: 100%;
}

.satellite-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.satellite-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.satellite-btn:hover,
.satellite-btn:active {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* ===== CROSSHAIRS ===== */
.crosshair-main, .crosshair-minimap {
    pointer-events: none;
}

.crosshair-main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    display: none;
    z-index: 1000;
}

.crosshair-main::before, .crosshair-main::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.5);
}

.crosshair-main::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.crosshair-main::after {
    width: 2px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-minimap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

.crosshair-minimap::before, .crosshair-minimap::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, transparent, #e74c3c, transparent);
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
}

.crosshair-minimap::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.crosshair-minimap::after {
    width: 2px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== REVOLUTIONARY BOTTOM DRAWER SIDEPANEL ===== */
#sidepanel {
    position: fixed;
    bottom: -90%;
    left: 0;
    right: 0;
    height: 90%;
    background: linear-gradient(to top, var(--bg-card) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: var(--blur);
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
   /* border-radius: var(--radius-lg) var(--radius-lg) 0 0;*/
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

#sidepanel.active {
    bottom: 0;
	height: 85vh;
    z-index: 10000; /* Z-index elevato quando aperto */
}

#sidepanel-tab {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}
#sidepanel-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: rgba(255, 153, 0, 0.05);
    border-bottom: 2px solid var(--border);
    padding: 0;
    position: sticky; /* Rende i tab fissi */
    top: 0; /* Fissati in cima */
    z-index: 100; /* Sopra il contenuto che scorre */
    backdrop-filter: blur(10px); /* Effetto sfocatura per leggibilità */
}

#sidepanel-tab:hover {
    transform: translateX(-50%) translateY(0px);
    box-shadow: var(--shadow-xl);
}

#sidepanel-tab i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

#sidepanel.active #sidepanel-tab i {
    transform: rotate(180deg);
}

#sidepanel-content {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* ===== BACK TO TOP BUTTON - FIXED ===== */
.back-to-top-btn {
    position: fixed;
    bottom: 50px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px);
}

.back-to-top-btn.show {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.back-to-top-btn i {
    font-size: 18px;
    margin-bottom: 2px;
}

.back-to-top-btn span {
    font-size: 10px;
    line-height: 1;
}

/* Aumenta z-index quando sidepanel è attivo */
#sidepanel.active ~ .back-to-top-btn {
    z-index: 10002;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#sidepanel-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: rgba(255, 153, 0, 0.05);
    border-bottom: 2px solid var(--border);
    padding: 0;
}

#sidepanel-tabs button {
    padding: 20px 8px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

#sidepanel-tabs button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

#sidepanel-tabs button:hover {
    color: var(--primary);
    background: rgba(255, 153, 0, 0.05);
}

#sidepanel-tabs button.active {
    color: var(--primary);
    background: var(--bg-card);
}

#sidepanel-tabs button.active::before {
    width: 80%;
}

.sidepanel-section {
    display: none;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.sidepanel-section.active {
    display: block;
    animation: sectionSlide 0.5s ease;
}

@keyframes sectionSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidepanel-section h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidepanel-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 16px 0;
    color: var(--text);
}

.sidepanel-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 16px;
}

.sidepanel-section a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sidepanel-section a:hover {
    color: var(--primary-hover);
}

.sidepanel-section hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 24px 0;
}

.sidepanel-section ul {
    padding-left: 20px;
    margin: 16px 0;
}

.sidepanel-section li {
    margin: 12px 0;
    color: var(--text-light);
    line-height: 1.6;
}

.sidepanel-section img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== FLOATING LOGO - MOBILE POSITIONED ===== */
.logo {
    position: fixed;
    bottom: 50px;
    left: 10px;
    z-index: 999;
}

.logo img {
    width: 45px;
    height: 45px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.logo:hover img,
.logo:active img {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

/* ===== LOADING SCREEN ===== */
.custom-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 50%, #f0f0f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

.spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
}

.spinner:nth-child(1) {
    border-top: 4px solid var(--primary);
    animation: spin 2s linear infinite;
}

.spinner:nth-child(2) {
    border-right: 4px solid var(--primary-light);
    animation: spin 1.5s linear infinite reverse;
    transform: scale(0.8);
}

.spinner:nth-child(3) {
    border-bottom: 4px solid var(--primary-hover);
    animation: spin 1s linear infinite;
    transform: scale(0.6);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.custom-loader .loader-text {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    padding: 0 20px;
}

.custom-loader h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.loading-progress {
    width: 300px;
    max-width: 80%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 3px;
    animation: loading 4s ease-in-out;
}

@keyframes loading {
    from { width: 0%; }
    to { width: 100%; }
}

/* ===== WAIT POPUP ===== */
.wait-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: var(--blur);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 20px;
}

.wait-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 300px;
    width: 100%;
}

.wait-content p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.wait-content .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* ===== MAPLIBRE ATTRIBUTION ===== */
.maplibregl-ctrl-attrib {
    position: fixed !important;
    top: 50px !important;
    right: 10px !important;
    transform: rotate(270deg) translateY(-50%) !important;
    transform-origin: top right !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
    width: auto !important;
    text-align: center !important;
    z-index: 1000 !important;
    font-size: 11px !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
}

.maplibregl-ctrl-attrib a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact {
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-radius: 4px !important;
    box-sizing: content-box !important;
    margin: 0 !important;
    min-height: auto !important;
    padding: 4px 8px !important;
    position: fixed !important;
}

/* Sostituire la regola esistente con: */
@media (max-width: 768px) {
    .maplibregl-ctrl-top-left {
        left: 10px;
        top: 58px;
        visibility: visible;
        display: block;
        z-index: 999;
    }
    
    .maplibregl-ctrl-top-left .maplibregl-ctrl {
        margin: 3px 0;
    }
    
    .maplibregl-ctrl-zoom-in,
    .maplibregl-ctrl-zoom-out {
        width: 32px;
        height: 32px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(255, 153, 0, 0.2);
    }
    
    .maplibregl-ctrl-zoom-in:hover,
    .maplibregl-ctrl-zoom-out:hover {
        background-color: var(--primary);
        color: white;
    }
	
    .maplibregl-ctrl-attrib {
        top: 60px !important;
        right: 10px !important;
        font-size: 9px !important;
        padding: 5px 10px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
    }
    
    .maplibregl-ctrl-attrib.maplibregl-compact {
        padding: 5px 10px !important;
    }
	
	.layer-switcher { top: 120px; }
}
	
/* ===== DESKTOP RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 769px) {
    .command-bar {
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: auto;
        display: flex;
        grid-template-columns: none;
        max-width: 600px;
    }
    
    .command-btn {
        flex-direction: row;
        min-height: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .command-btn i {
        margin-bottom: 0;
        margin-right: 8px;
    }
    
	    .layer-switcher {
        top: 80px;
        right: 30px;
        left: auto;
        bottom: auto;
        width: 320px;
        max-height: calc(100vh - 120px);
    }
    
    .search-tab {
        left: 20px;
        right: auto;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 70px;
        height: 70px;
    }
    
    .pdf-tab {
        left: 20px;
        right: auto;
        top: calc(50% + 100px);
        bottom: auto;
        transform: translateY(-50%);
        width: 70px;
        height: 70px;
    }
    
    #satellite-overlay {
        bottom: 30px;
        left: 30px;
        right: auto;
        width: 300px;
        height: 300px;
    }
    
    #sidepanel-tabs {
        grid-template-columns: repeat(6, 1fr);
    }
    
    #sidepanel-tabs button {
        flex-direction: column;
        font-size: 13px;
        padding: 20px 8px;
    }
    
    .logo {
        bottom: 30px;
        top: auto;
        left: auto;
        right: 30px;
    }
    
    .logo img {
        width: 60px;
        height: 60px;
    }
}

/* ===== TOUCH-FRIENDLY IMPROVEMENTS ===== */
.command-btn,
.layer-switcher button,
.search-popup button,
.search-close,
.satellite-btn,
.search-tab,
.pdf-tab,
#sidepanel-tab,
#sidepanel-tabs button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
