/* ==========================================================================
   PERFIL UNIFICADO (ESTRUCTURA + ESTILOS ESPECÍFICOS)
   ========================================================================== */

/* 1. RESET Y CONFIGURACIÓN GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ESTRUCTURA DE GRID PRINCIPAL (Traído de index.css) */
body.grid_container {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: #333;
    background: #f5f6fa;
    min-height: 100vh;
    
    display: grid;
    grid-template-areas:
        "aside_left header header"
        "aside_left navbar navbar"
        "aside_left main aside_right"
        "aside_left footer footer";
    
    grid-template-columns: 240px 1fr 280px; /* Sidebar | Contenido | Panel Derecho */
    grid-template-rows: auto auto 1fr auto;
    transition: all 0.3s ease;
}

/* Ocultar botón menú móvil en escritorio */
.toggle-button {
    display: none;
}

/* --- 2. ASIDE LEFT (Menú Lateral - Traído de index.css) --- */
.aside_left {
    grid-area: aside_left;
    background: linear-gradient(180deg, #3a8901, #2e6b01);
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
    z-index: 100;
}

.aside_left .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 1px;
}

.aside_left .logo img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #fff;
}

.aside_left ul {
    list-style: none;
    margin-top: 20px;
}

.aside_left a {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s, padding-left 0.3s;
    font-weight: 500;
}

.aside_left a:hover {
    background: rgba(255, 255, 255, 0.15);
    padding-left: 25px;
}

.aside_left .material-icons {
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

/* Badge del carrito en Sidebar */
.carrito-badge {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    background-color: #ff3d00;
    color: white;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    padding: 0 4px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

/* Submenú */
.submenu {
    background: #265200;
    display: none;
    margin-left: 10px;
    border-left: 3px solid #5cb85c;
}
.has-submenu.open .submenu { display: block; }

/* --- 3. NAVBAR Y HEADER --- */
.header { grid-area: header; width: 100%; }
.header img { width: 100%; height: 100%; object-fit: cover; display: block; }

.navbar {
    grid-area: navbar;
    background: #fff;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 500;
}

/* --- 4. ÁREA PRINCIPAL (MAIN) --- */
.main {
    grid-area: main;
    padding: 20px;
    background: #fff;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}

/* Ocultar panel derecho en perfil si no se usa, o definirlo si existe */
.aside_right {
    grid-area: aside_right;
    background: #f8fff5;
    padding: 20px;
    border-left: 1px solid #e0e0e0;
    display: none; /* Por defecto oculto en perfil para dar más espacio */
}
/* Si quieres mostrar el panel derecho, cambia display: none a display: flex */

/* ==========================================================================
   ESTILOS ESPECÍFICOS DEL PERFIL
   ========================================================================== */

.profile-container {
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
}

/* Cabecera del Perfil */
.profile-header {
    display: flex;
    align-items: center;
    text-align: left;
    margin-bottom: 25px;
    gap: 24px;
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.profile-pic {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #3a8901;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-info h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: #223322;
}

.profile-location {
    font-size: 1rem;
    color: #666;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-status {
    display: inline-block;
    background-color: #eaf7ec;
    color: #1b5e20;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 10px;
}

/* Grid de Detalles del Usuario (Ubicación, Contacto, Bancos) */
.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.profile-card {
    background: #ffffff;
    border: 1px solid #e9ece9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border-top: 4px solid #3a8901;
}

.card-title {
    font-size: 1.2rem;
    color: #256029;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.card-title i { margin-right: 10px; }

.detail-item { margin-bottom: 15px; }
.detail-item span {
    font-weight: 700;
    color: #555;
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.detail-item p { margin: 0; color: #333; }

/* Botones de Acción */
.profile-actions-full {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-action, .map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.primary-btn { background-color: #3a8901; color: white; }
.primary-btn:hover { background-color: #2e6b01; transform: translateY(-2px); }

.secondary-btn { background-color: #fff; color: #555; border: 1px solid #ccc; }
.secondary-btn:hover { background-color: #f5f5f5; transform: translateY(-2px); }

.map-btn {
    background: #f1f8e9;
    color: #33691e;
    border: 1px solid #dcedc8;
}
.map-btn:hover { background: #e8f5e9; transform: translateY(-2px); }

/* ==========================================================================
   PRODUCTOS (Grid y Tarjetas)
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Badges (Etiquetas de Venta/Compra) */
.product-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem; 
    font-weight: bold;   
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.badge-venta { background-color: #2e7d32; color: white; }
.badge-compra { background-color: #e65100; color: white; }

/* IMAGEN DEL PRODUCTO (CORREGIDO PARA VER PRECIOS) */
.product-image {
    width: 100%;
    height: 180px; /* Altura fija controlada */
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra la imagen completa */
    transition: transform 0.3s;
}
.product-card:hover .product-image img { transform: scale(1.05); }

/* Info del Producto */
.product-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    height: 2.6em; /* Limita a 2 líneas aprox */
    overflow: hidden;
}

/* Bloque de Precios */
.price-multi-currency {
    background-color: #f1f8e9;
    border: 1px solid #dcedc8;
    border-radius: 6px;
    padding: 8px;
    margin-top: auto; /* Empuja hacia abajo */
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.price-item .currency-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: #558b2f;
    background: #fff;
    padding: 1px 4px;
    border-radius: 3px;
}

.price-item .currency-value {
    font-weight: 800;
    color: #1b5e20;
}

.product-location {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Botones del Producto (Editar/Eliminar o Carrito) */
.product-actions {
    padding: 10px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 5px;
}

.btn-product {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    text-decoration: none;
}
.view-btn { background: #3a8901; }
.edit-btn { background: #1976D2; }
.delete-btn { background: #D32F2F; }

/* Botón Carrito */
.btn-add-cart {
    width: 100%;
    background: #3a8901;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-add-cart:hover { background: #2e6b01; }

/* --- 6. FOOTER --- */
.footer {
    grid-area: footer;
    background: #2e6b01;
    text-align: center;
    color: white;
    padding: 20px 0;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* --- 7. RESPONSIVE (Móviles y Tablets) --- */
@media screen and (max-width: 1024px) {
    /* Desactivar Grid Complejo en Móvil */
    body.grid_container {
        display: block; /* Flujo normal */
        grid-template-areas: none;
        grid-template-columns: none;
    }

    /* Ocultar elementos de escritorio */
    .aside_left, .aside_right, .navbar {
        display: none; /* Se maneja con perfil_mobile.css o menú desplegable */
    }
    
    /* Ajustes visuales */
    .main { margin: 0; padding: 15px; border-radius: 0; box-shadow: none; }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-details-grid { grid-template-columns: 1fr; }
    
    /* Mostrar toggle button si existe */
    .toggle-button { display: block; font-size: 30px; cursor: pointer; padding: 10px; }
}