/* ========================================
   MOBILE SIDEBAR - SLIDE OUT MENU
   ======================================== */

@media (max-width: 767px) {
    .hide-on-mobile {
        display: none !important;
    }
}
@media (min-width: 768px) {
    .hide-on-desktop {
        display: none !important;
    }
}

/* Wrapper - covers full screen.
   z-index por encima de Crisp (~1000000) para que el chat no tape el menú. */
.slide-out__menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000010;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out__menu-wrapper.active {
    pointer-events: auto;
    visibility: visible;
}

/* Header por encima del slide-out: solo en móvil.
   En desktop UserMenuMobile queda en el DOM con .active (aunque hide-on-desktop),
   y :has() igual matchea y subía el header sobre el overlay original. */
@media (max-width: 767px) {
    body:has(.slide-out__menu-wrapper.active) .header-mobile__content,
    body:has(.slide-out__menu-wrapper.active) .header-mobile,
    body:has(.slide-out__menu-wrapper.active) header {
        background: linear-gradient(180deg, var(--crmpam-bg-primary) 0%, var(--crmpam-bg-color-custom-3) 30%, var(--crmpam-bg-primary) 100%) !important;
        z-index: 10000012 !important;
        position: relative;
    }

    /* Crisp debajo del menú lateral cuando está abierto */
    body:has(.slide-out__menu-wrapper.active) .crisp-client,
    body:has(.slide-out__menu-wrapper.active) .crisp-client .cc-1xry0,
    body:has(.slide-out__menu-wrapper.active) .crisp-client [data-id="chat_opened"],
    body:has(.slide-out__menu-wrapper.active) .crisp-client [aria-label="Chat abierto"],
    body:has(.slide-out__menu-wrapper.active) .crisp-client [role="button"] {
        z-index: 9990 !important;
    }
}

/* Dark overlay behind menu */
.slide-out__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000010;
}

.slide-out__menu-wrapper.active .slide-out__overlay {
    opacity: 1;
}

/* Slide-out panel */
.slide-out__menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding-top: 3.375rem; /* Space for the header */
    background: linear-gradient(180deg, var(--crmpam-bg-primary) 0%, var(--crmpam-bg-color-custom-3) 30%, var(--crmpam-bg-primary) 100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000011;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.slide-out__menu::-webkit-scrollbar {
    width: 4px;
}
.slide-out__menu::-webkit-scrollbar-track {
    background: transparent;
}
.slide-out__menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.slide-out__menu-wrapper.active .slide-out__menu {
    transform: translateX(0);
}

/* ========================================
   SIDE MENU MOBILE - Main container
   ======================================== */
.side-menu-mobile {
    font-family: 'Roboto', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    padding: 20px 16px 24px;
    box-sizing: border-box;
    color: #fff;
    position: relative;
}

/* ========================================
   NAVIGATION SECTIONS
   ======================================== */
.links-menu-side-menu,
.links-menu-side-menu__items {
    font-size: 16px;
    font-family: Roboto, Arial, sans-serif;
    box-sizing: border-box;
    padding: 0;
    margin: 0 0 16px 0;
    text-decoration: none;
    list-style: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .3125rem;
}

.links-menu-side-menu__header {
    color: rgba(149, 131, 160, 0.9);
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    padding: 8px 0 4px 0;
    letter-spacing: 0.3px;
}

.links-menu-side-menu__item {
    font-size: 16px !important;
    font-family: Roboto,Arial,sans-serif !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-decoration: none !important;
    list-style: none !important;
    color: inherit !important;
    display: flex !important;
    align-items: center !important;
    gap: .625rem !important;
    width: 100% !important;
    padding: .3125rem 1.25rem .3125rem .625rem !important;
    border-radius: .625rem !important;
    background: linear-gradient(90deg,#ffffff14,#fff0) !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    cursor: pointer !important;
}

.links-menu-side-menu__item:hover,
.links-menu-side-menu__item:active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.links-menu-side-menu__item svg,
.links-menu-side-menu__item-icon svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: #9583A0;
    color: #9583A0;
    transition: fill 0.2s ease, color 0.2s ease;
}

.links-menu-side-menu__item:hover svg,
.links-menu-side-menu__item:hover .links-menu-side-menu__item-icon svg {
    fill: #fff;
    color: #fff;
}

.links-menu-side-menu__item-label {
    display: flex;
    align-items: center;
}

/* ========================================
   SUPPORT BUTTON
   ======================================== */
.side-menu-mobile__support {
    font-family: Roboto,Arial,sans-serif !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-decoration: none !important;
    list-style: none !important;
    padding: .625rem 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .625rem !important;
    border-radius: .625rem !important;
    background: linear-gradient(345deg, var(--crmpam-bg-color-custom-1) 4.29%, var(--crmpam-bg-color-custom-2) 35.63%, var(--crmpam-bg-color-custom-1) 93.19%) !important;
    color: var(--DarkUI-Text-Text-Regular, #ededed) !important;
    font-size: .875rem !important;
    font-weight: 400 !important;
}

.side-menu-mobile__support:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--crmpam-bg-color-custom-1) 70%, transparent) 0%, color-mix(in srgb, var(--crmpam-bg-color-custom-2) 80%, transparent) 100%);
}

.side-menu-mobile__support svg {
    width: 26px;
    height: 26px;
    opacity: 0.9;
}

/* ========================================
   FOOTER SECTION
   ======================================== */
.side-menu-mobile__footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-menu-mobile__footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.side-menu-mobile__logo img {
    height: 22px;
    opacity: 0.8;
}

/* ========================================
   HEADER MOBILE (replaces auth buttons)
   ======================================== */
.header-mobile__content {
    font-size: 16px !important;
    font-family: Roboto,Arial,sans-serif !important;
    box-sizing: border-box !important;
    margin: 0 0 16px 0 !important;
    text-decoration: none !important;
    list-style: none !important;
    color: inherit !important;
    padding: 0 .875rem !important;
    height: 3.375rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important; 
    overflow: hidden !important; 
}

.header-mobile__container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-mobile__burger {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-mobile__home-link {
    display: flex;
    align-items: center;
}

.header-mobile__button button {
    background: linear-gradient(135deg, var(--crmpam-bg-color-custom-2) 0%, var(--crmpam-bg-color-custom-1) 100%);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================
   USER INFO (logged in)
   ======================================== */
.side-menu-mobile__user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.side-menu-mobile__user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-menu-mobile__user-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.side-menu-mobile__user-balance {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   USER ICON CARD
   ======================================== */
.header-card-mobile {
    font-size: 16px;
    font-family: Roboto, Arial, sans-serif;
    box-sizing: border-box;
    margin: 0;
    text-decoration: none;
    list-style: none;
    color: inherit;
    display: flex;
    padding: .0625rem;
    border-radius: .625rem;
    background: linear-gradient(279.25deg, transparent 28.59%, var(--crmpam-bg-color-custom-1) 102.15%), linear-gradient(281.65deg, var(--crmpam-bg-color-custom-2) 4%, transparent 52.67%);
    flex-shrink: 0;
}

.header-card-mobile--avatar {
    width: 2.625rem;
    height: 2.625rem;
}

.header-card-mobile--header {
    width: auto;
    min-width: 2.625rem;
    cursor: pointer;
}

.header-card-mobile__content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 2.5rem;
    padding: .375rem;
    border-radius: .5625rem;
    background: linear-gradient(180deg, var(--crmpam-bg-color-custom-3), var(--crmpam-bg-primary));
}

.header-card-mobile--avatar .header-card-mobile__content {
    min-height: 0;
    padding: .3125rem;
}

.header-mobile__user {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.header-mobile__user-svg {
    display: block;
    width: 22px;
    height: 22px;
}

.header-card-mobile__desktop-btn {
    display: flex !important;
}

@media (max-width: 1280px) {
    .header-card-mobile--header {
        display: flex;
    }

    .header-card-mobile__desktop-btn {
        display: none !important;
    }
}

@media (min-width: 1281px) {
    .header-card-mobile--header {
        display: none;
    }
}

/* ========================================
   ACCOUNT ACTIONS (logged in)
   ======================================== */
.side-menu-mobile__account-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Section label */
.side-menu-mobile__section-label {
    color: rgba(149, 131, 160, 0.9);
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    padding: 8px 0 4px 0;
    letter-spacing: 0.3px;
}

/* Highlighted links (Novedades) */
.links-menu-side-menu__item--highlighted {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* Deposit button inside sidebar */
.links-menu-side-menu__item--deposit {
    background: linear-gradient(135deg, color-mix(in srgb, var(--crmpam-bg-color-custom-1) 40%, transparent) 0%, color-mix(in srgb, var(--crmpam-bg-color-custom-2) 50%, transparent) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}


.side-menu-mobile__support-icon {
    display: flex;
    align-items: center;
}

/* ========================================
   CRASH GAMES BLOCK — colores desde :root (custom.css)
   ======================================== */
.sidebar-crash-games {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 14px 14px 0 14px;
    margin: 0 -6px;
    width: calc(100% + 12px);
    color: #fff;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    background:
        linear-gradient(160deg, var(--crmpam-bg-color-custom-1) 0%, var(--crmpam-bg-primary) 52%, var(--crmpam-bg-color-custom-3) 100%);
}

.sidebar-crash-games::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/img/sidebar-crash-bg.png") center / cover no-repeat;
    mix-blend-mode: luminosity;
    opacity: 0.45;
    pointer-events: none;
    border-radius: inherit;
}

.sidebar-crash-games__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.sidebar-crash-games__title {
    font-size: 14px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    color: #fff;
}

.sidebar-crash-games__items {
    display: flex;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: -14px;
    position: relative;
    z-index: 1;
}

.sidebar-crash-games__item {
    flex: 1 1 0%;
    min-width: 0;
    border-radius: 12px;
    padding: 12px 2px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.sidebar-crash-games__item-bg {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    z-index: 0;
    background: linear-gradient(180deg, var(--crmpam-bg-color-custom-1) 0%, var(--crmpam-bg-primary) 100%);
}

.sidebar-crash-games__item-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: url("/assets/img/sidebar-crash-item-bg.png") center / cover no-repeat;
    mix-blend-mode: luminosity;
    opacity: 0.4;
    pointer-events: none;
}

.sidebar-crash-games__icon {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.sidebar-crash-games__label {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}
