/*
Theme Name: ShowBooks
Theme URI: https://plazadeletras.cl/showbooks
Author: Plazadeletras
Author URI: https://plazadeletras.cl
Description: Tema moderno y profesional para autores, escritores, bibliotecas y tiendas de libros. Perfecto para mostrar libros, comics, ebooks y contenido literario. Compatible con WooCommerce, totalmente responsivo y con más de 100 opciones de personalización. Incluye carrusel, mega menu, múltiples secciones configurables y sistema modular completo.
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: showbooks
Tags: blog, e-commerce, education, entertainment, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, mega-menu, one-page, boxed-layout
*/

/* ========================================
   RESET Y BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333333;
    background-color: #ffffff;
    overflow-x: hidden;
}

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

a {
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #e74c3c;
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: 100%;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

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

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

/* ========================================
   HEADER Y NAVEGACIÓN
   ======================================== */

.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2c3e50;
    letter-spacing: -1px;
}

.site-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Navegación Principal */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: #e74c3c;
}

/* Mega Menu Styles */
.nav-menu .menu-item {
    position: relative;
}

.nav-menu .menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.menu-item-has-children:hover > a .mega-menu-arrow {
    transform: rotate(180deg);
}

/* Submenu regular */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 15px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu li {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.sub-menu li:last-child {
    border-bottom: none;
}

.sub-menu a {
    padding: 12px 25px;
    display: block;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.sub-menu a:hover {
    background-color: #f8f9fa;
    color: #F9B135;
    padding-left: 30px;
}

/* Mega Menu Styles */
.mega-menu-parent > .mega-menu {
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 800px;
    max-width: 1000px;
    width: max-content;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    padding: 30px;
}

.mega-menu-parent:hover > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu > .menu-item {
    padding: 0 20px;
    border-right: 1px solid #e0e0e0;
}

.mega-menu > .menu-item:last-child {
    border-right: none;
}

.mega-menu > .menu-item > a {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
    padding: 10px 0 15px;
    border-bottom: 2px solid #F9B135;
    margin-bottom: 15px;
    display: block;
}

.mega-menu .sub-menu {
    position: static;
    box-shadow: none;
    background: transparent;
    min-width: auto;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    border-radius: 0;
}

.mega-menu .sub-menu li {
    border-bottom: none;
}

.mega-menu .sub-menu a {
    padding: 8px 0;
    font-size: 0.95rem;
}

.mega-menu .sub-menu a:hover {
    background: transparent;
    padding-left: 10px;
    color: #F9B135;
}

/* Mega Menu con íconos (opcional) */
.mega-menu .menu-item.with-icon > a::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background-size: contain;
}

/* Indicador visual de mega menu */
.mega-menu-parent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #F9B135, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mega-menu-parent:hover::after {
    opacity: 1;
}

/* Botón de menú móvil */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Iconos de búsqueda y carrito */
.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-icon {
    font-size: 1.3rem;
    color: #2c3e50;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

.header-icon:hover {
    color: #e74c3c;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ========================================
   HERO / BANNER PRINCIPAL
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, #F9B135 0%, #764ba2 100%);
    color: #ffffff;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23ffffff" opacity="0.05"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Overlay para Hero con imagen de fondo */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

/* Hero con imagen de fondo */
.hero-section[style*="background-image"] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.hero-section[style*="background-image"] .hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: 400;
}

.hero-cta {
    display: inline-flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #e74c3c;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-secondary:hover {
    background-color: #ffffff;
    color: #F9B135;
}

/* ========================================
   SECCIONES DE CONTENIDO
   ======================================== */

.content-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   GRID DE LIBROS/PRODUCTOS
   ======================================== */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.book-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.book-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2/3;
    background-color: #ecf0f1;
}

.book-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-thumbnail img {
    transform: scale(1.1);
}

.book-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.book-info {
    padding: 25px;
}

.book-category {
    font-size: 0.85rem;
    color: #F9B135;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    background: transparent !important;
    padding: 0 !important;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.book-author {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.book-excerpt {
    font-size: 0.95rem;
    color: #555555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #e74c3c;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: #f39c12;
    font-size: 0.9rem;
}

.rating-count {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* ========================================
   BLOG / ARTÍCULOS
   ======================================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.post-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 250px;
    background-color: #ecf0f1;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 30px;
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.post-date,
.post-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-category a,
.single-post-meta .post-category a,
.entry-meta .post-category a,
a[rel="category"],
a[rel="category tag"] {
    background: transparent !important;
    background-color: transparent !important;
    color: #7f8c8d !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.post-category a:hover,
.single-post-meta .post-category a:hover,
.entry-meta .post-category a:hover,
a[rel="category"]:hover,
a[rel="category tag"]:hover {
    color: #F9B135 !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Íconos dentro de categorías - sin fondo */
.post-category i,
.post-category .fa-folder,
.post-category .far,
.post-category .fas,
.single-post-meta .post-category i,
.entry-meta .post-category i {
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    color: #F9B135 !important;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-excerpt {
    color: #555555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    color: #F9B135;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.read-more:hover {
    color: #e74c3c;
    gap: 12px;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    padding: 20px;
}

.widget {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #F9B135;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 30px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.footer-widget ul li {
    margin-bottom: 12px;
}

.footer-widget a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-widget a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
}

/* Menú horizontal del footer */
.footer-navigation {
    margin: 20px 0;
}

.footer-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-menu a:hover {
    color: #ffffff;
}

.footer-menu li:not(:last-child)::after {
    content: '|';
    color: #34495e;
    margin-left: 30px;
}

.footer-bottom p {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: #34495e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #e74c3c;
    transform: translateY(-3px);
}

/* ========================================
   PÁGINA ÚNICA (SINGLE POST)
   ======================================== */

.single-post-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 60px 0 40px;
}

.single-post-title {
    font-size: 3rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
}

.single-post-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #7f8c8d;
    font-size: 1rem;
}

.post-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

.entry-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333333;
}

.entry-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 40px 0 20px;
}

.entry-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 30px 0 15px;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content blockquote {
    border-left: 4px solid #F9B135;
    padding-left: 25px;
    margin: 30px 0;
    font-style: italic;
    color: #555555;
    font-size: 1.2rem;
}

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

/* Tablets */
@media screen and (max-width: 768px) {
    .header-inner {
        padding: 15px 20px;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .main-navigation.active {
        left: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #ecf0f1;
    }
    
    .nav-menu a {
        padding: 15px 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Mega Menu en móvil y tablet */
    .mega-menu-parent > .mega-menu {
        position: static;
        transform: none;
        min-width: auto;
        max-width: none;
        width: 100%;
        grid-template-columns: 1fr;
        padding: 0;
        box-shadow: none;
        background: transparent;
        margin-left: 15px;
    }
    
    .mega-menu > .menu-item {
        border-right: none;
        border-bottom: 1px solid #ecf0f1;
        padding: 0;
    }
    
    .mega-menu > .menu-item:last-child {
        border-bottom: none;
    }
    
    .mega-menu-parent:hover > .mega-menu {
        transform: none;
    }
    
    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        transform: none;
        min-width: auto;
        background: transparent;
        border-radius: 0;
        margin-left: 15px;
        padding: 0;
    }
    
    .mega-menu .sub-menu {
        margin-left: 20px;
    }
    
    .menu-item-has-children > .sub-menu {
        display: none;
    }
    
    .menu-item-has-children.open > .sub-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    .mega-menu-arrow {
        margin-left: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .books-grid,
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 30px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .single-post-title {
        font-size: 2.2rem;
    }
}

/* Móviles */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .books-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .entry-content {
        font-size: 1rem;
    }
    
    .single-post-title {
        font-size: 1.8rem;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

.text-center {
    text-align: center;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

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

/* Responsive para menú footer */
@media screen and (max-width: 480px) {
    .footer-menu {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-menu li:not(:last-child)::after {
        display: none;
    }
}

/* ========================================
   BOTÓN BACK TO TOP - Estilo Mejorado
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 50px;
    height: 50px;
    background-color: #e74c3c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.scroll-to-top.show {
    display: flex;
}

@media screen and (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
}
