/* Header */

	#header {
		background-color: rgba(0, 0, 0, 0.85);
		-moz-transition: background-color 0.2s ease-in-out;
		-webkit-transition: background-color 0.2s ease-in-out;
		-ms-transition: background-color 0.2s ease-in-out;
		transition: background-color 0.2s ease-in-out;
		height: 2.6em;
		left: 0;
		line-height: 2.6em;
		padding: 0 1.25em;
		position: fixed;
		top: 0;
		width: 100%;
		z-index: 10000;
		display: flex;              /* add */
    	align-items: center;        /* add */
	}

		#header h1 {
			-moz-transition: opacity 0.2s ease-in-out, visibility 0.2s;
			-webkit-transition: opacity 0.2s ease-in-out, visibility 0.2s;
			-ms-transition: opacity 0.2s ease-in-out, visibility 0.2s;
			transition: opacity 0.2s ease-in-out, visibility 0.2s;
			border-bottom: 0;
			font-size: 0.8em;
			margin-bottom: 0;
			opacity: 1;
			visibility: visible;
		}

			#header h1 a {
				border: 0;
			}

	/* Desktop nav: flex row of links, hamburger hidden */
	#header nav {
		font-family: "Title";
		font-size: 0.75em;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		position: absolute;
		right: 1.5em;
		top: 0;
		height: 3.5em;
		display: flex;
		align-items: center;
	}

		#header nav ul {
			display: flex;
			list-style: none;
			margin: 0;
			padding: 0;
			gap: 0.25em;
			align-items: center;
		}

		#header nav ul li a {
			display: flex;
			align-items: center;
			height: 2em;
			padding: 0 0.85em;
			color: var(--color-primary-green);
			text-decoration: none;
			border: 0;
			border-radius: 4px;
			transition: background-color 0.2s ease-in-out;
			line-height: 1;
		}

		#header nav ul li a:hover {
			background-color: rgba(255, 255, 255, 0.1);
		}

		#header nav ul li a.nav-presupuesto {
    		border: 2px solid #ffffff;
    		border-radius: 4px;
   			padding: 0 1em;
    		color: #ffffff;
    		margin-left: 0.75em;
		}

		#header nav ul li a.nav-presupuesto:hover {
    		background-color: rgba(255, 255, 255, 0.15);
    		color: #ffffff;
		}

		/* Hamburger — hidden on desktop */
		#header nav a[href="#menu"] {
			display: none;
		}

		#header.alt {
    	background-color: rgba(0, 0, 0, 0.3);
}

/* Instalaciones dropdown (desktop) */
#header nav ul li.has-dropdown {
    position: relative;
}

#header nav ul li.has-dropdown > a:after {
    content: '';
    display: inline-block;
    margin-left: 0.4em;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    vertical-align: middle;
}

#header nav ul li.has-dropdown .dropdown {
    position: absolute;
    top: 2.71667em;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.3);
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    border-radius: 0 0 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s;
}

.mobile-only {
    display: none;
}

#header nav ul li.has-dropdown:hover .dropdown,
#header nav ul li.has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#header nav ul li.has-dropdown .dropdown li {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0;
}

#header nav ul li.has-dropdown .dropdown li a {
    box-sizing: border-box;
    display: block;
    width: calc(100% - 0.8em);
    margin: 0 0.4em;
    height: auto;
    padding: 0.6em 1.6em;
    white-space: normal;
    text-align: center;
    border-radius: 4px;
}	
#header nav ul li.has-dropdown .dropdown {
    transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s;
}

#header:not(.alt) nav ul li.has-dropdown .dropdown {
    background-color: rgba(0, 0, 0, 0.85);
}

@media screen and (max-width: 1200px) {

     /* Hide the desktop dropdown on mobile */
#header nav ul li.has-dropdown .dropdown {
    display: none;
}

/* Remove the desktop arrow */
#header nav ul li.has-dropdown > a:after {
    display: none;
}

/* Show the mobile-only links */
.mobile-only {
    display: list-item;
}

/* Indent them so they appear underneath Instalaciones */
.mobile-only a {
    padding-left: 3em !important;
}

    #header {
        height: 2.75em;
        line-height: 2.75em;
    }

    /* Hide nav links, show hamburger */
    #header nav ul {
        display: none;
    }

     body:not(.is-menu-visible) #header nav ul {
        transition: max-height 0.35s ease 0.15s, padding 0.35s ease 0.15s;
    }

    #header nav {
        right: 0;
        height: 2.75em;
        margin-top: 0.4em;
        margin-right: 0.8em;
    }

    #header nav a[href="#menu"] {
        display: inline-block;
        text-decoration: none;
        transition: background-color 0.2s ease-in-out;
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.125);
        padding: 0 1.35em;
        border-radius: 5px;
        height: 2.75em;
        line-height: 2.75em;
        color: #fff;
        border: 0;
    }

    #header nav a[href="#menu"]:before {
        -moz-osx-font-smoothing: grayscale;
        -webkit-font-smoothing: antialiased;
        display: inline-block;
        font-style: normal;
        font-variant: normal;
        text-rendering: auto;
        text-transform: none !important;
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        content: '\f0c9';
    }

    #header nav a[href="#menu"]:hover {
        background-color: rgba(255, 255, 255, 0.025);
    }

    #header nav a[href="#menu"]:active {
        background-color: rgba(255, 255, 255, 0.075);
    }

    /* === DROPDOWN MENU === */
    /* The ul sits below the header, hidden by default */
    #header nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 3.7em;          /* flush below the header bar */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        gap: 18px;
        list-style: none;
        margin: 0;

        /* Animate open/close */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    /* When body has is-menu-visible, expand the dropdown */
    body.is-menu-visible #header nav ul {
        max-height: 60em;      
        padding: 0.5em 0;
        
    }

    #header nav ul li a {
        display: block;
        width: 100%;
        height: auto;
        padding: 0.75em 1.5em;
        border-radius: 0;
        color: #fff;
        font-size: 0.85em;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    #header nav ul li:last-child a {
        border-bottom: 0;
    }

    #header nav ul li a.nav-presupuesto {
    color: var(--color-primary-green);
    border: 0;
    margin-left: 0;
    background-color: transparent;
    padding: 0.75em 1.5em;
}

    #header.alt h1 {
        opacity: 1;
        visibility: visible;
    }

}

@media screen and (max-width: 480px) {

    #header nav a[href="#menu"] {
        width: 2.75em;
        padding: 0;
        white-space: nowrap;
        text-indent: 4em;
        position: relative;
    }

    #header nav a[href="#menu"]:before {
        width: inherit;
        position: absolute;
        top: 0;
        left: 0;
        text-indent: 0;
        text-align: center;
        padding-right: 0;
        margin-left: 0;
    }

}