/* CSS for Clinica Danas Header Widget */

:root {
  --danas-black: #0c0c0c;          /* Negro de lujo */
  --danas-dark-bg: #141414;        /* Fondo oscuro secundario */
  --danas-gold-base: #d4af37;      /* Dorado clásico del logo */
  --danas-gold-light: #fbe695;     /* Dorado brillante para hovers */
  --danas-gold-dark: #8e6819;      /* Dorado oscuro para textos */
  --danas-white: #ffffff;          /* Blanco */
  --danas-gray-text: #2c2c2c;      /* Texto de submenú */
  --danas-gray-light: #fafaf8;     /* Fondo de submenú */
  --danas-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.danas-no-scroll {
  overflow: hidden !important;
}

.danas-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4%;
  background-color: var(--danas-black);
  color: var(--danas-white);
  position: relative;
  z-index: 999;
  font-family: 'Outfit', 'Inter', sans-serif;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15); /* Delicate gold bottom border */
}

/* Logo Styles */
.danas-header-logo-container {
  display: flex;
  align-items: center;
  max-width: 260px;
}

.danas-header-logo-container img {
  max-height: 48px;
  width: auto;
  display: block;
}

.danas-header-logo-container a {
  text-decoration: none;
  color: var(--danas-white);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Navigation Menu Styles */
.danas-header-nav {
  display: flex;
  align-items: center;
}

.danas-header-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 32px;
}

.danas-header-menu > li {
  position: relative;
}

.danas-header-menu a {
  text-decoration: none;
  color: var(--danas-white);
  font-size: 0.85rem;
  font-weight: 700; /* Unified font weight */
  text-transform: uppercase;
  letter-spacing: 1.8px;
  padding: 12px 0;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  white-space: nowrap !important;
  transition: var(--danas-transition);
}

.danas-header-menu a * {
  display: inline !important;
  white-space: nowrap !important;
}

.danas-header-menu > li > a {
  position: relative;
}

.danas-header-menu > li > a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--danas-gold-base);
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.danas-header-menu > li:hover > a::before,
.danas-header-menu > li.current-menu-item > a::before,
.danas-header-menu > li.current-menu-ancestor > a::before {
  width: 100%;
}

.danas-header-menu a:hover {
  color: var(--danas-gold-light);
}

/* Active Menu Item Highlight */
.danas-header-menu > li.current-menu-item > a,
.danas-header-menu > li.current-menu-ancestor > a {
  color: var(--danas-gold-base);
}

/* Submenu / Dropdown Styles (Luxury Acrylic/Glassmorphism Dropdown) */
/* Arrow indicator for dropdowns (Global) */
.danas-header-menu .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 6px;
  margin-left: 8px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: transform 0.3s ease;
}

@media (min-width: 992px) {
  .danas-header-menu .sub-menu .danas-parent-menu-link {
    display: none !important;
  }

  /* Submenu / Dropdown Styles (Luxury Acrylic/Glassmorphism Dropdown) */
  .danas-header-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px) scale(0.97);
    background-color: rgba(12, 12, 12, 0.95) !important; /* Force professional dark glassmorphism */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    width: 380px; /* Stable fixed width to prevent any jumping/jiggling */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.15); /* Delicate gold border */
    padding: 0; /* Remove vertical padding to let first/last item hover stretch to edges */
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                visibility 0.3s;
    z-index: 1000;
  }

  /* Invisible bridge to maintain hover state while moving cursor to dropdown */
  .danas-header-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 25px;
    background: transparent;
    display: block;
  }

  .danas-header-menu .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
  }

  .danas-header-menu .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px) scale(1); /* Smooth hover drop with scale-up */
  }

  .danas-header-menu .sub-menu a {
    color: rgba(255, 255, 255, 0.85) !important; /* Force professional soft white */
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 400; /* Inter normal */
    padding: 16px 32px; /* Marginally more padding for spacious luxury feel */
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    letter-spacing: 1.5px;
    white-space: nowrap; /* Prevent line breaks */
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .danas-header-menu .sub-menu a:hover {
    color: var(--danas-gold-light) !important; /* Force elegant gold hover color */
    background-color: rgba(212, 175, 55, 0.08); /* Sophisticated subtle gold tint */
    padding-left: 32px; /* Smooth luxury shift */
  }

  /* Round first/last submenu anchors to match dropdown box container border-radius */
  .danas-header-menu .sub-menu li:first-child > a {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  .danas-header-menu .sub-menu li:last-child > a {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }
}

/* CTA Button Styles (Matching Logo Gold Gradient) */
.danas-header-cta-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.danas-header-cta-mobile {
  display: none !important;
}

.danas-header-cta-desktop {
  display: flex !important;
}

/* CTA Button is now styled via the shared class .danas-btn */

/* Hamburger Menu Icon (Mobile) */
.danas-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
}

.danas-menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--danas-white);
  transition: var(--danas-transition);
  border-radius: 2px;
}

/* Mobile responsive navigation styles */
@media (max-width: 991px) {
  .danas-menu-toggle {
    display: flex;
  }

  /* Slide-in menu panel on mobile */
  .danas-header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background-color: var(--danas-black);
    padding: 90px 30px 40px 30px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 30px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    overflow-y: auto;
  }

  .danas-header-container.nav-open .danas-header-nav {
    right: 0;
  }

  .danas-header-menu {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .danas-header-menu a {
    width: 100%;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Hamburger transform when menu open */
  .danas-header-container.nav-open .danas-menu-toggle span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .danas-header-container.nav-open .danas-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .danas-header-container.nav-open .danas-menu-toggle span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Mobile Dropdown Collapsing */
  .danas-header-menu .sub-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background-color: transparent !important;
    width: 100% !important; /* Reset desktop 380px fixed width */
    min-width: 100%;
    padding: 5px 0 !important;
    box-shadow: none;
    max-height: 0;
    border-top: none;
    border-left: none;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
  }

  .danas-header-menu .menu-item-has-children.active > .sub-menu {
    max-height: 600px;
  }

  .danas-header-menu .menu-item-has-children.active > a::after {
    transform: rotate(180deg);
  }

  .danas-header-menu .sub-menu a {
    color: rgba(255, 255, 255, 0.7) !important; /* Dimmer for hierarchy */
    font-family: 'Inter', sans-serif;
    padding: 14px 0 14px 15px !important; /* Touch target optimized padding */
    border-bottom: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: normal !important; /* Allow line wrapping */
    line-height: 1.4;
  }

  .danas-header-menu .sub-menu a:hover {
    color: var(--danas-gold-light) !important;
    background: none !important;
    padding-left: 15px !important; /* Maintain alignment on hover */
  }

  .danas-header-cta-desktop {
    display: none !important;
  }

  .danas-header-cta-mobile {
    display: block !important;
    width: 100% !important;
    margin-top: 30px !important;
  }

  .danas-header-cta-mobile .danas-btn {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 14px 20px !important;
  }
}
