/* ==========================================
   SECCIÓN OFICINAS (Dashboard Layout & Parallax)
   ========================================== */
.oficinas-section {
    padding: 100px 0;
    position: relative;
    background-image: url('../assets/img/oficinas.jpg');
    background-size: cover;
    background-position: center bottom; 
    background-attachment: fixed;
    overflow: hidden;
}

.oficinas-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(10, 20, 35, 0.7) 15%, rgba(10, 20, 35, 0.7) 100%);
    z-index: 0;
    pointer-events: none;
}

.oficinas-section .container {
    position: relative;
    z-index: 1;
}

/* --- FILA SUPERIOR --- */
.oficinas-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.header-texts h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.8rem;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.header-texts p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.header-badge .badge-outline {
    display: inline-block;
    padding: 0.6rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px; 
    background: rgba(10, 20, 35, 0.6);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* --- DASHBOARD PRINCIPAL (OPTIMIZADO PARA RENDIMIENTO) --- */
.oficinas-dashboard {
    display: grid;
    grid-template-columns: 2.2fr 1fr; 
    gap: 2rem;
    align-items: stretch;
    contain: content; 
}

/* --- LA TARJETA CRISTAL --- */
.tabs-content {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: rgba(13, 27, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden; 
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    will-change: transform, opacity; 
}

/* --- PANELES (TABS) --- */
.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 3rem;
    display: none; 
}

.tab-pane.active {
    display: block;
    animation: fadeInTab 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInTab {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Ajustes del Grid dentro de la tarjeta */
.tab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    height: 100%;
}

.tab-logo img {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.tab-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    height: 100%; 
}

/* --- TEXTOS DENTRO DE LA TARJETA --- */
.tab-info .badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(188, 160, 125, 0.1);
    color: var(--color-gold);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.tab-info h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tab-info p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.tab-info ul {
    list-style: none;
    margin-bottom: 2rem; 
}

.tab-info ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--color-white);
}

.tab-info ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-gold);
}

/* ==========================================
   BOTONES DE ENLACE A LAS OFICINAS
   ========================================== */
.tab-info .btn-office-link {
    display: inline-flex !important; 
    align-items: center;
    gap: 0.8rem;
    margin-top: auto; 
    align-self: flex-start;
    padding: 0.8rem 2.5rem;
    background-color: transparent;
    text-decoration: none !important; 
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-info .btn-office-link .arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.tab-info .btn-office-link:hover .arrow {
    transform: translateX(6px); 
}

/* Colores personalizados por marca */
#gla .tab-info .btn-office-link {
    border: 1px solid #FFD700 !important;
    color: #FFD700 !important;
}
#gla .tab-info .btn-office-link:hover {
    background-color: #FFD700 !important;
    color: #0d1b2a !important; 
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

#golden .tab-info .btn-office-link {
    border: 1px solid var(--color-gold) !important;
    color: var(--color-gold) !important;
}
#golden .tab-info .btn-office-link:hover {
    background-color: var(--color-gold) !important;
    color: #0d1b2a !important;
    box-shadow: 0 10px 20px rgba(188, 160, 125, 0.3);
}

#solbeth .tab-info .btn-office-link {
    border: 1px solid #ff3b3b !important; 
    color: #ff3b3b !important;
}
#solbeth .tab-info .btn-office-link:hover {
    background-color: #ff3b3b !important;
    color: #ffffff !important; 
    box-shadow: 0 10px 20px rgba(255, 59, 59, 0.3);
}

/* --- SIDEBAR DERECHA (Menú Vertical y Logo) --- */
.oficinas-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tabs-nav-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem; 
}

.tab-btn {
    width: 100%;
    text-align: left;
    background: rgba(13, 27, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 1.2rem 1.5rem;
    border-radius: 8px; 
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.tab-btn:hover {
    background: rgba(26, 42, 64, 0.9);
    padding-left: 2rem; 
}

.tab-btn.active {
    background: rgba(26, 42, 64, 0.9);
    border-color: #ffffff;
    box-shadow: -5px 0 0 var(--color-gold); 
}

.sidebar-logo {
    margin-top: 2rem;
    text-align: center;
}

.sidebar-logo img {
    max-width: 300px; 
    width: 100%;     
    opacity: 0.9;     
    transition: all 0.3s ease; 
}

/* ==========================================
   ANIMACIONES DE ENTRADA AL HACER SCROLL
   ========================================== */
.oficinas-top-bar {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.tabs-content {
    opacity: 0;
    transform: translateY(60px); 
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s; 
}

.oficinas-sidebar {
    opacity: 0;
    transform: translateX(40px); 
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.oficinas-section.is-visible .oficinas-top-bar,
.oficinas-section.is-visible .tabs-content,
.oficinas-section.is-visible .oficinas-sidebar {
    opacity: 1;
    transform: translate(0, 0); 
}

/* ==========================================
   RESPONSIVIDAD: MODO COMPACTO TIPO APP
   ========================================== */
@media (max-width: 1024px) {
    .oficinas-dashboard {
        grid-template-columns: 1fr;
    }
    .oficinas-sidebar {
        order: -1; 
        width: 100%;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 2rem;
        margin-bottom: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .tabs-nav-vertical {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    .tab-btn {
        width: auto;
        text-align: center;
        padding: 0.8rem 1.2rem;
    }
    .tab-btn:hover {
        padding-left: 1.2rem; 
    }
    .tab-btn.active {
        box-shadow: none;
        border-color: var(--color-gold);
    }
    .sidebar-logo {
        display: none; 
    }
}

/* ⬅️ LA MAGIA DEL MÓVIL SUCEDE AQUÍ ABAJO */
@media (max-width: 768px) {
    /* 1. Comprimimos el espacio exterior */
    .oficinas-section {
        padding: 40px 0; /* Menos padding para que suba el dashboard */
    }
    
    /* 2. Ocultamos textos secundarios y achicamos título para ahorrar espacio */
    .oficinas-top-bar {
        margin-bottom: 1rem;
        text-align: center;
    }
    .header-texts h2 {
        font-size: 1.8rem;
    }
    .header-texts p, .header-badge {
        display: none; /* Ocultamos esto en móvil, el usuario ya sabe dónde está */
    }

    /* 3. Comprimimos los botones en una sola fila desplazable */
    .oficinas-sidebar {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .tabs-nav-vertical {
        flex-wrap: nowrap; /* Fuerza a estar en 1 sola línea */
        overflow-x: auto; /* Permite deslizar los botones hacia los lados */
        justify-content: flex-start;
        padding-bottom: 5px;
    }
    .tabs-nav-vertical::-webkit-scrollbar {
        display: none; /* Oculta la barra de scroll de los botones */
    }
    .tab-btn {
        flex: 0 0 auto;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* 4. Compactamos la tarjeta y sus textos */
    .tabs-content {
        min-height: 420px; /* Forzamos una altura pequeña fija */
        padding: 0;
    }
    .tab-pane {
        padding: 1.5rem;
    }
    
    .tab-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    /* Hacemos el logo diminuto en celular (GSAP lo seguirá animando perfecto) */
    .tab-logo img {
        height: 50px;
        width: auto;
    }

    /* Comprimimos la tipografía para que todo encaje */
    .tab-info h3 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    .tab-info p {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    .tab-info ul {
        margin-bottom: 1rem;
        text-align: left;
        display: inline-block;
    }
    .tab-info ul li {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    /* El botón abarca todo el ancho para ser tocado fácilmente con el dedo pulgar */
    .tab-info .btn-office-link {
        width: 100%;
        justify-content: center;
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}