/*
Theme Name: Mi Tema Moderno Personalizado
Theme URI: https://ejemplo.com/mi-tema/ 
Author: Tu Nombre o Agencia
Author URI: https://ejemplo.com/
Description: Un tema moderno basado en el diseño personalizado, con slideshow, noticias y widgets.
Version: 1.2 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mi-tema-moderno
Tags: custom-background, custom-logo, custom-menu, featured-images, theme-options, translation-ready, blog, portfolio, one-column, two-columns, right-sidebar, left-sidebar, footer-widgets, responsive-layout
Requires at least: 5.0
Tested up to: 6.4 
Requires PHP: 7.4

*/

/* --- Reset Básico y Estilos Generales --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: #333;
    background-color: #fdfdfd;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Color de enlace general */
a {
    text-decoration: none;
    color: #3b5998;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover de enlace general */
a:hover {
    color: #2d4373;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
    /* Heredar color por defecto */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    margin-bottom: 0.5em;
    /* Espacio base para títulos */
}


/* --- Cabecera y Navegación --- */
.site-header {
    background-color: #ffffff;
    color: #000000;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    align-items: center;
}

.logo {
    /* Estilos para el logo si se usa texto */
}

.custom-logo-link img {
    /* Estilos si se usa logo de WP */
    max-height: 50px;
    /* Ajustar altura máxima del logo */
    width: auto;
}

.logo a {
    font-weight: 600;
    font-size: 1.5em;
    color: #000000;
    /* Mantener color específico */
}

.logo a:hover {
    color: #000000;
}


.main-nav {
    /* Quitar márgenes previos */
}

/* Estilos para el UL generado por wp_nav_menu */
/* Ajustar selectores si wp_nav_menu añade clases/contenedores */
.header-actions .main-nav .primary-menu {
    /* Asumiendo que wp_nav_menu usa ul.primary-menu */
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-actions .main-nav .primary-menu li {
    margin-left: 30px;
    /* Espaciado entre items del menú */
}

.header-actions .main-nav .primary-menu li a {
    color: #333;
    /* Color base específico del menú */
    padding: 5px 0;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-decoration: none;
    /* Asegurar no subrayado base */
}

/* Hover menú - Solo animación, sin cambio de color texto */
.header-actions .main-nav .primary-menu li a:hover {
    color: #333;
    /* Mantener color base en hover */
}

/* Subrayado menú - Color del subrayado */
.header-actions .main-nav .primary-menu li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #3b5998;
    /* Color subrayado */
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.header-actions .main-nav .primary-menu li a:hover::after {
    width: 100%;
}

/* Contenedor para iconos y nav en desktop */
.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    /* Espacio entre Nav, Search y MenuToggle */
    margin-left: auto;
    /* Empuja este bloque a la derecha */
}

.menu-toggle {
    display: none;
    /* Oculto en desktop */
    font-size: 1.8em;
    color: #000000;
    padding: 5px;
}

/* Icono de búsqueda */
.search-container {
    /* No necesita order */
}

.search-container .search-toggle {
    font-size: 1.2em;
    color: #333;
    padding: 5px;
    background: none;
    border: none;
}

.search-container .search-toggle:hover {
    color: #3b5998;
}

/* --- Estilos Responsive para el Menú --- */
@media (max-width: 768px) {
    .main-nav {
        /* Contenedor del menú desplegable */
        position: absolute;
        top: 100%;
        /* Debajo de la cabecera */
        left: 0;
        width: 100%;
        z-index: 99;
        margin: 0;
        /* Reset margin */
    }

    .header-actions {
        gap: 5px;
        /* Reducir gap entre iconos en móvil */
    }

    /* Ocultar menú de escritorio y mostrar desplegable */
    .header-actions .main-nav .primary-menu {
        display: none;
        /* Oculto por defecto en móvil */
        flex-direction: column;
        background-color: #ffffff;
        border-top: 1px solid #eee;
        padding: 15px 0;
        text-align: center;
        box-shadow: 0 3px 5px rgba(0, 0, 0, 0.05);
    }

    .header-actions .main-nav .primary-menu.active {
        /* Clase que añade JS */
        display: flex;
        /* Mostrar menú desplegable */
    }

    .header-actions .main-nav .primary-menu li {
        margin: 12px 0;
        margin-left: 0;
    }

    /* Enlaces menú móvil sí cambian color */
    .header-actions .main-nav .primary-menu li a {
        color: #3b5998;
    }

    .header-actions .main-nav .primary-menu li a:hover {
        color: #2d4373;
    }

    .header-actions .main-nav .primary-menu li a::after {
        display: none;
    }


    .menu-toggle {
        display: block;
        /* Mostrar icono menú hamburguesa */
        order: 2;
        /* Menú hamburguesa al final en móvil */
    }

    .search-container .search-toggle {
        display: block;
        /* Asegurar que búsqueda se vea */
        order: 1;
        /* Búsqueda primero en móvil */
    }
}

/* --- Popup de Búsqueda --- */
.search-popup {
    display: none;
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: #212529;
    padding: 25px 30px;
    /* Padding simétrico */
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease-out, top 0.3s ease-out;
}

.search-popup.visible {
    display: block;
    opacity: 1;
    top: 20%;
}

/* Overlay */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.visible {
    display: block;
    opacity: 1;
}

.search-popup form,
.search-popup .search-form {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Icono dentro del área de búsqueda */
.search-popup .search-icon-inside {
    color: #adb5bd;
    font-size: 1.1em;
}


.search-popup input[type="search"],
.search-popup .search-field {
    flex-grow: 1;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid #adb5bd;
    background-color: transparent;
    color: #ffffff;
    font-size: 1.1em;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-popup input[type="search"]::placeholder {
    color: #adb5bd;
    opacity: 0.8;
}

.search-popup input[type="search"]:focus,
.search-popup .search-field:focus {
    border-color: #ffffff;
}

/* Botón de envío tipo círculo (CORREGIDO) */
.search-popup button[type="submit"],
.search-popup .search-submit {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    padding: 0;
    position: relative;
    margin-right: 25px;
    /* Espacio para la X */
    font-size: 0;
    /* Ocultar texto del botón */
    text-indent: -9999px;
    /* Ocultar texto (fallback) */
    overflow: hidden;
    /* Asegurar que el texto no se desborde */
}

/* Icono flecha usando pseudo-elemento (CORREGIDO) */
.search-popup button[type="submit"]::before,
.search-popup .search-submit::before {
    content: "\f061";
    /* Código FontAwesome para flecha derecha */
    font-family: "Font Awesome 6 Free";
    /* Asegurar la fuente correcta */
    font-weight: 900;
    /* Asegurar peso correcto */
    color: #212529;
    /* Color del icono */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    /* Tamaño explícito para el icono */
    line-height: 1;
    text-indent: 0;
    /* Reset indent para el icono */
}

/* Quitar estilos de <i> si no se usa */
.search-popup button[type="submit"] i,
.search-popup .search-submit i {
    display: none;
    /* Ocultar si se usa ::before */
}

.search-popup button[type="submit"]:hover,
.search-popup .search-submit:hover {
    background-color: #e9ecef;
    transform: scale(1.1);
}

/* Botón de cierre */
.close-search {
    position: absolute;
    top: 10px;
    right: 15px;
    transform: none;
    font-size: 1.8em;
    color: #adb5bd;
    line-height: 1;
    background: none;
    border: none;
    padding: 10px;
    z-index: 1002;
}

.close-search:hover {
    color: #ffffff;
}


/* --- Slideshow --- */
.slideshow-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slideshow {
    position: relative;
    width: 100%;
}

.slide {
    width: 100%;
    padding: 40px 0 70px 0;
    background-color: #ffffff;
    /* Fondo blanco por defecto para slides */
    min-height: 400px;
    /* Altura mínima */
}

/* Fondos específicos por slide */
.slide.slide-intro {
    background-color: #feece3;
}

.slide.slide-beauty {
    background-color: #f7eff6;
}

.slide.slide-cine {
    background-color: #f6e8f3;
}

.slide.slide-tv {
    background-color: #eef7f3;
}

.slide.active {
    display: block;
    animation: fadeInSlide 0.8s ease-in-out;
}

.slide:not(.active) {
    display: none;
}

@keyframes fadeInSlide {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

.slide-content-split {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    padding-top: 20px;
}

.slide-image-container {
    flex: 1 1 45%;
    max-width: 45%;
}

.slide-image-container img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slide-text-container {
    flex: 1 1 55%;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-tag {
    display: inline-block;
    color: #ffffff;
    padding: 4px 10px;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.tag-music {
    background-color: #DC4B0B;
}

.tag-beauty {
    background-color: #AF629F;
}

.tag-cine {
    background-color: #a01d7a;
}

.tag-tv {
    background-color: #73AD91;
}

.slide-text-container h2 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.slide-text-container p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 20px;
}

.slide-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.slide-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95em;
    text-decoration: none;
    border: 1px solid transparent;
    color: #ffffff;
}

.slide-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}

.slide-button i {
    font-size: 1.2em;
}

.slide-button.spotify {
    background-color: #1DB954;
}

.slide-button.spotify:hover {
    background-color: #1aa34a;
}

.slide-button.apple {
    background-color: #000000;
}

.slide-button.apple:hover {
    background-color: #333333;
}

.slide-button.shopping {
    background-color: #ff7f50;
}

.slide-button.shopping:hover {
    background-color: #ff6347;
}

.slide-button.video {
    background-color: #3b5998;
}

.slide-button.video:hover {
    background-color: #2d4373;
}

@media (max-width: 768px) {
    .slide {
        padding: 30px 0 60px 0;
    }

    .slide-content-split {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding-top: 10px;
    }

    .slide-image-container,
    .slide-text-container {
        max-width: 90%;
        flex-basis: auto;
        margin: 0 auto;
        align-items: center;
    }

    .slide-text-container h2 {
        font-size: 2em;
    }

    .slide-text-container p {
        font-size: 1em;
    }

    .category-tag {
        align-self: center;
    }

    .slide-buttons {
        justify-content: center;
    }

    .slide-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

.slide-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 12px 18px;
    font-size: 1.8em;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.slide-control:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.slide-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    z-index: 10;
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 6px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    border: none;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active {
    background-color: rgba(0, 0, 0, 0.6);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .slide-control {
        width: 40px;
        height: 40px;
        font-size: 1.4em;
        padding: 8px 12px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .slide-dots {
        bottom: 25px;
    }

    .dot {
        height: 8px;
        width: 8px;
        margin: 0 4px;
    }
}

/* --- Sección Social --- */
.social-section {
    padding: 40px 0;
    text-align: center;
    background-color: #ffffff;
    border-top: 1px solid #eee;
}

.social-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

@media (min-width: 500px) {
    .social-section .container {
        flex-direction: row;
        justify-content: center;
    }
}

.stay-in-touch {
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
}

.social-icons a {
    font-size: 1.8em;
    margin: 0 12px;
    color: #888;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-icons a:hover {
    color: #3b5998;
    transform: scale(1.1);
}

/* --- Sección de Noticias --- */
.news-section {
    padding: 60px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.news-section h2 {
    text-align: center;
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 40px;
    color: #333;
    display: inline-block;
    padding-bottom: 5px;
    border-bottom: 3px solid #3b5998;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-item {
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.news-item-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-item-content {
    padding: 20px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.news-item-title {
    font-size: 1.15em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
}

.news-item-title a {
    color: inherit;
}

.news-item-title a:hover {
    color: #2d4373;
}

.news-read-more {
    display: inline-block;
    width: auto;
    padding: 0;
    background-color: transparent;
    color: #3b5998;
    border-radius: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    text-align: left;
    transition: color 0.3s ease;
    margin-top: 10px;
    position: relative;
    cursor: pointer;
}

.news-read-more::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #2d4373;
    bottom: -3px;
    left: 0;
    transition: width 0.35s ease-out;
}

.news-read-more:hover {
    background-color: transparent;
    transform: none;
    color: #2d4373;
    text-decoration: none;
}

.news-read-more:hover::after {
    width: 100%;
}

.news-read-more i {
    margin-left: 6px;
    font-size: 0.9em;
    transition: transform 0.25s ease-out;
}

.news-read-more:hover i {
    transform: translateX(4px);
}

/* --- Paginación --- */
.pagination {
    display: flex;
    justify-content: center;
    padding: 0;
    margin-top: 40px;
}

.page-item {
    margin: 0 4px;
}

.page-link {
    display: block;
    padding: 8px 14px;
    color: #3b5998;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-size: 0.9em;
}

.page-link:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #2d4373;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #3b5998;
    border-color: #3b5998;
}

.page-item.active .page-link:hover {
    background-color: #2d4373;
    border-color: #2d4373;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: default;
    background-color: #fff;
    border-color: #dee2e6;
    opacity: 0.6;
}

@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 25px;
    }

    .news-section h2 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .news-item-image img {
        height: 180px;
    }

    .news-item-title {
        font-size: 1.1em;
    }

    .news-read-more {
        font-size: 0.9em;
    }

    .pagination {
        margin-top: 30px;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 0.85em;
    }
}

/* --- Área de Widgets --- */
.widget-area {
    padding: 50px 0;
    background-color: #ffffff;
    border-top: 1px solid #eee;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.widget {}

.widget h4 {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #3b5998;
    padding-bottom: 8px;
    display: inline-block;
}

.widget p {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 10px;
}

.widget ul {
    list-style: none;
    padding-left: 0;
}

.widget ul li {
    margin-bottom: 8px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}

.widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget ul li a:hover {
    text-decoration: underline;
}

.widget .slide-button {
    background-color: #6c757d;
    width: auto;
    display: inline-flex;
    font-size: 0.9em;
    padding: 8px 15px;
    color: white;
}

.widget .slide-button:hover {
    background-color: #5a6268;
    color: white;
}

@media (max-width: 992px) {
    .widget-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .widget-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 35px;
    }

    .widget-area {
        padding: 40px 0;
    }

    .widget h4 {
        font-size: 1.2em;
    }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 0;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 0.9em;
}

footer a {
    color: #ffffff;
}

footer a:hover {
    color: #dee2e6;
}

</style>