/*
 Theme Name:   Astra Child
 Theme URI:    https://yourwebsite.com/astra-child
 Description:  Astra Child Theme
 Author:       Your Name
 Author URI:   https://yourwebsite.com
 Template:     astra
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  astra-child
*/

@import url("../astra/style.css");

/* ========== GLOBAL RESET ========== */
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ========== DESKTOP SIDEBAR ========== */
.site-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 120px;
    height: 100vh;
    background-color: #ffffff;
    padding: 40px 10px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 9999;
}

.site-sidebar .site-branding {
    text-align: center;
}

.site-sidebar nav {
    position: relative;
    flex-grow: 1;
}

.site-sidebar nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
}

.site-sidebar nav ul li {
    padding: 30px 0;
    height: auto;
}

.site-sidebar nav ul li.menu-item-336 {
    padding: 48px 0 !important;
}

.site-sidebar nav ul li a {
    display: inline-block;
    transform: rotate(-90deg);
    transform-origin: center center;
    white-space: nowrap;
    text-decoration: none;
    color: #333;
    font-weight: 400;
    font-size: 0.9rem;
    font-family: "Montserrat", sans-serif;
    text-transform: uppercase;
    transition: color 0.2s ease;
    line-height: 1;
}

.site-sidebar nav ul li a:hover {
    color: #999;
}

.site-sidebar .sidebar-footer {
    font-size: 0.9rem;
    color: #888;
}

.site-main {
    margin-left: 120px;
    flex-grow: 1;
    padding: 0;
}

#primary {
    margin: 0;
    padding: 0;
}

/* ========== MOBILE HEADER ========== */
/* Ocultar en desktop */
.mobile-header,
.mobile-menu {
    display: none;
}

/* Móvil */
@media (max-width: 768px) {
    .site-sidebar {
        display: none;
    }

    .site-main {
        margin-left: 0 !important;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
        background: white;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        z-index: 10000;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    }

    .mobile-header .mobile-logo img {
        height: 40px;
        width: auto;
        max-height: 40px;
    }

    .menu-toggle {
        font-size: 26px;
        background: none;
        border: none;
        cursor: pointer;
        color: #333;
        padding: 5px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .menu-toggle:active,
    .menu-toggle:hover {
        background-color: var(--e-global-color-astglobalcolor2);
        color: #111;
    }

    /* ===== MENÚ MOBILE VERTICAL DESLIZANTE ===== */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 0;
        height: 100vh;
        background: white;
        overflow: hidden;
        transition: width 0.3s ease-in-out;
        z-index: 9999;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .mobile-menu.active {
        width: 100%;
    }

    .mobile-menu-list {
        display: flex;
        flex-direction: column;
        gap: 30px;
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
    }

    .mobile-menu-list li a {
        text-decoration: none;
        font-family: "Montserrat", sans-serif;
        font-size: 1rem;
        text-transform: uppercase;
        color: #333;
        transition: color 0.2s ease;
    }

    .mobile-menu-list li a:hover {
        color: #999;
    }
}

/* ========== HOME CAROUSEL ========== */
.home-carousel .elementor-widget-loop-carousel {
    position: absolute;
    height: 100%;
    width: 100%;
}

.home-carousel .elementor-widget-loop-carousel .swiper {
    height: 100%;
}

/* ========== HOME LOOP ========== */
.obras-home-loop {
    display: flex;
    flex-wrap: wrap;
}

.obras-home-loop .obras-home-loop-item {
    aspect-ratio: 3 / 4;
    box-sizing: border-box;
}

.obras-home-loop .obras-home-loop-item::before {
    content: "";
    display: block;
    padding-top: calc(100% * 4 / 3);
}

.obras-loop-item-title {
    opacity: 0;
    transition: all 1s ease;
}

.obras-loop-item-chevron {
    margin-left: -50%;
    opacity: 0;
    transition: all 1s ease;
}

.obras-home-loop .obras-home-loop-item:hover .obras-loop-item-title {
    opacity: 1;
}

.obras-home-loop .obras-home-loop-item:hover .obras-loop-item-chevron {
    opacity: 1;
    margin-left: 0;
}

.obras-home-loop.first-50 .elementor-grid .e-loop-item:first-child {
    grid-column: span 2 !important;
    aspect-ratio: 3 / 2 !important;
}

.obras-home-loop.first-50 .elementor-loop-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.obras-home-loop.first-50 .elementor-loop-container .e-loop-item {
    aspect-ratio: 3 / 4;
}

.obras-home-loop.first-50 .elementor-loop-container .e-loop-item:first-child {
    grid-column: span 2;
    aspect-ratio: 3 / 2;
}

@media (max-width: 1024px) {
    .elementor-loop-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .elementor-loop-container .e-loop-item:first-child {
        grid-column: span 1;
        aspect-ratio: 3 / 4;
    }
}

@media (max-width: 768px) {
    .elementor-loop-container {
        grid-template-columns: 1fr;
    }
}