/* ==========================================================================
   PERFIL MOBILE OPTIMIZADO
   Archivo: perfil_mobile.css
   ========================================================================== */

/* 1. REGLAS GLOBALES Y RESET DE GRID */
@media screen and (max-width: 1024px) {

    /* Reset básico */
    html, body {
        overflow-x: hidden; 
        width: 100%;
        margin: 0;
        padding: 0;
        background-color: #f4f6f8;
    }

    /* --- DESACTIVAR GRID SYSTEM DE ESCRITORIO --- */
    body.grid_container {
        display: block !important; /* Crucial: Anula el grid */
        grid-template-areas: none !important;
        grid-template-columns: none !important;
        position: relative;
    }

    /* Ajustar el contenedor principal */
    .main {
        grid-area: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 60px 15px 20px 15px !important; /* Padding superior para la barra menú */
        display: block !important;
        box-shadow: none !important;
    }

    /* Ocultar elementos de escritorio no necesarios */
    .aside_right, 
    .navbar { 
        display: none !important; 
    }

    /* --- MENÚ LATERAL (SIDEBAR OFF-CANVAS) --- */
    .aside_left {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        background: linear-gradient(180deg, #3a8901, #2e6b01);
        z-index: 9999;
        transform: translateX(-100%); /* Oculto por defecto */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 20px;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        display: flex !important; /* Forzar display flex para el contenido interno */
        flex-direction: column;
        overflow-y: auto;
    }

    /* Clase que agrega JS para mostrar el menú */
    .aside_left.mobile-visible {
        transform: translateX(0); 
    }

    /* Estilos internos del menú lateral */
    .aside_left .logo {
        padding: 0 20px 20px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 10px;
    }
    
    .aside_left a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        font-size: 1rem;
    }

    /* Botón flotante de menú (Hamburguesa) */
    .toggle-button {
        display: block !important; /* Asegurar que se vea */
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1000;
        background: #3a8901;
        color: white;
        padding: 8px;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .toggle-button i { font-size: 24px; display: block; }

    /* --- CABECERA DE PERFIL --- */
    .profile-container {
        padding: 0;
        width: 100%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        margin-bottom: 20px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .profile-pic {
        width: 140px;
        height: 140px;
        margin-bottom: 15px;
        border-width: 3px;
    }

    .profile-info { margin-left: 0; }
    .profile-info h1 { font-size: 1.6rem; margin-bottom: 5px; }
    
    .profile-location {
        justify-content: center;
        font-size: 0.95rem;
    }

    /* --- DETALLES Y TARJETAS --- */
    .profile-details-grid {
        grid-template-columns: 1fr; /* Una sola columna */
        gap: 20px;
    }

    .profile-card {
        padding: 20px;
    }

    /* Botones de acción grandes para el dedo */
    .profile-actions-full {
        flex-direction: column;
        gap: 10px;
    }

    .btn-action, .map-btn {
        width: 100%;
        padding: 14px;
        justify-content: center;
        font-size: 1rem;
    }

    /* --- PRODUCTOS (GRID RESPONSIVE) --- */
    .product-grid {
        /* Se adapta: 1 columna en móviles pequeños, 2 en móviles grandes */
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
        gap: 15px;
        padding-bottom: 20px;
    }

    .product-card {
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }

    /* CORRECCIÓN DE IMAGEN MÓVIL (Igual que escritorio) */
    .product-image {
        height: 180px; /* Misma altura controlada */
        width: 100%;
        background-color: #fff;
    }

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* IMPORTANTE: Para que se vea toda la imagen/precio */
    }

    /* Información del producto */
    .product-info { padding: 15px; }
    
    .product-title {
        font-size: 1.1rem;
        height: auto; /* Dejar crecer si es necesario en móvil */
        -webkit-line-clamp: 3; 
    }

    /* Precios en móvil */
    .price-multi-currency {
        background-color: #f1f8e9;
        padding: 10px;
    }

    .price-item {
        font-size: 0.95rem;
    }

    /* Botones de producto */
    .product-actions {
        padding: 12px;
    }
    
    .btn-add-cart {
        padding: 12px;
        font-size: 1rem;
    }

    /* Footer */
    .footer {
        padding: 30px 15px;
        margin-bottom: 60px; /* Espacio extra si hay navegación inferior */
    }
}