/* =========================================
   1. VARIABLES Y RESET GENERAL
   ========================================= */
:root {
    --azul-uanl: #004a8f;
    --azul-oscuro: #003366;
    --oro-uanl: #fcb131;
    --blanco: #ffffff;
    --gris-fondo: #f4f7f6; /* Un gris azulado muy suave, más moderno */
    --texto-oscuro: #2c3e50;
    --texto-gris: #6c757d;
    --borde-suave: #e1e4e8;
    --sombra-card: 0 8px 24px rgba(0, 74, 143, 0.08);
    --radio-borde: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--gris-fondo);
    color: var(--texto-oscuro);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. ENCABEZADO (HEADER) PREMIUM
   ========================================= */
header {
    background-color: var(--azul-uanl);
    color: var(--blanco);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--oro-uanl);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.logo span { color: var(--oro-uanl); }

nav ul { display: flex; gap: 25px; }

nav a {
    font-weight: 600;
    opacity: 0.9;
    font-size: 0.95rem;
}
nav a:hover { opacity: 1; color: var(--oro-uanl); }

/* Menú de Usuario */
.user-menu { display: flex; align-items: center; gap: 15px; }
.user-info span { font-weight: 600; font-size: 0.9rem; }
.menu-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.menu-btn:hover { background: var(--oro-uanl); color: var(--azul-uanl); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 10px;
    z-index: 1001;
    border: 1px solid rgba(0,0,0,0.05);
    animation: fadeIn 0.2s ease;
}
.dropdown-content.show { display: block; }

.dropdown-content a {
    color: var(--texto-oscuro);
    padding: 10px 15px;
    border-radius: 8px;
    display: block;
    font-size: 0.9rem;
}
.dropdown-content a:hover {
    background-color: #f0f7ff;
    color: var(--azul-uanl);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   3. FORMULARIOS E INPUTS (MODERNIZADOS)
   ========================================= */
/* Esto arregla lo "feo" y gris de los inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: #333;
    background-color: #ffffff;
    border: 2px solid #e1e4e8; /* Borde sutil */
    border-radius: var(--radio-borde);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    appearance: none; /* Quita estilos nativos feos */
}

input:focus, select:focus, textarea:focus {
    border-color: var(--azul-uanl);
    box-shadow: 0 0 0 4px rgba(0, 74, 143, 0.1); /* Resplandor azul */
}

select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23004a8f%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    cursor: pointer;
}

select:disabled {
    background-color: #f8f9fa;
    color: #999;
    cursor: not-allowed;
    border-color: #eee;
}

.input-group { margin-bottom: 20px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--texto-oscuro);
}

/* =========================================
   4. BOTONES (ESTÁNDAR)
   ========================================= */
button, .btn-auth, .btn-publicar, .btn-contact {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-auth, .btn-publicar {
    background: linear-gradient(135deg, var(--azul-uanl), var(--azul-oscuro));
    color: white;
    padding: 14px;
    border-radius: var(--radio-borde);
    font-weight: bold;
    width: 100%;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(0, 74, 143, 0.2);
}
.btn-auth:hover, .btn-publicar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 74, 143, 0.3);
}

.btn-cancelar {
    background: #fff;
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
}
.btn-cancelar:hover { background: #fff5f5; }

/* =========================================
   5. LOGIN Y REGISTRO (CORREGIDO)
   ========================================= */
/* Esto asegura que el header se quede arriba y el formulario en el centro */
body.auth-page {
    display: flex;
    flex-direction: column; /* Elementos uno debajo del otro */
    min-height: 100vh;
}

.auth-container {
    flex-grow: 1; /* Ocupa todo el espacio sobrante */
    display: flex;
    justify-content: center; /* Centrar horizontalmente */
    align-items: center;     /* Centrar verticalmente */
    padding: 20px;
    width: 100%;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 450px; /* Ancho ideal para el formulario */
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 74, 143, 0.1);
    border-top: 6px solid var(--azul-uanl);
    text-align: left; /* Texto alineado a la izquierda se ve mejor */
}

/* Títulos y textos */
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h2 { margin: 0 0 10px; color: var(--azul-uanl); font-size: 1.8rem; }
.auth-header p { margin: 0; color: #666; font-size: 0.95rem; }

/* Links de abajo */
.switch-auth { margin-top: 25px; text-align: center; font-size: 0.9rem; display: block;}
.switch-auth a { color: var(--azul-uanl); font-weight: bold; }

/* =========================================
   6. PAGINA DE INICIO (HOME)
   ========================================= */
.hero {
    background: linear-gradient(135deg, var(--azul-uanl), #002855);
    color: white;
    text-align: center;
    padding: 60px 20px 90px;
    border-radius: 0 0 40px 40px;
    margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.hero h2 { font-size: 2.2rem; margin-bottom: 10px; }
.hero p { opacity: 0.9; font-size: 1.1rem; max-width: 600px; margin: 0 auto 30px; }

.search-container {
    background: white;
    padding: 8px;
    border-radius: 50px;
    display: flex;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transform: translateY(20px); /* Efecto flotante */
    align-items: center;
    gap: 10px;
}
.search-container .search-input {
    border: none;
    background: transparent;
    box-shadow: none; /* Quitar sombra del input genérico */
    flex: 1;
    min-width: 150px;
}

.search-container .search-select {
    max-width: 250px;
    padding: 10px 15px;
    border-radius: 30px;
    border: 2px solid var(--azul-uanl);
    cursor: pointer;
    font-weight: bold;
    color: var(--azul-uanl);
}

/* Categorías */
.categories-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 40px 0;
}
.cat-chip {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--texto-gris);
    border: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
}
.cat-chip:hover, .cat-chip.active {
    background: var(--azul-uanl);
    color: white;
    border-color: var(--azul-uanl);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 74, 143, 0.2);
}

/* =========================================
   7. PRODUCTOS Y GRID
   ========================================= */
main { max-width: 1200px; margin: 0 auto; padding: 20px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0,0,0,0.02);
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
}

.product-info { padding: 15px; }
.product-info h4 { margin: 0 0 5px; font-size: 1.1rem; }
.price { color: var(--azul-uanl); font-size: 1.3rem; font-weight: 800; margin: 5px 0; display: block;}

.btn-contact {
    display: block;
    width: 100%;
    background: #25D366;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

/* =========================================
   8. VENDER Y UPLOAD
   ========================================= */
.vender-container { max-width: 700px; margin: 40px auto; }
.vender-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--sombra-card);
}

.file-upload-wrapper {
    background: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 12px;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}
.file-upload-wrapper:hover { border-color: var(--azul-uanl); background: #f0f7ff; }
.file-upload-wrapper input {
    position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.preview-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
    display: none;
}

.fila-responsive { display: flex; gap: 20px; margin-bottom: 20px; }
.fila-responsive > div { flex: 1; }

/* =========================================
   9. ADMIN & MAESTROS (Integrados)
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white; padding: 25px; border-radius: 16px;
    text-align: center; box-shadow: var(--sombra-card);
    border-bottom: 4px solid var(--oro-uanl);
}
.stat-card p { font-size: 2.5rem; font-weight: bold; color: var(--azul-uanl); margin: 0; }

.user-row, .profe-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.profe-card { flex-direction: column; text-align: center; border-left: 5px solid var(--azul-uanl); }

/* Etiquetas de Admin */
.badge-admin {
    background: var(--oro-uanl); color: black;
    padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.7rem;
}
.banned { background-color: #ffeaea; border: 1px solid #ff4d4d; }

/* Botones Admin */
.btn-ban { background: #dc3545; color: white; padding: 5px 12px; border-radius: 6px; font-size: 0.8rem; }
.btn-unban { background: #28a745; color: white; padding: 5px 12px; border-radius: 6px; font-size: 0.8rem; }
.btn-verify { background: #1da1f2; color: white; padding: 5px 12px; border-radius: 6px; font-size: 0.8rem; margin-right: 5px; }

/* Navegación de Pestañas Admin */
.admin-tabs { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 5px; }
.tab-btn {
    background: white; border: 1px solid #ddd; color: #666;
    padding: 10px 20px; border-radius: 30px; font-weight: 600; white-space: nowrap;
}
.tab-btn.active { background: var(--azul-uanl); color: white; border-color: var(--azul-uanl); }

/* =========================================
   10. MEDIA QUERIES (MÓVIL Y RESPONSIVO FULL)
   ========================================= */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .hero { padding: 50px 20px 70px; }
}

@media (max-width: 768px) {
    header { flex-direction: column; gap: 8px; padding: 10px 5px; text-align: center; }
    nav ul { gap: 6px; font-size: 0.85rem; flex-wrap: wrap; justify-content: center; padding: 0; }
    nav ul li a { padding: 4px 8px; border-radius: 12px; background: rgba(255,255,255,0.1); }
    .logo h1 { font-size: 1.4rem; margin: 0; }
    
    .hero { border-radius: 0 0 30px 30px; padding-bottom: 60px; padding-top: 30px; }
    .hero h2 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }
    
    .search-container { width: 95%; flex-direction: column; border-radius: 20px; padding: 15px; }
    .search-container .search-input, .search-container .search-select { width: 100%; max-width: none; border-radius: 10px; }
    .search-container .search-select { margin-top: 10px; }
    
    .categories-wrapper { justify-content: flex-start; overflow-x: auto; padding-bottom: 15px; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .cat-chip { white-space: nowrap; }
    
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .product-card img { height: 160px; }
    .product-info h4 { font-size: 0.95rem; }
    .price { font-size: 1.1rem; }
    
    /* Formularios, Tarjetas de Venta y Auth */
    .fila-responsive, .user-row { flex-direction: column; gap: 10px; align-items: stretch; }
    .vender-container { padding: 15px; margin: 20px auto; }
    .vender-card, .auth-card { padding: 25px 20px; box-sizing: border-box; width: 100%; }
    
    /* Stats Grid de Admin / Maestros */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .stat-card p { font-size: 2rem; }
    
    /* Admin Tabs Scroll */
    .admin-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
    
    /* Modales */
    .detalle-grid { grid-template-columns: 1fr; gap: 20px; }
    .foto-principal-container { height: 250px; }
    .product-detail-card { margin: 10px; padding: 20px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; gap: 20px; }
    .product-card img { height: 200px; }
    
    nav ul { flex-direction: row; width: 100%; gap: 6px; justify-content: center; }
    .user-menu { flex-direction: column; width: 100%; margin-top: 5px; }
    
    .stats-grid { grid-template-columns: 1fr; }
    
    .auth-card { padding: 20px 15px; }
    .auth-header h2 { font-size: 1.5rem; }
    
    .profe-header { flex-direction: column; gap: 10px; align-items: center; text-align: center; }
    .profe-info { width: 100%; text-align: center; }
    .btn-calificar { width: 100% !important; margin-top: 10px; }
}
/* --- ARREGLO VISUAL: TARJETAS DE MAESTROS --- */
.profe-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 6px solid var(--azul-uanl); /* Borde azul a la izquierda */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.profe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Parte superior: Nombre a la izq, Botón a la der */
.profe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Alineados arriba */
    margin-bottom: 20px;
    gap: 15px;
}

.profe-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
    line-height: 1.3;
}

.badge-facultad {
    display: inline-block;
    background-color: #f0f2f5;
    color: #666;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Botón de calificar más bonito */
.btn-calificar {
    background-color: var(--oro-uanl);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap; /* Que no se rompa el texto */
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn-calificar:hover {
    background-color: #eec151;
    transform: scale(1.05);
}

/* Rejilla de estadísticas (Popo/Barco/Votos) */
.rating-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 columnas iguales */
    gap: 10px;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-item .icon { font-size: 1.4rem; margin-bottom: 2px; }
.stat-item .value { font-weight: 800; font-size: 1.1rem; color: var(--azul-uanl); }
.stat-item .label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }


/* --- ARREGLO VISUAL: FOOTER (PIE DE PÁGINA) --- */
footer {
    text-align: center; /* Centrar todo el texto */
    padding: 40px 20px;
    background-color: white; /* Fondo blanco para separar */
    margin-top: 60px; /* Separar del contenido de arriba */
    border-top: 1px solid #eee;
    color: #666;
}

footer p {
    margin: 5px 0;
}
/* --- CORRECCIÓN FINAL: TARJETAS DE MAESTROS --- */

/* 1. Contenedor de la tarjeta */
.profe-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 6px solid var(--azul-uanl);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: block; /* Aseguramos que sea bloque */
    width: 100%;
}

/* 2. Cabecera (Nombre + Botón) */
.profe-header {
    display: flex;
    justify-content: space-between; /* Uno a cada extremo */
    align-items: center; /* Centrados verticalmente */
    width: 100%;
    margin-bottom: 20px;
}

/* 3. Información del Profe (Nombre) */
.profe-info {
    text-align: left; /* Forzar alineación izquierda */
    flex: 1; /* Que ocupe todo el espacio disponible */
}

.profe-info h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    white-space: nowrap; /* EVITA QUE EL NOMBRE SE ROMPA EN LÍNEAS */
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-facultad {
    display: inline-block;
    background-color: #eee;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* 4. Botón Calificar (Arreglado para que no sea gigante) */
.btn-calificar {
    background-color: var(--oro-uanl);
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: auto !important; /* IMPORTANTE: No ocupar 100% */
    min-width: 100px;
    flex-shrink: 0; /* Evita que se aplaste */
}
.btn-calificar:hover { background-color: #eec151; }

/* 5. Estadísticas (Cajita gris abajo) */
.rating-grid {
    display: flex;
    justify-content: space-around; /* Distribución equitativa */
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

/* --- CORRECCIÓN FINAL: FOOTER --- */
/* Esto empuja el footer al fondo y centra el contenido */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* Esto hace que el contenido empuje al footer hacia abajo */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

footer {
    width: 100%;
    background: white;
    text-align: center;
    padding: 30px;
    margin-top: auto; /* Truco para pegarlo al fondo */
    border-top: 1px solid #ddd;
}

/* =========================================
   ESTILOS PARA EL MODAL DE PRODUCTO (NUEVO)
   ========================================= */

/* El fondo oscuro */
#modal-producto {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); /* Más oscuro para resaltar */
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* La tarjeta blanca flotante */
.product-detail-card {
    background: white;
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: 90vh; /* Que no se salga de la pantalla */
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow-y: auto; /* Scroll si es muy largo */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Botón de cerrar (X) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    z-index: 10;
}
.close-btn:hover { color: #ff4d4d; }

/* Grid: Foto a la izquierda, Info a la derecha */
.detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 10px;
}

/* Estilo de la Foto Grande */
.foto-principal-container {
    background: #f8f9fa;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    overflow: hidden;
    border: 1px solid #eee;
}
.foto-principal-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra toda la foto sin recortar */
}

/* Estilos de Textos */
.detalle-info h2 { margin-top: 10px; font-size: 1.8rem; color: #333; }

.precio-gigante {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--azul-uanl);
    margin: 10px 0;
}

.fecha-badge {
    background: #eee; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; color: #666;
}

.vendedor-info {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 5px solid var(--oro-uanl);
}
.vendedor-info p { margin: 5px 0; font-size: 0.95rem; }

.descripcion-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.descripcion-box h3 { margin-bottom: 10px; color: #444; }
.descripcion-box p { 
    color: #555; 
    line-height: 1.6; 
    white-space: pre-wrap; /* Respeta los párrafos del usuario */
}

/* Botón de WhatsApp Gigante */
.btn-whatsapp-full {
    display: block;
    background: #25D366;
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 25px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: transform 0.2s;
}
.btn-whatsapp-full:hover { transform: scale(1.02); background: #1ebc57; }

/* Responsivo para Celular (Una sola columna) */
@media (max-width: 768px) {
    .detalle-grid { grid-template-columns: 1fr; gap: 20px; }
    .foto-principal-container { height: 250px; }
    .product-detail-card { padding: 20px; height: 100%; border-radius: 0; }
    .close-btn { top: 10px; right: 15px; }
}
/* =========================================
   ESTILOS DE COMUNIDAD (Rides, Perdidos, Calc)
   ========================================= */

.comunidad-container { max-width: 800px; margin: 30px auto; padding: 20px; }

/* TABS (Botones de arriba) */
.tabs-wrapper { display: flex; gap: 10px; margin-bottom: 25px; overflow-x: auto; }
.tab-btn {
    background: white; border: 2px solid #eee; padding: 12px 20px;
    border-radius: 30px; font-weight: bold; color: #666; white-space: nowrap; flex: 1;
}
.tab-btn.active { background: var(--azul-uanl); color: white; border-color: var(--azul-uanl); }

/* CONTENIDO */
.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

/* FORMULARIOS MINI */
.aviso-box { background: white; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; }
.aviso-box.alerta { border-left: 5px solid #dc3545; }
.form-mini { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.form-mini input, .form-mini select { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 8px; min-width: 150px; }
.btn-publicar-mini { background: var(--oro-uanl); color: black; font-weight: bold; padding: 10px 20px; border-radius: 8px; }

/* GRID DE AVISOS */
.avisos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.aviso-card { background: white; padding: 15px; border-radius: 12px; border: 1px solid #eee; }
.aviso-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.badge { color: white; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; }
.fecha { font-size: 0.75rem; color: #999; }
.aviso-card h4 { margin: 0 0 5px; color: #333; }
.autor { font-size: 0.85rem; color: #666; margin-bottom: 10px; }
.btn-whatsapp-mini { display: block; background: #25D366; color: white; text-align: center; padding: 5px; border-radius: 6px; font-size: 0.9rem; text-decoration: none; }

/* CALCULADORA */
.calc-card { background: white; padding: 30px; border-radius: 20px; text-align: center; max-width: 500px; margin: 0 auto; }
.calc-inputs { display: flex; flex-direction: column; gap: 15px; margin: 20px 0; text-align: left; }
.resultado-box { padding: 20px; border-radius: 10px; margin-top: 20px; transition: 0.3s; }

/* Estados de la calculadora */
.resultado-box.neutro { background: #f8f9fa; color: #666; }
.resultado-box.pasaste { background: #d4edda; color: #155724; border: 2px solid #c3e6cb; }
.resultado-box.reprobado { background: #f8d7da; color: #721c24; border: 2px solid #f5c6cb; }
.resultado-box.pendiente { background: #fff3cd; color: #856404; border: 2px solid #ffeeba; }
/* =========================================
   ESTILOS PREMIUM PARA COMUNIDAD (RIDES, PERDIDOS, CALC) 💎
   ========================================= */

/* Contenedor Principal */
.comunidad-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* --- TABS (BOTONES DE ARRIBA) --- */
.tabs-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow-x: auto; /* Para que en celular deslice si no cabe */
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #f0f4f8;
    color: var(--azul-uanl);
}

.tab-btn.active {
    background: var(--azul-uanl);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 74, 143, 0.3);
}

/* --- CONTENIDO DE LAS PESTAÑAS --- */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}
.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- CAJAS DE FORMULARIO (DONDE PUBLICAS) --- */
.aviso-box {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border-top: 5px solid var(--azul-uanl);
}

.aviso-box h3 { margin-top: 0; color: #333; font-size: 1.4rem; }

.aviso-box.alerta {
    border-top-color: #ff4d4d; /* Rojo para objetos perdidos */
}

.form-mini {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto; /* Estructura en fila para PC */
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

/* Inputs bonitos */
.form-mini input, .form-mini select {
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    background: #f9f9f9;
}
.form-mini input:focus, .form-mini select:focus {
    border-color: var(--azul-uanl);
    background: white;
}

/* Botón Publicar Pequeño */
.btn-publicar-mini {
    background: var(--oro-uanl);
    color: #333;
    font-weight: 800;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(252, 177, 49, 0.3);
}
.btn-publicar-mini:hover {
    transform: translateY(-2px);
    background: #eec151;
}

/* --- GRID DE TARJETAS (DONDE SALEN LOS AVISOS) --- */
.avisos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.aviso-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.aviso-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.aviso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.5px;
}

.fecha { font-size: 0.8rem; color: #999; }

.aviso-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #222;
    line-height: 1.4;
}

.autor {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.btn-whatsapp-mini {
    display: block;
    background: #25D366;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.2s;
}
.btn-whatsapp-mini:hover { background: #1ebc57; }

/* --- CALCULADORA --- */
.calc-card {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    border-top: 6px solid #6c5ce7; /* Morado académico */
}

.calc-inputs {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    text-align: left;
}
.calc-inputs label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 0.9rem;
}
.calc-inputs input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
}

.resultado-box {
    padding: 20px;
    border-radius: 15px;
    margin-top: 10px;
    font-weight: bold;
}
.resultado-box.neutro { background: #f0f0f0; color: #888; }
.resultado-box.pasaste { background: #d1e7dd; color: #0f5132; border: 2px solid #badbcc; }
.resultado-box.reprobado { background: #f8d7da; color: #842029; border: 2px solid #f5c2c7; }
.resultado-box.pendiente { background: #fff3cd; color: #664d03; border: 2px solid #ffecb5; }

/* --- RESPONSIVO (CELULARES) --- */
@media (max-width: 768px) {
    .form-mini {
        grid-template-columns: 1fr; /* Todo en columna */
    }
    .aviso-box { padding: 20px; }
    .tabs-wrapper { padding: 5px; }
}
/* ESTILOS DEL MENÚ DESPLEGABLE */
.user-info {
    position: relative;
    padding: 10px;
}

.dropdown-content {
    display: none; /* Oculto por defecto */
    position: absolute;
    right: 0;
    top: 100%; /* Justo debajo del nombre */
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    text-align: left;
}

.dropdown-content a {
    color: #333 !important; /* Forzamos color negro */
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--azul-uanl) !important;
}

/* LA MAGIA: Mostrar al pasar el mouse */
.user-info:hover .dropdown-content {
    display: block;
}
/* --- ESTILOS DEL MENÚ DE USUARIO --- */

/* Contenedor del nombre y menú */
.user-info {
    position: relative;
    padding: 10px 0;
    display: inline-block;
}

/* El menú desplegable (oculto por defecto) */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

/* Enlaces del menú */
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: 0.2s;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #004a8f; /* Azul UANL */
}

/* LA MAGIA: Mostrar menú al pasar el mouse sobre .user-info */
.user-info:hover .dropdown-content {
    display: block;
}
/* =========================================
   ESTILOS DEL MENÚ DE USUARIO (DROPDOWN)
   ========================================= */

/* Enlace de Login cuando no estás conectado */
.link-login {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
}

/* Botón de Registro */
.btn-register-nav {
    background: var(--oro-uanl);
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
}

/* Contenedor del Usuario (Correo + Puntitos) */
.user-info {
    position: relative;
    display: inline-block;
    padding: 10px 0;
    cursor: pointer;
}

.user-label {
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dots-icon {
    font-size: 1.5rem;
    line-height: 0.5;
}

/* El Menú Desplegable (Caja Blanca) */
.dropdown-content {
    display: none; /* Oculto por defecto */
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.2s;
}

/* Enlaces dentro del menú */
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--azul-uanl);
}

.separator {
    height: 1px;
    background-color: #eee;
    margin: 0;
}

/* --- LA REGLA MÁGICA --- */
/* Muestra el menú cuando pasas el mouse por encima */
.user-info:hover .dropdown-content {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   DARK MODE 🌙 — TODO OSCURO, LETRAS BLANCAS
   ========================================= */
body.dark-mode {
    --gris-fondo: #0d1117;
    --texto-oscuro: #f0f0f0;
    --texto-gris: #b0b0c0;
    --blanco: #161b22;
    --borde-suave: #21262d;
    --sombra-card: 0 4px 12px rgba(0, 0, 0, 0.5);
    background-color: #0d1117 !important;
    color: #f0f0f0 !important;
}

/* === HEADER === */
body.dark-mode header {
    background: #010409 !important;
    border-bottom-color: var(--oro-uanl);
}
body.dark-mode nav a { color: #ccc !important; }
body.dark-mode nav a:hover { color: var(--oro-uanl) !important; }

/* === HERO === */
body.dark-mode .hero {
    background: linear-gradient(135deg, #010409, #0d1117) !important;
}
body.dark-mode .hero h2,
body.dark-mode .hero p { color: #f0f0f0 !important; }

/* === TODOS LOS FONDOS BLANCOS → OSCUROS === */
body.dark-mode main,
body.dark-mode section,
body.dark-mode .product-grid,
body.dark-mode .layout-social,
body.dark-mode .comunidad-container { background: transparent !important; }

body.dark-mode .product-card,
body.dark-mode .post-card,
body.dark-mode .post-creator,
body.dark-mode .sidebar-card,
body.dark-mode .vender-card,
body.dark-mode .vender-container,
body.dark-mode .profe-card,
body.dark-mode .aviso-box,
body.dark-mode .aviso-card,
body.dark-mode .auth-card,
body.dark-mode .login-card,
body.dark-mode .modal-content,
body.dark-mode .product-detail-card,
body.dark-mode .rating-box,
body.dark-mode .comentario-body,
body.dark-mode .search-container,
body.dark-mode .tabs-wrapper {
    background: #161b22 !important;
    color: #f0f0f0 !important;
    border-color: #21262d !important;
}

/* === TODAS LAS LETRAS BLANCAS === */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5,
body.dark-mode p, body.dark-mode span, body.dark-mode label, body.dark-mode div,
body.dark-mode li, body.dark-mode td, body.dark-mode th, body.dark-mode strong,
body.dark-mode .product-info h4,
body.dark-mode .post-info h4,
body.dark-mode .post-info span,
body.dark-mode .post-content,
body.dark-mode .comentario-autor,
body.dark-mode .comentario-texto,
body.dark-mode .comentario-fecha,
body.dark-mode .user-name,
body.dark-mode .user-email,
body.dark-mode .user-facu,
body.dark-mode .stat-label,
body.dark-mode .stat-value,
body.dark-mode .stat-box span,
body.dark-mode .fecha-badge,
body.dark-mode .section-header h3,
body.dark-mode .section-header span,
body.dark-mode .vendedor-info p,
body.dark-mode .descripcion-box p,
body.dark-mode .descripcion-box h3 {
    color: #f0f0f0 !important;
}

body.dark-mode .price { color: var(--oro-uanl) !important; }
body.dark-mode a { color: #58a6ff !important; }
body.dark-mode a:hover { color: var(--oro-uanl) !important; }

/* === INPUTS, SELECT, TEXTAREA === */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .post-creator textarea {
    background: #0d1117 !important;
    color: #f0f0f0 !important;
    border-color: #30363d !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #555 !important;
}
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
    border-color: var(--oro-uanl) !important;
}
body.dark-mode option {
    background: #161b22 !important;
    color: #f0f0f0 !important;
}

/* === MENÚ DESPLEGABLE === */
body.dark-mode .menu-desplegable {
    background: #161b22 !important;
    border-color: #30363d !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
}
body.dark-mode .menu-desplegable a {
    color: #f0f0f0 !important;
    border-bottom-color: #21262d !important;
}
body.dark-mode .menu-desplegable a:hover {
    background: #21262d !important;
    color: var(--oro-uanl) !important;
}
body.dark-mode .menu-desplegable div {
    color: #666 !important;
}

/* === BOTONES === */
body.dark-mode .btn-publicar {
    background: var(--azul-uanl) !important;
    color: white !important;
}
body.dark-mode .btn-cancelar {
    background: #21262d !important;
    color: #f0f0f0 !important;
}
body.dark-mode .action-btn { color: #b0b0c0 !important; }
body.dark-mode .action-btn:hover { background: #21262d !important; }
body.dark-mode .action-btn.liked { color: #f5a623 !important; }

/* === CHIPS / CATEGORÍAS === */
body.dark-mode .cat-chip {
    background: #161b22 !important;
    color: #f0f0f0 !important;
    border-color: #30363d !important;
}
body.dark-mode .cat-chip.active,
body.dark-mode .cat-chip:hover {
    background: var(--azul-uanl) !important;
    color: white !important;
}

/* === TABS === */
body.dark-mode .tab-btn {
    color: #b0b0c0 !important;
    background: transparent !important;
}
body.dark-mode .tab-btn:hover {
    background: #21262d !important;
    color: #f0f0f0 !important;
}
body.dark-mode .tab-btn.active {
    background: var(--azul-uanl) !important;
    color: white !important;
}
body.dark-mode .tabs-wrapper {
    background: #161b22 !important;
}

/* === FOOTER === */
body.dark-mode footer {
    background: #010409 !important;
    color: #b0b0c0 !important;
}
body.dark-mode footer p, body.dark-mode footer span,
body.dark-mode footer button, body.dark-mode footer a {
    color: #b0b0c0 !important;
}

/* === MODALES === */
body.dark-mode .modal > div,
body.dark-mode .modal-content,
body.dark-mode .product-detail-card {
    background: #161b22 !important;
    color: #f0f0f0 !important;
    border-color: #30363d !important;
}
body.dark-mode .modal div[style*="background:#f8f9fa"],
body.dark-mode .modal div[style*="background: #f8f9fa"] {
    background: #0d1117 !important;
}

/* === WHATSAPP BUTTON === */
body.dark-mode .btn-whatsapp-full,
body.dark-mode .btn-whatsapp-mini {
    background: #25d366 !important;
    color: white !important;
}
body.dark-mode .btn-contact {
    background: #25d366 !important;
    color: white !important;
}

/* === BADGES / TAGS === */
body.dark-mode .badge-facultad,
body.dark-mode span[style*="background:#eee"],
body.dark-mode span[style*="background: #eee"],
body.dark-mode span[style*="background:#f0f0f0"],
body.dark-mode span[style*="background: #f0f0f0"] {
    background: #21262d !important;
    color: #b0b0c0 !important;
}

/* === SCROLLBAR === */
body.dark-mode ::-webkit-scrollbar { width: 8px; }
body.dark-mode ::-webkit-scrollbar-track { background: #0d1117; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* === IMÁGENES CON FONDO === */
body.dark-mode .img-container { background: #0d1117 !important; }
body.dark-mode .post-img { border-color: #21262d !important; }

/* === REGLAS SIDEBAR === */
body.dark-mode .sidebar-card div[style*="background: #f8f9fa"],
body.dark-mode .sidebar-card div[style*="background:#f8f9fa"] {
    background: #0d1117 !important;
    border-left-color: var(--azul-uanl) !important;
}
body.dark-mode .stats-row { border-top-color: #21262d !important; }

/* === COMUNIDAD FORMS === */
body.dark-mode .form-mini { background: transparent !important; }
body.dark-mode .btn-publicar-mini {
    background: var(--azul-uanl) !important;
    color: white !important;
}

/* =========================================
   Dark Mode Switch en menú
   ========================================= */
.dark-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}
body.dark-mode .dark-mode-row { color: #f0f0f0 !important; border-bottom-color: #21262d !important; }

.switch-dark {
    position: relative;
    width: 42px;
    height: 22px;
}
.switch-dark input { opacity: 0; width: 0; height: 0; }
.switch-dark .slider-dark {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}
.switch-dark .slider-dark:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
.switch-dark input:checked + .slider-dark {
    background: linear-gradient(135deg, #f5a623, #fcb131);
}
.switch-dark input:checked + .slider-dark:before {
    transform: translateX(20px);
}