/*
Theme Name: Más al Sur
Description: Tema personalizado para Más al Sur, productora audiovisual. Compatible con Elementor y optimizado para Elementor Header & Footer Builder.
Author: Más al Sur
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: masalsur
Tags: elementor, custom-header, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, one-column, two-columns, left-sidebar, e-commerce, right-sidebar, custom-colors, editor-style, featured-images, full-width-template, microformats, post-formats, rtl-language-support, theme-options, threaded-comments, translation-ready, blog, portfolio, photography
*/

:root {
    --color-primary: #15332C;
    --color-secondary: #1B3F36;
    --color-accent: #D1A13C;
    --color-text: #111111;
    --color-text-light: #FFFFFF;
    --color-bg: #FFFFFF;
    --color-bg-dark: #15332C;
    --color-border: #E5E5E5;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

/* Header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

/* Header flex: logo y menú en una sola línea usando .container */
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    min-height: 70px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .site-header .container {
        display: flex;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 0 8px;
    }
    .site-branding {
        justify-content: flex-start;
        width: auto;
    }
    .main-navigation {
        flex: 0 0 auto;
        position: static;
    }
    .menu-toggle {
        display: none;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        padding: 0.3em 0.7em;
        margin-left: 0.5em;
        color: var(--color-primary);
        z-index: 1002;
        position: relative;
    }
    .main-navigation ul {
        display: none;
        background: transparent !important;
    }
    .main-navigation.toggled ul {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        background: #fff;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 1001;
        padding: 1.2rem 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }
}

/* Corregir links del navbar transparente en desktop */
@media (min-width: 901px) {
    .home .site-header:not(.scrolled) .main-navigation a {
        background: transparent !important;
        color: var(--color-text-light) !important;
    }
    .home .site-header:not(.scrolled) .main-navigation a:hover,
    .home .site-header:not(.scrolled) .main-navigation a:focus {
        color: var(--color-accent) !important;
    }
}

.site-branding {
    padding: 0;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.site-title:hover {
    color: #666;
}

/* Logo personalizado */
.custom-logo-link {
    display: inline-block;
    max-width: 150px;
}

.custom-logo-link img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navegación */
.main-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    background: transparent;
    transition: background 0.3s;
}

.home .site-header.scrolled .main-navigation {
    background: #fff;
}

/* Si usas #site-navigation */
#site-navigation {
    background: transparent;
    transition: background 0.3s;
}

.home .site-header.scrolled #site-navigation {
    background: #fff;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: var(--color-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.site-header .main-navigation a:hover,
.site-header .main-navigation a:focus {
    color: var(--color-accent);
}

/* Menú sobre fondo oscuro/transparente (home) */
.home .site-header:not(.scrolled) .main-navigation a,
.home .site-header:not(.scrolled) .menu-toggle .hamburger span {
    color: var(--color-text-light);
    background: var(--color-text-light);
}

/* Contenido principal */
.site-main {
    min-height: 60vh;
    padding: 2rem 0;
}

/* Footer */
.site-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0;
    margin-top: auto;
}

.site-footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Compatibilidad con Elementor */
/* Eliminar reglas que oculten header/footer en .elementor-page */
/* .elementor-page .site-header,
.elementor-page .site-footer {
    display: none;
}

.elementor-page .site-main {
    padding: 0;
} */

/* Responsive */
@media (max-width: 768px) {
    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Utilidades */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Estilos para widgets */
.widget-area {
    margin-bottom: 2rem;
}

.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

/* Estilos para formularios */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Botones */
.btn,
.button,
input[type="submit"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: var(--color-text-light);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn:hover,
.button:hover,
input[type="submit"]:hover {
    background: var(--color-primary);
    color: var(--color-text-light);
}

/* Footer minimalista condensado */
.site-footer.minimal-footer {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 0;
    margin-top: auto;
    font-size: 0.97rem;
    border-top: 1px solid #222;
}

.footer-main {
    padding: 1.2rem 0 0.7rem 0;
}

.footer-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.footer-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.footer-logo .custom-logo-link {
    max-width: 80px;
    display: block;
}

.footer-logo img {
    max-width: 80px;
    height: auto;
    display: block;
}

.footer-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
}

.footer-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

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

.footer-menu a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-size: 0.97rem;
    transition: color 0.2s;
    padding: 0.2em 0.1em;
}

.footer-menu a:hover,
.footer-menu a:focus {
    color: var(--color-primary);
}

.footer-bottom {
    border-top: 1px solid #222;
    padding: 0.7rem 0 0.7rem 0;
    background: #111;
    text-align: center;
}

.footer-copyright {
    color: var(--color-text-light);
    font-size: 0.92rem;
    margin: 0;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .footer-flex {
        flex-direction: column;
        align-items: center;
        gap: 0.7rem;
    }
    .footer-navigation {
        justify-content: center;
        width: 100%;
    }
    .footer-logo {
        justify-content: center;
        width: 100%;
    }
    .footer-menu {
        gap: 0.7rem;
    }
    .footer-main {
        padding: 0.7rem 0 0.4rem 0;
    }
    .footer-bottom {
        padding: 0.4rem 0 0.4rem 0;
    }
}

.footer-logo-link {
    display: block;
    max-width: 150px;
}

.footer-logo-link img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header transparente en la home */
.home .site-header {
    background: transparent;
    box-shadow: none;
    transition: background 0.3s, box-shadow 0.3s;
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    z-index: 1000;
}

.home .site-header .site-title,
.home .site-header .main-navigation a,
.home .site-header .menu-toggle {
    color: #fff;
    transition: color 0.3s;
}

.home .site-header.scrolled {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.home .site-header.scrolled .site-title,
.home .site-header.scrolled .main-navigation a,
.home .site-header.scrolled .menu-toggle {
    color: #222;
}

/* Asegurar contraste en hover */
.home .site-header .main-navigation a:hover,
.home .site-header .main-navigation a:focus {
    color: #ff6b35;
}

@media (max-width: 768px) {
    .home .site-header {
        position: fixed;
    }
}

.site-logo-link {
    display: block;
    max-width: 100px;
    transition: max-width 0.3s;
}

.site-logo-img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: max-width 0.3s, opacity 0.3s;
}

/* Logo sticky (header scrolled) */
.home .site-header.scrolled .site-logo-link {
    max-width: 80px;
}

.home .site-header.scrolled .site-logo-img {
    max-width: 80px;
}

/* Sticky header */
.home .site-header.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    animation: fadeInDown 0.3s;
}

@keyframes fadeInDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive: menú y logo centrados en móvil */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0 8px;
    }
    .main-navigation {
        justify-content: center;
    }
    .site-branding {
        justify-content: center;
        width: 100%;
    }
    .site-logo-link {
        margin: 0 auto;
    }
}

/* Botón flotante back-to-top */
.back-to-top {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background 0.3s, box-shadow 0.3s, transform 0.2s;
    z-index: 9999;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover, .back-to-top:focus {
    background: var(--color-accent);
    color: var(--color-text-light);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transform: translateY(-4px) scale(1.08);
    outline: none;
}

@media (max-width: 600px) {
    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Botón menu-toggle - oculto por defecto, visible en mobile */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.3em 0.7em;
    margin-left: 0.5em;
    color: var(--color-primary);
    z-index: 1002;
    position: relative;
}

/* Mostrar botón en mobile */
@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex !important;
    }
}

/* Color del botón en header transparente (home) */
.home .site-header:not(.scrolled) .menu-toggle {
    color: var(--color-text-light);
}

/* Estilos para el icono hamburguesa */
.menu-toggle .hamburger {
    display: inline-block;
    width: 28px;
    height: 22px;
    position: relative;
}

.menu-toggle .hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s;
}

.menu-toggle .hamburger span:nth-child(1) { top: 0; }
.menu-toggle .hamburger span:nth-child(2) { top: 9px; }
.menu-toggle .hamburger span:nth-child(3) { top: 18px; }

/* Color del icono hamburguesa en header transparente */
.home .site-header:not(.scrolled) .menu-toggle .hamburger span {
    background: var(--color-text-light);
}

/* Menú mobile desplegado */
@media (max-width: 900px) {
    .main-navigation ul {
        display: none;
        background: transparent !important;
    }
    
    .main-navigation.toggled ul {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        background: #fff;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 1001;
        padding: 1.2rem 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }
    
    .main-navigation.toggled ul li a {
        color: var(--color-primary) !important;
        padding: 0.5rem 1rem;
        display: block;
    }
    
    .main-navigation.toggled ul li a:hover,
    .main-navigation.toggled ul li a:focus {
        color: var(--color-accent) !important;
        background: rgba(0,0,0,0.05);
    }
}

h1, h2, h3, h4, h5, h6,
a, .elementor-widget-heading .elementor-heading-title,
.elementor-widget-text-editor a,
.wp-block-heading,
.wp-block-post-title,
.wp-block-post-title a {
    font-family: 'Bebas Neue', Arial, sans-serif !important;
    letter-spacing: 0.03em;
}

/* Asegurar que los links de menús y footer también usen Bebas Neue */
.main-navigation a,
.footer-menu a,
.menu-toggle,
.menu-toggle:focus,
.menu-toggle:active {
    font-family: 'Bebas Neue', Arial, sans-serif !important;
    text-decoration: none !important;
} 