/* --- CABECERA (LÓGICA DE ANIMACIÓN) --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;    
    z-index: 1002;
    background-color: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) 1;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-container {
    display: grid;
    grid-template-columns: auto 1fr auto; 
    align-items: center;
    gap: 2rem;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    height: var(--header-height);
    transition: height 0.4s ease;
}

/* --- ESTADO DE SCROLL (REDUCIR ALTURA) --- */
.main-header.is-scrolled {
    background-color: rgba(13, 13, 13, 0.95);
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) 1;
    border-bottom: 2px solid transparent;
}

.main-header.is-scrolled .header-container {
    height: var(--header-height-scrolled);
}
.main-header.is-scrolled .main-nav a {
    font-size: 0.8rem;
}
.main-header.is-scrolled .header-contact {
    opacity: 0;
    transform: scaleX(0);
    pointer-events: none;
}
.main-header.is-scrolled .icon-link svg {
    width: 20px;
    height: 20px;
}

/* 1. Estilos para el nuevo enlace de texto (header-contact-link) */
.header-contact-link {
    /* Apariencia de enlace rosa y subrayado */
    color: var(--secondary-color);
    text-decoration: underline;
    text-transform: uppercase;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: normal;

    /* Oculto por defecto con una animación suave */
    opacity: 0;
    pointer-events: none;
    transform-origin: right;
    transform: scaleX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;

    /* Para que no ocupe espacio cuando está oculto */
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* 2. Efecto hover para el nuevo enlace de texto */
.header-contact-link:hover {
    font-weight: bold;
    animation: pulse 0.8s ease-in-out forwards;
}

/* --- Definición de la animación de pulso --- */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1); /* Agrandamiento del 20% para que sea bien perceptible */
  }
  100% {
    transform: scale(1);
  }
}

.main-header.is-scrolled .header-contact-link {
    /* Mostramos el ENLACE de texto */
    opacity: 1;
    pointer-events: auto;
    transform: scaleX(1);
    width: auto; /* Permite que ocupe su espacio natural */
    margin-right: 0.5rem; /* Pequeño margen para que no se pegue a los iconos */
}

/* --- LÓGICA PARA LA TRANSICIÓN DEL LOGO --- */
.logo-link {
    position: relative;
    display: block;
    height: 40px;
    transition: height 0.4s ease;
}
.logo-img { 
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: auto;
    transition: opacity 0.4s ease;
}
.logo-compact {
    opacity: 0;
}
.main-header.is-scrolled .logo-link {
    height: 28px;
}
.main-header.is-scrolled .logo-full {
    opacity: 0;
}
.main-header.is-scrolled .logo-compact {
    opacity: 1;
}

/* --- ESTILOS GENERALES Y RESPONSIVE --- */
.main-nav {
    /* 3. Posicionamiento absoluto para un centrado perfecto */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.main-nav ul { 
    list-style: none; 
    display: flex; 
}

.main-nav li {
    margin-left: 0.5rem;
}

.main-nav a { 
    font-family: var(--font-display); 
    font-size: 0.8rem; 
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    border-radius: 0px; /* Bordes redondeados para la caja */
    transition: border-color var(--transition-speed) ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.main-nav a:hover, .main-nav a:focus {
    border-color: var(--secondary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 1rem;
    right: 1rem;
    height: 3px;
    border-bottom: 2px solid var(--secondary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.main-nav a:hover::after, .main-nav a:focus::after {
    transform: scaleX(1);
}

/* ===== NUEVAS REGLAS PARA EL ESTADO SCROLLED ===== */
.main-header.is-scrolled .main-nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem; /* Padding más pequeño */
}
.main-header.is-scrolled .main-nav a::after {
    bottom: 4px; /* Sube la línea para que quede más pegada */
    left: 0.8rem;
    right: 0.8rem;
}

.header-right { 
    justify-self: end; 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
}

.contact-button {
  background-color: transparent;
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 8px 20px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-block;
  font-size: 0.8rem;
  box-shadow: 0 0 5px rgba(231, 0, 97, 0.3);
  transition: all 0.15s ease-in-out;
}
.contact-button:hover {
  background-color: var(--hover-color);
  border-color: var(--hover-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px 1px rgba(250, 42, 129, 0.7);
}

.icon-link { 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 0;
    color: #ffffff; 
    transition: color 0.3s ease; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease; 
}
.icon-link:hover { 
    color: var(--secondary-color); 
    transform: scale(1.1) translateY(-2px);
}
.icon-link svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    transition: all 0.4s ease;
}
.header-icon-wrapper,
.language-selector { 
    position: relative; 
    display: flex;
    align-items: center;
}
.lang-flag { 
    width: 20px; 
    border-radius: 3px; 
}
.language-dropdown { 
    position: absolute; 
    top: 100%; 
    right: 0; 
    background-color: var(--dark-bg); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 5px; 
    list-style: none; 
    padding: 0.5rem; 
    margin: 0; 
    z-index: 1001; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(10px); 
    transition: all 0.3s ease; 
}
.language-dropdown.is-active { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.language-dropdown a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 0.5rem 1rem; 
    font-size: 0.9rem; 
    transition: color 0.3s ease; 
}
.language-dropdown a:hover {
    color: var(--secondary-color);
}
.header-toggle {
    display: none;
    padding: 8px;
    background-color: transparent;
    border: none;
    appearance: none; 
}
.hamburger-icon { display: block; width: 25px; height: 2px; background-color: #fff; position: relative; transition: all 0.3s ease-in-out; }
.hamburger-icon::before, .hamburger-icon::after { content: ''; position: absolute; width: 100%; height: 100%; background-color: #fff; left: 0; transition: all 0.3s ease-in-out; }
.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { top: 8px; }
.header-toggle.is-active .hamburger-icon { background-color: transparent; }
.header-toggle.is-active .hamburger-icon::before { transform: translateY(8px) rotate(45deg); }
.header-toggle.is-active .hamburger-icon::after { transform: translateY(-8px) rotate(-45deg); }


/* --- REGLAS RESPONSIVE --- */
@media (max-width: 1024px) {
    .main-nav, 
    .header-contact, 
    .header-lang { /* Ocultar el contenedor de la lupa de escritorio */
        display: none; 
    }
    
    .header-toggle { 
        display: block; 
    }
    
    .header-container { 
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%; 
        padding: 0 1.5rem;
        max-width: none; 
        box-sizing: border-box;
    }
    .header-right {
        gap: 1rem;
    }
    

}


/* --- PANELES OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1010;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.search-overlay.is-active { opacity: 1; visibility: visible; }
.close-search { position: absolute; top: 2rem; right: 2rem; font-size: 3rem; color: #fff; background: none; border: none; cursor: pointer; transition: transform 0.3s ease, color 0.3s ease; }
.close-search:hover { color: var(--secondary-color); transform: rotate(90deg); }
.search-input-wrapper { position: relative; width: 90%; max-width: 600px; }
#search-input { 
    width: 100%; 
    background: none; 
    border: none; 
    border-bottom: 2px solid var(--primary-color); 
    padding: 1rem; 
    font-family: var(--font-display);
    font-size: 1.8rem; 
    color: var(--primary-color); 
    text-align: center; 
    outline: none;
    transition: border-color 0.3s ease;
}
#search-input:focus {
    border-color: var(--secondary-color);
}

.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background-color: #111;
    z-index: 1005;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.mobile-nav-panel.is-active { transform: translateX(0); }
.mobile-panel-header { display: flex; justify-content: flex-end; align-items: center; padding: 1rem 1.5rem; position: absolute; top: 1rem; right: 0; width: 100%; box-sizing: border-box; }
.close-mobile-menu { 
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 2.8rem; 
    line-height: 1; 
    cursor: pointer; 
    padding: 0.5rem; 
    transition: transform 0.3s ease, color 0.3s ease; 
}
.close-mobile-menu:hover {
    transform: rotate(90deg);
    color: var(--secondary-color);
}

.mobile-nav { padding: 100px 2.5rem 2rem 2.5rem; flex-grow: 1; overflow-y: auto; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav li { margin-bottom: 1.8rem; }
.mobile-nav a { font-size: 1.25rem; text-transform: uppercase; font-family: var(--font-display); font-weight: 700; transition: color 0.3s ease; display: inline-block; }
.mobile-nav a:hover { color: var(--secondary-color); }
.mobile-nav-footer { padding: 1.5rem 2.5rem; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.mobile-nav-footer .language-selector { text-align: left; width: 100%; }
.mobile-nav-footer .language-toggle { background: none; border: none; padding: 0; color: var(--text-color); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; transition: color 0.3s ease; }
.mobile-nav-footer .language-toggle:hover { color: var(--secondary-color); }
.mobile-nav-footer .language-toggle svg { width: 20px; height: 20px; }
.mobile-nav-footer .language-dropdown { position: static; transform: none; width: auto; background: none; border: none; z-index: auto; list-style: none; padding: 0; margin: 0; overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.4s ease-out, opacity 0.3s ease-out, margin-top 0.4s ease-out; }
.mobile-nav-footer .language-dropdown.is-active { max-height: 200px; opacity: 1; margin-top: 1.5rem; }
.mobile-nav-footer .language-dropdown a { text-transform: none; font-weight: 400; color: var(--text-color); font-weight: bold;}
.mobile-nav-footer .language-dropdown a:hover { color: var(--secondary-color);}
#search-input::-webkit-search-cancel-button {
    /* -webkit-appearance es necesario para poder aplicar estilos */
    -webkit-appearance: none;
    appearance: none;

    /* Damos un tamaño al nuevo icono que vamos a crear */
    height: 25px;
    width: 25px;

    /* Opción 1: Una 'X' blanca y moderna (recomendada) */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
    
    /* Opción 2: Una 'X' rosa que coincide con tu paleta de colores */
    /* background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e70061"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>'); */
    
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* Opcional: hacerla un poco transparente hasta que pases el ratón por encima */
#search-input::-webkit-search-cancel-button:hover {
    opacity: 0.7;
}

/* --- ESTILOS PARA LA BÚSQUEDA --- */
mark {
    background-color: var(--banner-color); /* Usa tu color secundario (rosa) para el fondo */
    color: #000000; /* Color de texto blanco para que contraste */
    padding: 10px 10px;
    border-radius: 50px;
    font-weight: bold;
}

/* --- ESTILOS PARA MENSAJE DE FEEDBACK EN BÚSQUEDA --- */
.search-feedback-message {
    display: none; /* Oculto por defecto */
    color: var(--secondary-color); /* Color rosa para que llame la atención */
    font-family: var(--font-display);
    font-size: 1rem;
    text-align: center;
    margin-top: 1.5rem;
    font-weight: bold;
}