/**
 * ╔═══════════════════════════════════════════════════════════════════════════╗
 * ║                                                                           ║
 * ║     PÁGINAS LEGALES Y 404 - ESTILOS GLOBALES                             ║
 * ║                                                                           ║
 * ║     CSS para política de privacidad, aviso legal, 404, etc.             ║
 * ║     Previene solapamiento con header fijo                                 ║
 * ║     Header con fondo sólido desde el inicio (no transparente)            ║
 * ║                                                                           ║
 * ║     @package KenkatsuTheme
 * ║     @version 1.0
 * ║                                                                           ║
 * ╚═══════════════════════════════════════════════════════════════════════════╝
 */

/* ============================================
   HEADER: FONDO SÓLIDO EN PÁGINAS LEGALES/404
   ============================================ */

/* Forzar header con fondo blanco opaco desde el inicio en páginas legales y 404 */
body.error404 #masthead,
body.page-template-page-politica-privacidad #masthead,
body.page-template-page-aviso-legal #masthead,
body.page-template-templates-page-terminos-condiciones-php #masthead,
html body.error404 #masthead,
html body.page-template-page-politica-privacidad #masthead,
html body.page-template-page-aviso-legal #masthead,
html body.page-template-templates-page-terminos-condiciones-php #masthead {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    padding: 0.4rem 0 !important;
    transition: none !important; /* Evitar transición al cargar */
}

/* Anular reglas de header-fix que fuerzan transparencia (estilos inline y contenedores internos) */
html body.error404 #masthead[style*="background"],
html body.error404 #masthead[style*="background-color"],
html body.page-template-page-politica-privacidad #masthead[style*="background"],
html body.page-template-page-politica-privacidad #masthead[style*="background-color"],
html body.page-template-page-aviso-legal #masthead[style*="background"],
html body.page-template-page-aviso-legal #masthead[style*="background-color"],
html body.page-template-templates-page-terminos-condiciones-php #masthead[style*="background"],
html body.page-template-templates-page-terminos-condiciones-php #masthead[style*="background-color"],
html body.error404 #masthead .kadence-sticky-header,
html body.error404 #masthead .site-header-row-container-inner,
html body.page-template-page-politica-privacidad #masthead .kadence-sticky-header,
html body.page-template-page-politica-privacidad #masthead .site-header-row-container-inner,
html body.page-template-page-aviso-legal #masthead .kadence-sticky-header,
html body.page-template-page-aviso-legal #masthead .site-header-row-container-inner,
html body.page-template-templates-page-terminos-condiciones-php #masthead .kadence-sticky-header,
html body.page-template-templates-page-terminos-condiciones-php #masthead .site-header-row-container-inner {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
}

/* Forzar estado scrolled (evitar transición) */
body.error404 #masthead:not(.scrolled),
body.page-template-page-politica-privacidad #masthead:not(.scrolled),
body.page-template-page-aviso-legal #masthead:not(.scrolled),
body.page-template-templates-page-terminos-condiciones-php #masthead:not(.scrolled),
html body.error404 #masthead:not(.scrolled),
html body.page-template-page-politica-privacidad #masthead:not(.scrolled),
html body.page-template-page-aviso-legal #masthead:not(.scrolled),
html body.page-template-templates-page-terminos-condiciones-php #masthead:not(.scrolled) {
    background: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Logo sin filtro para fondo blanco (logo oscuro) */
body.error404 #masthead .custom-logo,
body.page-template-page-politica-privacidad #masthead .custom-logo,
body.page-template-page-aviso-legal #masthead .custom-logo,
body.page-template-templates-page-terminos-condiciones-php #masthead .custom-logo,
body.error404 #masthead:not(.scrolled) .custom-logo,
body.page-template-page-politica-privacidad #masthead:not(.scrolled) .custom-logo,
body.page-template-page-aviso-legal #masthead:not(.scrolled) .custom-logo,
body.page-template-templates-page-terminos-condiciones-php #masthead:not(.scrolled) .custom-logo {
    filter: none !important;
    opacity: 1 !important;
}

/* Menú con color oscuro para fondo blanco */
body.error404 #masthead #primary-menu > li > a,
body.page-template-page-politica-privacidad #masthead #primary-menu > li > a,
body.page-template-page-aviso-legal #masthead #primary-menu > li > a,
body.page-template-templates-page-terminos-condiciones-php #masthead #primary-menu > li > a,
body.error404 #masthead .main-navigation > ul > li > a,
body.page-template-page-politica-privacidad #masthead .main-navigation > ul > li > a,
body.page-template-page-aviso-legal #masthead .main-navigation > ul > li > a,
body.page-template-templates-page-terminos-condiciones-php #masthead .main-navigation > ul > li > a,
body.error404 #masthead:not(.scrolled) #primary-menu > li > a,
body.page-template-page-politica-privacidad #masthead:not(.scrolled) #primary-menu > li > a,
body.page-template-page-aviso-legal #masthead:not(.scrolled) #primary-menu > li > a,
body.page-template-templates-page-terminos-condiciones-php #masthead:not(.scrolled) #primary-menu > li > a {
    color: var(--kenkatsu-dark) !important;
}

body.error404 #masthead #primary-menu > li > a:hover,
body.page-template-page-politica-privacidad #masthead #primary-menu > li > a:hover,
body.page-template-page-aviso-legal #masthead #primary-menu > li > a:hover,
body.page-template-templates-page-terminos-condiciones-php #masthead #primary-menu > li > a:hover {
    color: var(--kenkatsu-teal) !important;
}

/* ============================================
   PADDING TOP PARA HEADER FIJO
   ============================================ */

/* Compensar header fijo - Aplicar a todas las páginas legales y 404 */
.site-main.page-politica-privacidad,
.site-main.page-aviso-legal,
.site-main.page-terminos-condiciones,
.site-main.error-404,
.error-404 {
    padding-top: 120px !important;
}

/* Si hay admin bar de WordPress */
body.admin-bar .site-main.page-politica-privacidad,
body.admin-bar .site-main.page-aviso-legal,
body.admin-bar .site-main.page-terminos-condiciones,
body.admin-bar .site-main.error-404,
body.admin-bar .error-404 {
    padding-top: 152px !important; /* 120px + 32px admin bar */
}

/* Contenedor principal de contenido */
.site-main {
    min-height: calc(100vh - 120px);
}

/* ============================================
   ESTILOS COMUNES PARA PÁGINAS LEGALES
   ============================================ */

.page-legal-content,
.entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.page-legal-header {
    background: linear-gradient(135deg, var(--kenkatsu-teal-dark) 0%, var(--kenkatsu-teal-darker) 100%);
    color: #FFFFFF;
    padding: 4rem 2rem 3rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.page-legal-header h1 {
    font-family: 'Lora', 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

.page-legal-header p {
    font-family: 'Lato', 'Montserrat', 'Manrope', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 300;
}

/* ============================================
   CONTENIDO DE PÁGINAS LEGALES
   ============================================ */

.page-legal-content section {
    margin-bottom: 3rem;
}

.page-legal-content h2 {
    font-family: 'Lora', 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--kenkatsu-teal-dark);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--kenkatsu-beige);
}

.page-legal-content p {
    font-family: 'Lato', 'Montserrat', 'Manrope', sans-serif;
    line-height: 1.8;
    color: var(--kenkatsu-dark);
    margin-bottom: 1.5rem;
}

.page-legal-content ul,
.page-legal-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
    line-height: 1.8;
}

.page-legal-content li {
    margin-bottom: 0.75rem;
    color: var(--kenkatsu-dark);
}

.page-legal-content a {
    color: var(--kenkatsu-teal-dark);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.page-legal-content a:hover {
    color: var(--kenkatsu-teal);
}

/* ============================================
   ESTILOS PARA 404
   ============================================ */

.error-404 {
    text-align: center;
    padding: 4rem 2rem;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error-404 .page-title {
    font-family: 'Lora', 'Playfair Display', Georgia, serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--kenkatsu-teal-dark);
    margin: 0 0 1rem 0;
}

.error-404 .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-404 p {
    font-size: 1.125rem;
    color: var(--kenkatsu-gray);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.error-404 .search-form {
    max-width: 500px;
    margin: 0 auto 3rem;
}

.error-404 .search-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--kenkatsu-beige);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.error-404 .search-submit {
    background: var(--kenkatsu-teal);
    color: #FFFFFF;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-404 .search-submit:hover {
    background: var(--kenkatsu-teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.error-404-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.error-404-links .btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.error-404-links .btn-primary {
    background: linear-gradient(135deg, var(--kenkatsu-teal) 0%, #0f766e 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.error-404-links .btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, var(--kenkatsu-teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.4);
}

.error-404-links .btn-secondary {
    background-color: transparent;
    color: var(--kenkatsu-teal-dark);
    border: 2px solid var(--kenkatsu-teal-dark);
}

.error-404-links .btn-secondary:hover {
    background-color: var(--kenkatsu-teal-dark);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .site-main.page-politica-privacidad,
    .site-main.page-aviso-legal,
    .site-main.page-terminos-condiciones,
    .site-main.error-404,
    .error-404 {
        padding-top: 100px !important;
    }
    
    body.admin-bar .site-main.page-politica-privacidad,
    body.admin-bar .site-main.page-aviso-legal,
    body.admin-bar .site-main.page-terminos-condiciones,
    body.admin-bar .site-main.error-404,
    body.admin-bar .error-404 {
        padding-top: 132px !important;
    }
    
    .page-legal-content,
    .entry-content {
        padding: 0 1.5rem 3rem;
    }
    
    .page-legal-header {
        padding: 3rem 1.5rem 2rem;
        margin-bottom: 2rem;
    }
    
    .error-404 {
        padding: 3rem 1.5rem;
    }
}

