/* =====================================================
    VACANTES PERALTA - HOJA DE ESTILOS UNIFICADA (CORREGIDA)
    Paleta Oficial:
    - Terracota Principal: #A05C3F / #A86649
    - Terracota Oscuro:    #8C4F37
    - Beige Arena:         #BFA68A
    - Beige Claro:         #D8CEC1
    - Crema Fondo:         #F5F1EB
    - Texto Oscuro:        #3D3028
    - Blanco:              #FFFFFF
===================================================== */

/* -----------------------------------------------------
   0. CONFIGURACIÓN GLOBAL & RESET
  ----------------------------------------------------- */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 55px; /* Espacio para el header fijo */
  background: #F5F1EB;
  color: #3D3028;
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow-x: hidden;
}

main, .contenido-principal {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 15px;
  flex: 1;
  width: 100%;
}

footer {
  margin-top: auto;
}

/* -----------------------------------------------------
   1. COMPONENTES COMPARTIDOS (HEADER, NAV, FOOTER)
  ----------------------------------------------------- */

/* Header & Navegación (Fijo) */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #A05C3F;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar {
  display: flex;
  align-items: center;
  padding: 6px 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-header img {
  height: 35px;
  width: auto;
  border-radius: 4px;
}

.logo-header h1 {
  color: #ffffff;
  font-size: 1.4rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 25px;
  align-items: center;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #F3D8C8;
}

/* Footer (Pie de página) */
.pie-pagina {
  background-color: #A05C3F;
  color: #ffffff;
  padding: 20px 0;
  margin-top: 40px;
  width: 100%;
}

.contenido-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.contenido-footer p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.contenido-footer a {
  color: #ffffff;
  transition: opacity 0.2s ease;
}

.contenido-footer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.redes-sociales {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Botones de Redes Sociales */
.btn-instagram,
.btn-linkedin,
.btn-facebook,
.redes-sociales a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  margin: 4px !important;
}

.btn-instagram:hover,
.btn-linkedin:hover,
.btn-facebook:hover,
.redes-sociales a:hover {
  background-color: #ffffff !important;
  color: #333333 !important;
  transform: translateY(-2px) !important;
}

/* Elementos comunes de UI y Botones Generales */
.btn-publicar,
.btn-aplicar,
.btn-detalles,
.btn-submit,
.form-card button[type="submit"],
form:not(.form-card form) button {
  display: inline-block;
  background: #A86649;
  color: white;
  padding: 12px 25px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: .3s;
}

.btn-publicar:hover,
.btn-aplicar:hover,
.btn-detalles:hover,
.btn-submit:hover,
.form-card button[type="submit"]:hover,
form:not(.form-card form) button:hover {
  background: #8C4F37;
  transform: translateY(-2px);
}

.badge-cerrada {
  background-color: #6c757d;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.subtitle {
  color: #666666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* -----------------------------------------------------
   2. PÁGINA: INICIO / PRINCIPAL (index.html)
  ----------------------------------------------------- */

section {
  text-align: center;
}

section h2 {
  font-size: 38px;
  margin-bottom: 15px;
  color: #3D3028;
}

section p {
  font-size: 18px;
  color: #6B584B;
}

.titulo-seccion {
  background-color: #A05C3F;
  color: #ffffff;
  text-align: center;
  padding: 12px 25px;
  margin: 20px auto 10px auto;
  border-radius: 6px;
  font-size: 1.4rem;
  font-weight: 700;
  max-width: 90%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.titulo-fecha {
  flex: 0 0 100%;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  color: #A05C3F;
  text-align: center;
  margin: 15px 0 25px 0;
  text-transform: capitalize;
}

/* Buscador */
.contenedor-buscador {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px auto;
  flex-wrap: wrap;
}

.contenedor-buscador input[type="text"],
.contenedor-buscador select {
  padding: 12px 16px;
  border: 1px solid #A05C3F;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  background-color: #ffffff;
  color: #333333;
}

.contenedor-buscador input[type="text"] {
  min-width: 280px;
}

.contenedor-buscador select {
  min-width: 200px;
  cursor: pointer;
}

.btn-buscar {
  padding: 12px 24px;
  background-color: #A05C3F;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-buscar:hover {
  background-color: #8C4F37;
}

/* Tarjetas de vacantes públicas */
#listaVacantes, 
.lista-vacantes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 10px 0;
  max-width: 1200px;
  margin: 40px auto;
}

.vacante {
  width: 300px;
  min-height: 280px;
  background: white;
  padding: 30px;
  border-radius: 18px;
  border-top: 5px solid #A86649;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  color: #3D3028;
  transition: .3s;
}

.vacante:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,.15);
}

.vacante h3 {
  display: block;
  font-size: 22px;
  margin-bottom: 20px;
  text-transform: capitalize;
  color: #A05C3F;
}

.vacante p {
  display: block;
  color: #5C4A3D;
  font-size: 16px;
  margin: 12px 0;
  line-height: 1.6;
}

.vacante strong {
  color: #3D3028;
}

.vacante a {
  display: inline-block;
  margin-top: 15px;
  background: #A86649;
  color: white;
  padding: 12px 25px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: .3s;
}

.vacante a:hover {
  background: #3D3028;
}

/* -----------------------------------------------------
   3. PÁGINA: DETALLE DE VACANTE (detalle.html)
  ----------------------------------------------------- */

.detalle-vacante {
  max-width: 950px;
  margin: 40px auto;
  background: white;
  padding: 45px;
  border-radius: 20px;
  box-shadow: 0 10px 35px rgba(0,0,0,.10);
}

.detalle-vacante h2 {
  color: #A86649;
  font-size: 36px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 35px 0;
}

.info-card {
  background: #F5F1EB;
  padding: 20px;
  border-radius: 15px;
  border-left: 5px solid #A86649;
}

.info-card span {
  color: #7B6A5E;
  font-size: 14px;
}

.info-card strong {
  display: block;
  margin-top: 8px;
  color: #3D3028;
}

.seccion-detalle {
  margin-top: 35px;
}

.seccion-detalle h3 {
  color: #A86649;
  border-bottom: 2px solid #D8CEC1;
  padding-bottom: 10px;
}

.seccion-detalle p {
  line-height: 1.8;
  color: #5C4A3D;
  white-space: pre-line;
}

.volver {
  color: #A86649;
  font-weight: bold;
  text-decoration: none;
}

.volver:hover {
  text-decoration: underline;
}

.fecha-publicacion {
  text-align: center;
  margin-bottom: 25px;
  color: #7B6A5E;
  font-size: 16px;
}

/* -----------------------------------------------------
   4. PÁGINA: PANEL DE CONTROL DE EMPRESAS (panel.html)
  ----------------------------------------------------- */

.header-usuario,
.user-bar {
  background-color: #A05C3F !important;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-usuario p,
.user-bar h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #ffffff !important;
}

.header-usuario strong,
.user-bar strong {
  color: #F3D8C8 !important;
}

#btn-cerrar-sesion,
.btn-logout {
  background-color: #8C4F37 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 9px 18px !important;
  border-radius: 6px !important;
  font-weight: bold !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-cerrar-sesion:hover,
.btn-logout:hover {
  background-color: #3D3028 !important;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.form-card,
.lista-card,
.panel-card {
  background-color: #ffffff !important;
  color: #3D3028 !important;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid #D8CEC1 !important;
  border-top: 4px solid #A05C3F !important;
}

.form-card h2,
.lista-card h2,
.panel-card h3 {
  color: #A05C3F !important;
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 700;
}

.form-card p.subtitle,
.lista-card p.subtitle,
.panel-card p.subtitle {
  color: #6B584B !important;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.campo-form label,
.form-group label,
.campo-formulario label {
  color: #3D3028 !important;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: block;
}

.campo-form input,
.campo-form select,
.campo-form textarea,
.form-group input,
.form-group textarea,
.form-group select,
.input-estilo {
  width: 100%;
  padding: 12px 14px;
  background-color: #F8F6F2 !important;
  border: 1px solid #D8CEC1 !important;
  border-radius: 8px;
  color: #3D3028 !important;
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23A05C3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

.campo-form input:focus,
.campo-form select:focus,
.campo-form textarea:focus,
.input-estilo:focus {
  background-color: #ffffff !important;
  border-color: #A05C3F !important;
  box-shadow: 0 0 0 3px rgba(160, 92, 63, 0.15) !important;
}

/* -----------------------------------------------------
   5. FORMULARIOS GENERALES (Login / Registro / Contacto)
  ----------------------------------------------------- */

form:not(.form-card form) {
  max-width: 750px;
  margin: 40px auto;
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

form:not(.form-card form) label {
  display: block;
  margin-top: 18px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #3D3028;
}

form:not(.form-card form) input,
form:not(.form-card form) select,
form:not(.form-card form) textarea {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #D8CEC1;
  font-size: 15px;
  background-color: #F8F6F2;
  color: #3D3028;
}

form:not(.form-card form) input:focus,
form:not(.form-card form) select:focus,
form:not(.form-card form) textarea:focus {
  outline: none;
  border-color: #A05C3F;
  background-color: #ffffff;
}

form:not(.form-card form) textarea {
  min-height: 130px;
}

/* -----------------------------------------------------
   6. COMPONENTES EXTRA (Loader, Compartir, etc.)
  ----------------------------------------------------- */

#global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#global-loader .spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #F5F1EB;
  border-top: 5px solid #A05C3F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#global-loader.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
}

/* -----------------------------------------------------
   7. COMPONENTES ADICIONALES (Cards, Compartir, Cookies, etc.)
  ----------------------------------------------------- */

.card {
    background: #ffffff !important;
    padding: 35px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #D8CEC1 !important;
    border-top: 4px solid #A05C3F !important;
    max-width: 900px !important;
    margin: 30px auto !important;
}

#form-vacante {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

#form-vacante label {
    display: block !important;
    font-weight: 600 !important;
    color: #3D3028 !important;
    margin-top: 10px !important;
    margin-bottom: 4px !important;
    font-size: 0.95rem !important;
}

#form-vacante input[type="text"],
#form-vacante input[type="email"],
#form-vacante select,
#form-vacante textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    background-color: #F8F6F2 !important;
    border: 1px solid #D8CEC1 !important;
    border-radius: 8px !important;
    color: #3D3028 !important;
    font-size: 1rem !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

#form-vacante input:focus,
#form-vacante select:focus,
#form-vacante textarea:focus {
    background-color: #ffffff !important;
    border-color: #A05C3F !important;
    box-shadow: 0 0 0 3px rgba(160, 92, 63, 0.15) !important;
}

#btn-publicar {
    width: 100% !important;
    background-color: #A05C3F !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-top: 20px !important;
    transition: background 0.2s ease !important;
}

#btn-publicar:hover {
    background-color: #8C4F37 !important;
}

.contenedor-acciones-detalle, 
.contenedor-botones-oferta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contenedor-compartir {
    position: relative;
    display: inline-block;
}

.btn-compartir-principal {
    background-color: #F8F6F2;
    color: #3D3028;
    border: 1px solid #D8CEC1;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-compartir-principal:hover {
    background-color: #EFECE6;
    border-color: #A05C3F;
}

.menu-desplegable-compartir {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #D8CEC1;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 170px;
    overflow: hidden;
}

.menu-desplegable-compartir.activo {
    display: block;
}

.menu-desplegable-compartir .opcion-menu {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    background: none;
    border: none;
    border-bottom: 1px solid #F1ECE4;
    color: #3D3028;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.menu-desplegable-compartir .opcion-menu:last-child {
    border-bottom: none;
}

.menu-desplegable-compartir .opcion-menu:hover {
    background-color: #F8F6F2;
    color: #A05C3F;
}

#cookie-banner a {
    color: #ffffff !important;
    text-decoration: underline !important;
}

#cookie-banner a:hover {
    color: #F3D8C8 !important;
}

#btn-aceptar-cookies {
    background-color: #ffffff !important;
    color: #3D3028 !important;
    border: 1px solid #D8CEC1 !important;
}

#btn-aceptar-cookies:hover {
    background-color: #F5F1EB !important;
}

#descripcion, #requisitos, #beneficios {
    text-align: left !important;
}

#descripcion ul, #requisitos ul, #beneficios ul {
    list-style-type: disc !important;
    margin: 0 0 0 20px !important;
    padding: 0 !important;
    text-align: left !important;
}

#descripcion li, #requisitos li, #beneficios li {
    list-style-type: disc !important;
    margin-bottom: 6px !important;
    text-align: left !important;
    display: list-item !important;
}

#paginacion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.btn-paginacion {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #dcdcdc;
    padding: 8px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-paginacion:hover {
    background-color: #f1f3f5;
    border-color: #b0bec5;
    color: #b45309;  
}

.btn-paginacion.activo {
    background-color: #b45309;
    color: #ffffff;
    border-color: #b45309;  
    box-shadow: 0 4px 8px rgba(177, 38, 38, 0.718);
}

/* -----------------------------------------------------
   8. DISEÑO RESPONSIVO UNIFICADO PARA MÓVILES (FUSIÓN LIMPIA)
  ----------------------------------------------------- */

@media (max-width: 850px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 600px) {
  .contenido-footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media screen and (max-width: 768px) {
    /* Cabecera compacta y fija arriba */
    header {
        position: sticky !important;
        top: 0 !important;
        height: auto !important;
        min-height: fit-content !important;
    }

    .navbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 6px 8px !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Logo y título en línea horizontal */
    .logo-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        margin-bottom: 0 !important;
    }

    .logo-header img {
        height: 22px !important;
        width: 22px !important;
        object-fit: contain;
    }

    .logo-header h1 {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }

    /* Menú de navegación horizontal con scroll táctil suave y fluido */
    .nav-links {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        flex-wrap: nowrap !important; /* Forzamos que se mantengan en una sola línea */
        gap: 12px !important;
        margin: 0 !important;
        padding: 2px 4px !important;
        width: 100% !important;
        overflow-x: auto !important; /* Permite deslizar con el dedo de lado a lado */
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Oculta la barra de scroll en Firefox */
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Oculta la barra de scroll en Chrome, Safari y Edge */
    }

    .nav-links a {
        font-size: 0.78rem !important;
        padding: 2px 0 !important;
        flex-shrink: 0 !important; /* Evita que los textos se compriman o corten */
        white-space: nowrap !important;
        font-weight: 600 !important;
    }

    /* Ajustes generales móviles para contenedores y tarjetas */
    main,
    .contenido-principal {
        margin-top: 15px !important;
        padding: 0 10px !important;
    }

    .grid-vacantes, .container, .row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 10px !important;
    }

    .info-card, .form-card, .card, .vacante {
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 15px !important;
    }

    .contenedor-buscador {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .contenedor-buscador input,
    .contenedor-buscador select,
    .contenedor-buscador button {
        width: 100% !important;
        min-width: 0 !important;
    }
}