html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden; /* Prevent unintended scrolling */
}   

body {
    font-family: 'Lab Grotesque', sans-serif;
    margin: 0px;
    background: white;
}

h1, h2, h3, h4, h5, h6, p, span, input, button {
    font-family: inherit;
}

/* Header Container */
#header {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between logo and text */
    margin: 12px; /* Space below the header */
}

/* Logo Styling */
#logo {
    height: 25px; /* Adjust logo height */
    width: auto; /* Maintain aspect ratio */
}

/* Header Text Styling */
#header-text {
    font-size: 20px; /* Adjust font size */
    font-weight: bold; /* Make it stand out */
    color: #333; /* Customize text color */
}

/* HUD Styling */
#hud {
    height: auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    padding: 0px;
    box-sizing: border-box;
}

/* Full-page map minus HUD */
#map {
    height: 87vh;
    width: 100%;
    box-sizing: border-box; /* Ensure padding/borders don't add to the size */
}

#search-container {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin: 10px;
    position: relative;
    flex-wrap: nowrap; /* Prevent wrapping to a new row */
}

#search-box {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
}

#precise-location-button {
    padding: 10px 10px 10px 5px;
    background-color: orange; /* orange background */
    color: white; /* White text */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center; /* Align icon and text vertically */
    gap: 5px; /* Space between icon and text */
    white-space: nowrap; /* Prevent text from wrapping */
    width: auto; /* Prevent the button from expanding to full width */
    flex-shrink: 0; /* Prevent the button from shrinking */
}

#precise-location-button:hover {
    background-color: #F5821E; /* Darker blue on hover */
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 20
}

#autocomplete-results {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    max-height: 250px;
    overflow-y: auto;
    width: 90%; /* Reduce width to 90% of the search bar */
    max-width: 300px; /* Set a maximum width */
    z-index: 1000;
    display: none;
    top: 100%; /* Position dropdown just below the search bar */
    left: 5%; /* Add a slight left margin to align under the search bar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add subtle shadow for visibility */
    border-radius: 4px; /* Rounded corners */
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    overflow-wrap: break-word; /* Prevent long text from breaking layout */
    background: white; /* Ensure consistent background */
}

.autocomplete-item:last-child {
    border-bottom: none; /* Remove border for the last item */
}

.autocomplete-item:hover {
    background: #f0f0f0; /* Highlight the hovered item */
}

#filter-container {
    display: flex;
    flex-wrap: nowrap; /* Prevents wrapping to keep items in one line */
    overflow-x: auto; /* Enables horizontal scrolling if content overflows */
    gap: 10px; /* Adds space between checkboxes */
    padding: 0px 5px 10px 12px; /* Adds some padding for better aesthetics */
    align-items: center; /* Align items vertically */
    white-space: nowrap; /* Prevents labels from wrapping to new lines */
    scrollbar-width: thin; /* Slim scrollbar for modern browsers */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for touch devices */
}

.filter-label {
    font-weight: bold; /* Make the "Filters:" label stand out */
    margin-right: 0px; /* Add space between the label and checkboxes */
    align-items: center; /* Align items vertically */
}

#filter-container label {
    flex-shrink: 0; /* Prevents labels from shrinking to fit the container */
    order: 1;
}

#filter-container::-webkit-scrollbar {
    height: 6px; /* Adjusts scrollbar height */
}

#filter-container::-webkit-scrollbar-thumb {
    background-color: #ccc; /* Thumb color */
    border-radius: 3px; /* Rounded scrollbar edges */
}

#filter-container::-webkit-scrollbar-thumb:hover {
    background-color: #999; /* Darker color when hovered */
}

#clear-filters {
    order: 2;
    text-decoration: none;
    color: #007bff; /* Link color */
    cursor: pointer;
    font-size: 14px;
    font-weight: bold; /* Make it stand out */
    padding-left: 10px;
}

#clear-filters:hover {
    text-decoration: underline; /* Add underline on hover */
    color: #0056b3; /* Darker link color */
}

#tooltip-icon {
    order: 0;
    display: inline-block;
    margin: 0px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #007bff;
    position: relative;
}

/* Tooltip styling */
#tooltip-icon::after {
    content: "Pulsa para conocer los filtros.";
    position: absolute;
    bottom: 120%; /* Position tooltip above the icon */
    left: 0%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#tooltip-icon:hover::after {
    opacity: 1;
}

/* Tooltip for expanded info on click */
#tooltip-details {
    display: none;
    position: absolute;
    top: 40px;
    left: 270px !important;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    max-width: 470px;
    z-index: 1000;
    font-size: 14px;
    line-height: 18px;
    padding: 15px 15px 5px 15px;
}

#tooltip-details ul {
    padding: 10px 0px 5px 20px;
    margin: 0;
}

#tooltip-details li {
    margin-bottom: 5px;
}

#tooltip-details a {
    color: green;
    text-decoration: none;
}

#tooltip-details a:hover {
    color: darkred;
    text-decoration: underline;
}


.gm-style .gm-style-iw li {
    margin-left: -20px !important;
}

/* Drawer container */
#promo-drawer {
    position: fixed;
    top: 0;
    right: -320px; /* Initially hidden */
    width: 320px;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.85); */
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Open state */
#promo-drawer.open {
    right: 0;
}

/* Lid button */
#promo-lid {
    position: absolute;
    top: 50%;
    left: -50px;
    width: 50px;
    height: 50px;
    background: orange;
    opacity: 0.7;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
}

#promo-lid img {
    padding: 5px;
}

/* Promo content area */
#promo-content {
    flex: 1;
    padding: 20px;
    color: white;
    background-color: rgb(255 165 0 / 70%);
}

#promo-image {
    width: 100%;
}

#promo-caption {
    text-align: center;
    padding-top: 10px;
}

/* 🔽 Bottom Promo Drawer Container */
.hidden {
    display: none !important;
}

#promo-loading {
    text-align: center;
    padding: 15px;
    font-style: italic;
    color: #666;
}

#promo-drawer-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgb(255, 255, 255, 0.3);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-top: 3px solid #f37721;
    font-family: sans-serif;
}

/* 🔘 Toggle Button Bar */
#promo-toggle {
    /*background: #008060;*/
    background-color: rgba(0, 128, 96, 0.7);
    text-align: center;
    padding: 12px;
    font-weight: bold;
    color: #FFF;
    cursor: pointer;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    transition: background 0.2s ease;
}

#promo-toggle:hover {
    /*background: #f37721;*/
    background-color: rgb(243, 119, 33, 0.7);
    color: #000;
}

/* 🖼️ Grid Container (Hidden by Default) */
#promo-grid.hidden {
    display: none;
}

/* Grid Layout */
#promo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile default */
    gap: 10px;
    padding: 12px;
    max-height: 35vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Promo Image Styling */
#promo-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

body.drawer-height .gmnoprint.gm-bundled-control.gm-bundled-control-on-bottom {
    bottom: 170px !important;
}


/* Responsive Grid: 4 columns for tablets/desktops */
@media (min-width: 768px) {
    #promo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
     /* Logo Styling */
    #logo {
        height: 25px; /* Adjust logo height */
        width: auto; /* Maintain aspect ratio */
    }
    
    /* Header Text Styling */
    #header-text {
        font-size: 18px; /* Adjust font size */
        font-weight: bold; /* Make it stand out */
        color: #333; /* Customize text color */
    }

    #hud {
        padding: 5px;
    }
    
    #map {
        height: 70vh;
    }

    #search-container {
        flex-direction: row;
        gap: 10px;
    }

    #search-box {
        width: 100%;
    }
    
    #tooltip-details {
        position: absolute;
        left: 190px !important;
        max-width: 300px;
        width: 90%; /* Ensure width adapts to smaller screens */
        word-wrap: break-word; /* Break long words to fit within the max-width */
        overflow-wrap: break-word; /* Modern browsers */
        white-space: normal; /* Allow content to wrap to new lines */
    }

    #promo-lid {
        top: auto; /* Reset top */
        bottom: 30%; /* Move lower */
    }
}