/* ============================================================
   NAV MOBILE — Drawer off-canvas + Topbar
   Visible en xs y sm (< 768px) — controlado por media queries
   en header-xs.css / header-md.css / header-lg.css / header-xl.css
   ============================================================ */

/* -----------------------------------------------------------
   TOPBAR MÓVIL
   Barra fija en la parte superior: hamburger | logo | acción
----------------------------------------------------------- */
.aaar-mobile-topbar {
    display: none; /* hidden by default; header-xs.css lo muestra */
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    height: 60px;
    background-color: #f57b0b;
    border-bottom: 3px solid #fbf420;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* Logo en el topbar */
.aaar-mobile-topbar .aaar-mobile-logo img,
.aaar-mobile-topbar .aaar-mobile-logo .custom-logo-link img,
.aaar-mobile-topbar .aaar-mobile-logo .custom-logo {
    max-height: 40px;
    max-width: 120px;
    width: auto;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.aaar-mobile-topbar .aaar-mobile-logo .custom-logo-link {
    display: flex;
    align-items: center;
}

.aaar-mobile-topbar .aaar-mobile-site-name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Placeholder derecha */
.aaar-mobile-topbar-right {
    width: 40px;
}

/* -----------------------------------------------------------
   BOTÓN HAMBURGER
----------------------------------------------------------- */
.aaar-drawer-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.aaar-drawer-toggle:hover,
.aaar-drawer-toggle:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* -----------------------------------------------------------
   OVERLAY (fondo semitransparente detrás del drawer)
----------------------------------------------------------- */
.aaar-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aaar-drawer-overlay.is-open {
    display: block;
    opacity: 1;
}

/* -----------------------------------------------------------
   DRAWER PANEL (off-canvas, desliza desde la izquierda)
----------------------------------------------------------- */
.aaar-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background-color: #1e1e1e;
    z-index: 1070;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.aaar-drawer.is-open {
    left: 0;
}

/* Evitar scroll del body cuando el drawer está abierto */
body.aaar-drawer-open {
    overflow: hidden;
}

/* -----------------------------------------------------------
   DRAWER HEADER (logo + botón X)
----------------------------------------------------------- */
.aaar-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #f57b0b;
    border-bottom: 2px solid #fbf420;
    flex-shrink: 0;
}

/* Logo en el drawer */
.aaar-drawer-logo img,
.aaar-drawer-logo .custom-logo-link img,
.aaar-drawer-logo .custom-logo {
    max-height: 38px;
    max-width: 140px;
    width: auto;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.aaar-drawer-logo .custom-logo-link {
    display: flex;
    align-items: center;
}

.aaar-drawer-site-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

/* Botón cerrar (X) */
.aaar-drawer-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.aaar-drawer-close:hover,
.aaar-drawer-close:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* -----------------------------------------------------------
   DRAWER NAV (menú principal)
----------------------------------------------------------- */
.aaar-drawer-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

/* Items del menú */
.aaar-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aaar-drawer-menu li a {
    display: block;
    color: #f0f0f0;
    text-decoration: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 400;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background-color 0.2s, padding-left 0.2s;
}

.aaar-drawer-menu li a:hover,
.aaar-drawer-menu li.current-menu-item > a {
    background-color: rgba(245, 123, 11, 0.25);
    color: #fbf420;
    padding-left: 28px;
}

/* Sub-menú nivel 2 */
.aaar-drawer-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.2);
    display: none; /* Oculto por defecto */
}

/* Sub-menú visible cuando el ítem tiene is-open */
.aaar-drawer-menu .menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.aaar-drawer-menu .sub-menu li a {
    padding: 11px 20px 11px 36px;
    font-size: 14px;
    color: #cccccc;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.aaar-drawer-menu .sub-menu li a:hover {
    color: #fbf420;
    padding-left: 44px;
    background-color: rgba(245, 123, 11, 0.15);
}

/* -----------------------------------------------------------
   BOTÓN CHEVRON (toggle de sub-menú)
   Inyectado por JS — solo en .aaar-drawer-menu
----------------------------------------------------------- */
.aaar-drawer-menu .menu-item-has-children {
    position: relative;
}

/* El link del ítem padre ocupa el espacio dejando hueco para el chevron */
.aaar-drawer-menu .menu-item-has-children > a {
    padding-right: 48px;
}

.aaar-drawer-chevron {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaaaaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s, background-color 0.2s;
}

.aaar-drawer-chevron:hover,
.aaar-drawer-chevron:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    outline: none;
}

/* Rotar el chevron cuando está abierto */
.aaar-drawer-chevron svg {
    transition: transform 0.25s ease;
}

.aaar-drawer-menu .menu-item-has-children.is-open > .aaar-drawer-chevron svg {
    transform: rotate(180deg);
}

/* -----------------------------------------------------------
   ÁRBOL DE SERVICIOS (render_services_tree)
   Acordeón anidado: Servicios → Categoría/Cliente → sub-ítems
----------------------------------------------------------- */
.aaar-drawer-services {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Encabezado "Servicios" — mismo estilo que los links del menú */
.aaar-drawer-services-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    color: #f0f0f0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.aaar-drawer-services-toggle:hover,
.aaar-drawer-services-toggle:focus {
    background-color: rgba(245, 123, 11, 0.15);
    color: #fbf420;
    outline: none;
}

.aaar-drawer-services-chevron {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.aaar-drawer-services-toggle.is-open .aaar-drawer-services-chevron {
    transform: rotate(180deg);
}

/* Cuerpo del árbol de servicios */
.aaar-drawer-services-body {
    background-color: rgba(0, 0, 0, 0.15);
}

/* Grupo: Por Categoría / Por Cliente */
.aaar-dsvc-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.aaar-dsvc-group-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    color: #cccccc;
    background: transparent;
    border: none;
    padding: 12px 20px 12px 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
}

.aaar-dsvc-group-toggle:hover,
.aaar-dsvc-group-toggle:focus,
.aaar-dsvc-group-toggle.is-open {
    color: #ffffff;
    background-color: rgba(245, 123, 11, 0.1);
    outline: none;
}

.aaar-dsvc-group-toggle svg {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.aaar-dsvc-group-toggle.is-open svg {
    transform: rotate(180deg);
}

/* Lista de ítems (categorías / clientes) */
.aaar-dsvc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aaar-dsvc-item {
    position: relative;
}

.aaar-dsvc-item > a {
    display: block;
    color: #bbbbbb;
    text-decoration: none;
    padding: 10px 48px 10px 44px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s, color 0.2s;
}

.aaar-dsvc-item > a:hover {
    color: #fbf420;
    background-color: rgba(245, 123, 11, 0.12);
}

/* Botón de sub-toggle (categorías con hijos) */
.aaar-dsvc-sub-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 100%;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    color: #888888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s, background-color 0.2s;
}

.aaar-dsvc-sub-toggle:hover,
.aaar-dsvc-sub-toggle:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    outline: none;
}

.aaar-dsvc-sub-toggle svg {
    transition: transform 0.25s ease;
}

.aaar-dsvc-sub-toggle.is-open svg {
    transform: rotate(180deg);
}

/* Sub-listas de sub-categorías */
.aaar-dsvc-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.15);
}

.aaar-dsvc-sub li a {
    display: block;
    color: #999999;
    text-decoration: none;
    padding: 9px 20px 9px 58px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: color 0.2s, background-color 0.2s;
}

.aaar-dsvc-sub li a:hover {
    color: #fbf420;
    background-color: rgba(245, 123, 11, 0.1);
}
