/**
 * Steam XMR Store - Responsive Fixes for Mobile
 * Version: 1.0 (August 4, 2025)
 */

/* Arreglo para evitar scroll horizontal */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Loader centrado correctamente en móviles */
#steam-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#steam-loader .loader-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Correcciones para menú hamburguesa */
@media (max-width: 768px) {
    /* Posicionar hamburguesa correctamente */
    .hamburger {
        position: relative;
        right: 0;
        z-index: 1002;
    }

    /* Hacer que el menú se deslice desde la derecha correctamente */
    .header_menu {
        position: fixed;
        top: 80px;
        right: -100%; /* Cambiar de -320px a -100% */
        width: 80%; /* Ancho máximo del 80% de la pantalla */
        max-width: 320px; /* Con un máximo de 320px */
        height: calc(100vh - 80px);
        transition: right 0.3s ease;
    }

    /* Asegurar que el menú está visible cuando está abierto */
    .mobile_menu_toggle:checked ~ .header_menu {
        right: 0;
    }

    /* Posicionar correctamente los elementos del menú */
    .header_menu .header_link,
    .header_menu .username,
    .header_menu .balance {
        width: 100%;
        box-sizing: border-box;
    }

    /* Arreglo para el contenido principal */
    .responsive_page_content {
        padding: 2rem 1rem;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Corrección para el header */
    #global_header .content {
        padding: 0 1rem;
        box-sizing: border-box;
        width: 100%;
        justify-content: space-between;
    }

    /* Hacer que los productos se vean correctamente en móvil */
    .product_item {
        grid-template-columns: 40px 80px 1fr 80px;
        gap: 1rem;
        padding: 1rem;
    }

    /* Asegurar que los botones no se desborden */
    .btn_green_white_innerfade, 
    .btn_grey_white_innerfade {
        min-width: auto;
        padding: 8px 16px;
    }
}

/* Fix específico para Firefox */
@-moz-document url-prefix() {
    body {
        overflow-x: hidden;
    }
}

/* Overlay para el menú móvil */
.mobile_menu_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.mobile_menu_toggle:checked ~ .mobile_menu_overlay {
    display: block;
}

/* Ajustes específicos para pantallas muy pequeñas */
@media (max-width: 480px) {
    #global_header .logo {
        max-width: 140px;
    }
    
    .product_item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
    }
    
    .product_item .product_img {
        grid-column: 1;
        grid-row: 1;
        margin: 0 auto;
    }
    
    .product_item .product_details {
        grid-column: 1;
        grid-row: 2;
    }
    
    .product_item .product_actions {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        justify-content: center;
    }
}
