/* --------------------------------------------------------------------------
   File: style-header.css
   Child Theme: Hello Elementor Cuzgow v1.1.0
   Template: hello-elementor
   Theme URI: https://github.com/cuzgow/hello-elementor-cuzgow
   Author: Cuzgow
   Author URI: https://cuzgow.com/
   Description: Header‑specific styles for the Hello Elementor Cuzgow child theme,
                optimized for Web Performance and scalability.
   Version: 1.1.0
   Requires at least: 6.0
   Tested up to:      6.5
   Requires PHP:      8.1
   License: GNU General Public License v3 or later
   License URI: https://www.gnu.org/licenses/gpl-3.0.html
   Text Domain: hello-elementor-cuzgow
------------------------------------------------------------------------- */

/* Header 
------------------------------------------------------------
------------------------------------------------------------ */
.siteHeader{
	width: 100%;
	position: sticky;         /* Makes the header sticky */
	top: 0;                   /* Sticks to the top of the viewport */
	z-index: 9999;            /* Ensures it's above other content */
  display:grid;
  grid-template-columns: auto 1fr;
  /*grid-template-columns: minmax(10px, 1fr) 3fr;*/
  column-gap: 2em;
  align-items: center;
  align-content: center;
  grid-auto-flow: row;
  font-family: var(--font-family-headings);
	font-size: 1.1em; 
  background-color: var(--brand-color);
	/*background: hsla(var(--brand-hue), var(--brand-saturation), var(--brand-lightness), 0.85);  transparency for glass effect */
	/*backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);*/
	border: 1px solid rgba(255, 255, 255, 0.3);
	/*border-radius: 0 0 .3em .3em;*/
	padding-inline: 10vw;
  padding-block: max(2%, 20px);
}

@media only screen and (max-width: 1024px){
	.siteHeader{
		padding-inline: 8vw;
	}
}


@media only screen and (max-width: 600px){
	.siteHeader{
		padding-inline: min(1.6rem, 5vw);
	}
}


/* reset del <a> normal 
------------------------ */
.siteHeader .menu-item a{
	padding: 	0;
	text-shadow: var(--text-shadow-dark);
	color: var(--text-light);/* adapt to website */
}
/* adaptado a obymed */
.siteHeader .menu-item a:hover{
  color: var(--color-light-1);
}
 /* button pedir cita */
.siteHeader #menu-item-18413 a,
/* button tel */
.siteHeader #menu-item-18414 a{
  padding: .5em;
  background-color: var(--color-hue-1);
  border-radius: 0.5em;
  border: 1px solid transparent;
}


/* Area logo
-----------------------------------------------------
----------------------------------------------------- */
.areaLogo{
  /*max-width: 100%;*/
  max-width: max-content;
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-items: center;
	margin: 0;
	padding: 0;
}

/* Reset <a>
   "display: contents" removes the <a> box from the layout tree,
   so the Flexbox parent (.areaLogo) aligns the <img> directly. 
----------------- */
.areaLogo a{
	display: contents;
}
 
/* Tamaño del logo
	* ajustar a cada web
---------------------------- */ 
.siteHeader img.custom-logo{
	max-height: 50px;
  width: auto;
	height: auto;
	display: block;
  font-weight: var(--font-weight-normal);
}

/* Fin area logo */ 

/* Area Menu
-----------------------------------------------------
----------------------------------------------------- */

.areaMenu{
  max-width: 100%;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: horizontal;
	-webkit-box-direction: normal;
	-ms-flex-flow: row nowrap;
	flex-flow: row nowrap;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	margin: 0;
	padding: 0;
	justify-self: end;

}
/* for aria label purpouse */
.areaMenu button.hamburger .visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap; /* Prevents text from affecting layout */
}

/* Hamburger Button (Hidden on Desktop)
----------------------------------------------------- */
.areaMenu button.hamburger {
  display: none;             /* Hides completely on desktop */
  position: relative;
  z-index: 500;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: max(8vw, 5em);      /* Ensures large clickable area */
  height: max(8vw, 5em);
  padding: 1em;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: .5em;
  color: var(--color-light-1);
  font-size: var(--font-size-p); /* Logic: overrides 1.57rem if var exists */
  cursor: pointer;           /* UX: Shows it's clickable */
  touch-action: manipulation; /* Optimizes touch response */
	transform: none;
}

/* adaptado a obymed */
  .areaMenu button.hamburger:focus,
  .areaMenu button.hamburger:hover
  {
    border-radius: .5em;
    background-color: transparent;

}

/* Accessibility: Focus States
  ----------------------------------------------------- */

.areaMenu button.hamburger:focus {
  outline: none; /* Fallback */
}

.areaMenu button.hamburger:focus-visible { /* :focus-visible ensures outline appears ONLY for keyboard navigation,
  keeping it clean for mouse clicks.*/
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}

/* Hamburger Lines (Central Line) */
.areaMenu span.hamburger-lines{
  position: absolute;
  width: 2.2em;
  height: 0.5em;
  background-color: var(--color-light-1);
  border-radius: 0.2em;
}

/* Top & Bottom Lines (Pseudo-elements) */
.areaMenu span.hamburger-lines::before,
.areaMenu span.hamburger-lines::after{
	content: "";
  display: block;
  position: absolute;
  width: 2.2em;
  height: 0.5em;
  background-color: var(--color-light-1);
  border-radius: 0.2em;
  left: 0; /* Ensures alignment */
}

.areaMenu span.hamburger-lines::before {
  top: -10px;
}

.areaMenu span.hamburger-lines::after {
  top: 10px;
}


/* Nav Menu (Desktop)
----------------------------- */
.menuInicio {
  /* We keep flex: 1 here because the menu SHOULD fill the space 
     next to the logo to push links to the far right. */
  flex: 1 1 auto;
  max-width: 100%;
}

.menuInicio ul {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 1em; /* Increased slightly for better "white space" balance */
  margin: 0;
  padding: 0;
  list-style: none; /* Core reset for nav menus */
}


.menuInicio li::before{
	display: none;
	content: none;
	padding: 0;
	margin: 0;
}

.menuInicio li{
	padding: 0;
	margin: 0;
}

/* Social Icons
-------------------------------------- */
/*.menuInicio svg{
	width: 1.1em;
	height: 1.1em;
	vertical-align: top;
}*/

/* Flags WPML 
--------------------------------------- */
/*.menuInicio li:last-of-type a:first-of-type {
	margin-inline-end: .5em;
}

.menuInicio a.wpml-lang-link img {
  width: 1.4em;
  height: auto;  Ensures aspect ratio is maintained during load 
  display: inline-block;
}*/

/*.menuInicio li:last-of-type img{
}*/

/* 2 level menu - Desktop 
----------------------------------------------------- */
.menuInicio li { 
  position: relative; /* to adjust the position of the submenu */
}

/* Hide the JS-injected toggle on desktop */
.submenu-toggle {
  display: none;
}

.menuInicio ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 0px;
  width: 30vw;
  overflow: hidden;
  overflow: clip;
  background-color: var(--brand-color);/* adjust to clients */
  padding: 2em;
  display: none;
  z-index: 1000;
  list-style: none;
}

@media only screen and (min-width: 1025px) {
  .menuInicio li:hover > .sub-menu,
  .menuInicio li:focus-within > .sub-menu {
    display: block;
  }
}

.menuInicio ul.sub-menu li{
  padding-block-end: .35em;
}

.menuInicio ul.sub-menu.is-active li{
  padding-block-end: .5em;
  border: none;
}

.menuInicio ul.sub-menu a {
  font-size: 0.8em;
}



/* Media queries
----------------------------------------------------------
---------------------------------------------------------- */
@media only screen and (max-width: 1024px){

	.siteHeader{
		grid-template-columns: repeat(2, minmax(10px, 1fr));
		justify-items: end;
		padding-block: 0;
	}

	.siteHeader a{
		color: var(--text-light);
		text-shadow: var(--text-shadow-dark);
	}

	.areaMenu{
		flex-flow: column nowrap;
		justify-content: center;
	}

	/* Hamburger Toggle */
  .areaMenu button.hamburger {
    display: flex; /* Overrides display: none */
    visibility: visible;
    touch-action: none;
  }

/* Para convertir la hamburguesa en X cuando se activa 
 --------------------------------------------------------- */

/* 1. Base State - Transitions go HERE for bi-directional animation */
.areaMenu span.hamburger-lines,
.areaMenu span.hamburger-lines::before,
.areaMenu span.hamburger-lines::after {
  transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.3s ease;
}

/* 2. Active State (The X) */
.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines {
  transform: rotate(45deg);
  background-color: var(--color-light-1);
}

.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines::before{
	opacity: 0;
	
}

.areaMenu button.hamburger[aria-expanded=true] span.hamburger-lines::after {
  /* Kept your 270deg for the "spinning" effect you like */
  transform: rotate(270deg) translateX(9px); 
  background-color: var(--color-light-1);
}
/* Fin hamburguesa en X */


/* Mobile Menu Container (Hidden state) */
.areaMenu .menuInicio {
  display: none;
  visibility: hidden; /* Double safety */
}

.areaMenu .menuInicio.menu-open{
	display: block;
	visibility: visible;
	width: 80%;      /* Slightly wider for better readability */
	min-height: 100vh;
	position: absolute;
	left: 0%;
	top:0%;
	z-index: 99;
	background: linear-gradient(
		to right top,
		hsla(var(--brand-hue), var(--brand-saturation), 50%),
		hsla(var(--brand-hue), var(--brand-saturation), 61.4%),
		hsla(var(--brand-hue), var(--brand-saturation), 73%)
	);	
	margin: 0;
	padding-inline: 8vw; 
  padding-block-start: max(3%, 20px);
	animation: slideIn .8s ease forwards;
}

/* Slide-in Keyframes */
@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}


/* List Styling inside Mobile Menu */
.areaMenu nav.menuInicio ul {
  max-width: 100%;
  flex-flow: column nowrap;
  align-items: flex-start; /* Left-aligned usually feels better for mobile lists */
  justify-content: flex-start;
  padding: 0;
  padding-block-start: max(3%, 20px);
  padding-inline-start: .5em;
}

.areaMenu .menuInicio li {
  width: 100%;
  list-style: none;
}


/* Vertical Spacing */

/* Desactivate for 2 level menu
.areaMenu .menuInicio.menu-open li:first-child {
  margin-block-start: max(15vh, 80px);  Responsive top gap 
}*/

.areaMenu .menuInicio.menu-open li{
	padding-block-end: .8em;
	font-size: 1.08em;
	border-bottom: 1px solid rgba(255,255,255,0.1); /* Subtle separator */
}

/* Para fijar el menú (div.menu-principal-container) 
** cuando se abre en versión mobile 
** Esta clase se añade al body al pulsar sobre el menu
*/
body.lock-scrolling {
	position: fixed;
  width: 100%;
}

/* 2 level menu - Mobile/Tablet 
----------------------------------------------------- */

  /* parent li that has children: Switch from column to horizontal row */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children {
    display: flex;
    flex-flow: row wrap; /* Row for A+Button, Wrap for UL */
    align-items: center; /* Perfect vertical alignment for text & icon */
    justify-content: space-between;
    width: 100%;
    padding-block: 0; /* Clear previous height hacks */
  }

  /* 2. The Link: Targeted by its functional attribute */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children a[aria-haspopup="true"] {
    flex: 1; /* Occupies all available horizontal space */
    text-align: left;
    min-width: 0;             /* allow wrapping without pushing the button */
    margin: 0;
    /* We remove 'display: block' to respect your theme's 'inline-flex' */
    display: inline-flex; 
    align-items: center; /* Ensures text inside the link is also centered */
    /*ajustad a obymed */
    line-height: var(--line-height-normal);
  }

  /* 3. The Toggle Button: In-flow, aligned at the end of the row */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children button.submenu-toggle {
    display: inline-flex;         /* Overrides desktop "display: none" */
    flex: 0 0 auto;               /* Keep fixed size, do not shrink */
    position: static;             /* Removes absolute positioning */
    width: 60px;                  /* Minimum touch target */
    height: 60px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-light-2);
    -webkit-tap-highlight-color: transparent;
  }

  /* 4. The SVG Icon + Rotation logic */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children .submenu-toggle .submenu-toggle-svg {
    width: 20px;
    height: 20px;
    display: block;                 /* avoids inline SVG baseline weirdness */
    flex: 0 0 auto;
    color: currentColor;            /* inherits button color */
    fill: none;                     /* safety against generic svg fill rules */
    stroke: currentColor;
    pointer-events: none;           /* click stays on button */
    transform-origin: 50% 50%;
    transition: transform 0.25s ease;
  }

  /* Open state: rotate chevron */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children .submenu-toggle[aria-expanded="true"] .submenu-toggle-svg {
    transform: rotate(180deg);
  }

  /* 5. The Submenu <ul>: hidden by default, ready to sit below the row */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children  ul.sub-menu {
    display: none;  /* Hidden until JS adds .is-active */
    position: static;        /* cancels desktop absolute dropdown behavior */
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;          /* Ensures it takes a full "row" in the flex container */
    margin: 0;
    padding: 0;
    padding-inline-start: 1em;
    background: transparent;
    list-style: none;
    text-align: left;
  }

  /* 6. The Sub-Menu when active (opened by JS) */
  .areaMenu .menuInicio.menu-open li.menu-item-has-children .sub-menu.is-active {
    display: block;
  }

}

/* Media query mobile
----------------------------------- 
*/
@media only screen and (max-width: 600px){

	.areaMenu .hamburger-lines::after{
		top: 																					9px;
	}

	.areaMenu .menuInicio.menu-open{
		padding-inline: 															min(1.6rem, 5vw);
	}

	/* Flags WPML 
	--------------------------------------- */
	/*.menuInicio li:last-of-type a:first-of-type {
		margin-inline-end:0;
	}
	.menuInicio a.wpml-lang-link img{
		width: 1.5em;
	}
	*/
	/* social icons */
	.menuInicio svg {
	width: 1.1em;
	height: 1.1em;
	vertical-align: top;
	fill: var(--color-light-1);
	}
}

