/**
 * Mobile Navigation & Sidebar Styles
 * Breakpoint: 991px (< 992px = móvil)
 */

/* ========================================
   Mobile Navbar (< 992px)
   ======================================== */
.mobile-navbar {
    display: none;
}

@media (max-width: 992px) {
    .mobile-navbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 10px 15px;
    }

    .desktop-navbar {
        display: none !important;
    }
}

/* Logo móvil */
.mobile-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

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

/* ========================================
   Hamburger Button
   ======================================== */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 5px;
    flex-shrink: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Animación hamburguesa a X */
.mobile-menu-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Desktop Navbar (>= 992px)
   ======================================== */
@media (min-width: 993px) {
    .desktop-navbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .desktop-navbar .navbar-brand {
        display: flex;
        align-items: center;
    }

    .desktop-navbar .navbar-brand img {
        height: auto;
        max-height: 65px;
    }

    .desktop-navbar .nav-menu {
        display: flex;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 30px;
    }

    .desktop-navbar .nav-menu li a {
        color: #333;
        text-decoration: none;
        font-weight: 500;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: color 0.2s ease;
    }

    .desktop-navbar .nav-menu li a:hover {
        color: var(--primary-color, #AF997F);
    }
}

/* ========================================
   Overlay
   ======================================== */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.mobile-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Sidebar Panel
   ======================================== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.is-open {
    transform: translateX(-320px);
}

/* Prevenir scroll del body cuando el sidebar está abierto */
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========================================
   Sidebar Header
   ======================================== */
.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mobile-sidebar-logo img {
    max-width: 188px;
    height: auto;
}

.mobile-sidebar-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-sidebar-close:hover {
    background: #e0e0e0;
}

.close-icon {
    font-size: 24px;
    line-height: 1;
    color: #333;
}

/* ========================================
   Navigation List
   ======================================== */
.mobile-sidebar-nav {
    padding: 20px 0;
    flex-shrink: 0;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-list li {
    margin: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background-color: #f8f8f8;
    color: var(--primary-color, #AF997F);
    border-left-color: var(--primary-color, #AF997F);
}

.mobile-nav-link .nav-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.7;
}

/* ========================================
   Divider
   ======================================== */
.mobile-sidebar-divider {
    height: 1px;
    background: #eee;
    margin: 10px 24px;
}

/* ========================================
   Contact Section
   ======================================== */
.mobile-sidebar-contact {
    padding: 15px 24px;
    flex-shrink: 0;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin: 0 0 12px 0;
}

.mobile-contact-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.mobile-contact-link:hover {
    color: var(--primary-color, #AF997F);
}

.mobile-contact-link .contact-icon {
    margin-right: 10px;
    font-size: 16px;
    opacity: 0.7;
}

/* ========================================
   Social Icons
   ======================================== */
.mobile-sidebar-social {
    padding: 15px 24px;
    flex-shrink: 0;
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background: var(--primary-color, #AF997F);
    color: #fff;
}

/* ========================================
   CTA Button
   ======================================== */
.mobile-sidebar-cta {
    padding: 20px 24px;
    margin-top: auto;
    flex-shrink: 0;
}

.btn-cta-mobile {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-color, #AF997F);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-cta-mobile:hover {
    background: var(--primary-color-dark, #8a7a64);
    color: #fff;
    transform: translateY(-1px);
}

/* ========================================
   Footer
   ======================================== */
.mobile-sidebar-footer {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.mobile-sidebar-footer p {
    margin: 0;
    font-size: 12px;
    color: #999;
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .mobile-sidebar,
    .mobile-sidebar-overlay,
    .mobile-menu-btn span {
        transition: none;
    }
}

.mobile-nav-link:focus-visible,
.mobile-sidebar-close:focus-visible,
.social-icon:focus-visible,
.btn-cta-mobile:focus-visible,
.mobile-menu-btn:focus-visible {
    outline: 2px solid var(--primary-color, #AF997F);
    outline-offset: 2px;
}
