/* --- VARIABLES (Paleta Naranja / Blanco / Negro) --- */
:root {
    /* Fondos: Escala de Negros cálidos */
    --bg-dark: #09090b;
    /* Negro casi puro (Zinc 950) */
    --bg-card: #18181b;
    /* Gris muy oscuro (Zinc 900) - Adiós al azul */
    --bg-input: #27272a;
    /* Gris oscuro para inputs */
    --border-color: rgba(255, 255, 255, 0.1);

    /* Acentos: Naranja Fuego */
    --primary: #f97316;
    /* Naranja vibrante (Orange 500) */
    --primary-hover: #ea580c;
    /* Naranja más oscuro para hover */
    --primary-glow: rgba(249, 115, 22, 0.5);
    /* Resplandor naranja */

    --danger: #ef4444;
    /* Rojo se mantiene para errores */
    --danger-glow: rgba(239, 68, 68, 0.4);

    --text-main: #ffffff;
    /* Blanco puro */
    --text-muted: #a1a1aa;
    /* Gris claro (Zinc 400) */

    --font-main: 'Outfit', sans-serif;
}

/* --- RESET & BASICS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- EFECTOS DE FONDO (GLOWS NARANJAS) --- */
.glow-bg {
    position: fixed;
    width: 600px;
    height: 600px;
    /* CAMBIO: Gradiente Naranja a transparente */
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -200px;
    left: -200px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}

/* --- HEADER & NAVBAR --- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.85);
    /* Negro semitransparente */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

/* --- USER MENU (Removed Duplicate) --- */
/* The user menu and dropdown styles were duplicated below. Kept the version at line ~427. */

main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    /* CAMBIO: Gradiente Blanco a Gris (más elegante para contraste negro) */
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    color: transparent;
}

/* --- FORMULARIOS (Removed Duplicate) --- */
/* The form styles were duplicated below. Kept the updated version at line ~540. */


/* --- BOTONES (Estilo Naranja) --- */
button,
.btn {
    display: inline-block;
    /* CAMBIO: Gradiente Naranja a Rojo suave */
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px var(--primary-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- CARDS & LISTS --- */

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s;
}

.user-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    /* Borde naranja al hover */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.user-initial {
    width: 45px;
    height: 45px;
    /* CAMBIO: Gradiente de la inicial */
    background: linear-gradient(135deg, var(--primary), #fdba74);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Ranking List */
.ranking-list {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: 0.2s;
}

.ranking-item:hover {
    background: rgba(249, 115, 22, 0.05);
}

/* Sutil naranja al hover */
.ranking-item:last-child {
    border-bottom: none;
}

/* Perfil */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.profile-img-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid var(--bg-dark);
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3);
    /* Anillo naranja */
    object-fit: cover;
}

/* Buscador */
.search-bar {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Danger Zone */
.danger-zone {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    font-size: 0.85rem;
}

.hidden {
    display: none !important;
}

/* --- USER MENU (Corregido Estilo Naranja) --- */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar:hover {
    border-color: var(--primary);
    /* Borde Naranja */
    box-shadow: 0 0 15px var(--primary-glow);
    /* Resplandor Naranja */
    transform: scale(1.05);
}

/* Estilos del Dropdown */
.dropdown {
    /* Posicionamiento */
    position: absolute;
    top: 120%;
    /* Un poco más abajo del avatar */
    right: 0;
    width: 220px;
    z-index: 1000;

    /* Estética Dark / Orange */
    background-color: #121214;
    /* Fondo muy oscuro, ligeramente distinto a la card */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.9);

    /* Layout interno */
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;

    /* Animación de entrada (Estado Visible) */
    opacity: 1;
    transform: translateY(0);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

/* Lógica para ocultarlo (Compatible con atributo 'hidden' de HTML) */
.dropdown[hidden] {
    display: block !important;
    /* Sobrescribimos display para mantener la transición si se desea, o: */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    /* Oculta visualmente y del lector de pantalla */
}

/* Enlaces dentro del menú */
.dropdown a,
.dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-main);
}

/* Efecto Hover en los enlaces (Naranja) */
.dropdown a:hover {
    background-color: rgba(249, 115, 22, 0.1);
    /* Fondo naranja muy sutil */
    color: var(--primary);
    /* Texto Naranja brillante */
    padding-left: 24px;
    /* Pequeño desplazamiento a la derecha */
}

/* Separador para el Logout */
.dropdown form {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* Botón de Logout (Rojo) */
.dropdown button {
    color: #fca5a5;
    /* Rojo suave por defecto */
}

.dropdown button:hover {
    background-color: rgba(239, 68, 68, 0.1);
    /* Fondo rojo sutil */
    color: #ef4444;
    /* Rojo intenso */
    padding-left: 24px;
}

form p,
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 1. Agregados 'date' y 'url' a la lista principal */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
/* <--- Nuevo */
input[type="url"],
/* <--- Nuevo */
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid #3f3f46;
    /* Zinc 700 */
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;

    /* Esto ayuda a que el calendario nativo del navegador se vea oscuro */
    color-scheme: dark;
}

/* Estado Focus (Naranja) */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
    /* Glow naranja */
}

/* Estado Disabled */
input:disabled {
    background-color: #000;
    border-color: #27272a;
    color: #52525b;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- TRUCO PARA EL ICONO DEL CALENDARIO (DATE) --- */
/* Invierte el color del icono (de negro a blanco) para que se vea en el fondo oscuro */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
    transition: 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* --- PRODUCT CARDS (Teclados) --- */

/* Reutilizamos el grid, pero definimos una tarjeta específica vertical */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    /* Apila elementos verticalmente */
    gap: 1rem;
    transition: all 0.3s ease;
    height: 100%;
    /* Para que todas las cards tengan misma altura en el grid */
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-image-container {
    height: 180px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cabecera: Título y Precio */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.price-tag {
    background: rgba(249, 115, 22, 0.15);
    /* Fondo naranja transparente */
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(249, 115, 22, 0.3);
    white-space: nowrap;
    /* Evita que el precio se rompa en dos líneas */
}

/* Sección de Rating */
.rating-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-icon {
    color: #fbbf24;
    /* Color Dorado/Amber */
    font-size: 1.1rem;
}

.rating-value {
    font-weight: 600;
    color: var(--text-main);
}

.rating-max {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Separador */
.product-divider {
    height: 1px;
    background: var(--border-color);
    width: 100%;
}

/* Footer (Colores) */
.product-footer {
    margin-top: auto;
    /* Empuja el footer al fondo de la tarjeta */
}

.product-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.pill-tag {
    display: inline-block;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    /* Forma de píldora */
    font-size: 0.85rem;
    color: var(--text-main);
}

/* Estado Vacío */
.empty-state {
    grid-column: 1 / -1;
    /* Ocupa todo el ancho del grid */
    text-align: center;
    padding: 4rem;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- DETAIL VIEW (Ficha de Producto - CORREGIDO) --- */

.detail-container {
    max-width: 700px;
    margin: 40px auto;
    /* Margen arriba/abajo para separar del header */
    padding: 0 20px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    /* Nuevo: Asegura estructura flex vertical */
    flex-direction: column;
}

/* Cabecera */
.detail-header-large {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 3rem 2rem;
    /* Mucho espacio interno */
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    /* Nuevo */
    flex-direction: column;
    /* Nuevo */
    gap: 1.5rem;
    /* Separa el título del precio */
    align-items: center;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin: 0;
    /* Quitamos margin default para usar gap */
    line-height: 1.1;
}

.price-tag-large {
    display: inline-block;
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary);
    border: 1px solid rgba(249, 115, 22, 0.4);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Cuerpo con Espaciado */
.detail-body {
    padding: 2rem 3rem;
    /* Espacio a los lados */
    display: flex;
    flex-direction: column;
    gap: 0;
    /* El espacio lo dará el padding de las filas */
}

/* Filas (Aquí está la clave de la separación) */
.detail-row {
    display: flex;
    justify-content: space-between;
    /* Uno a la izq, otro a la derecha */
    align-items: center;
    padding: 1.5rem 0;
    /* Espacio ARRIBA y ABAJO de cada línea */
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    width: 40%;
    /* Asegura que la etiqueta tenga sitio */
}

.detail-value {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: right;
    width: 60%;
    /* El valor ocupa el resto */
    display: flex;
    justify-content: flex-end;
    /* Alinea a la derecha */
}

/* Elementos pequeños */
.user-badge {
    background: var(--bg-input);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Botones de abajo */
.action-buttons {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-bottom: 3rem;
}

/* --- USER PROFILE (Limpieza de estilos en línea) --- */

/* Contenedor del avatar y el punto de estado */
.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.status-indicator {
    position: absolute;
    bottom: 15px;
    right: 10px;
    width: 16px;
    height: 16px;
    background-color: #22c55e;
    /* Verde online */
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
}

/* Efecto de luz detrás de la tarjeta */
.profile-glow-effect {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 250px;
    height: 250px;
    background: var(--primary);
    opacity: 0.15;
    filter: blur(60px);
    border-radius: 50%;
    pointer-events: none;
}

/* Contenedor relativo para el contenido del perfil (z-index) */
.profile-content {
    position: relative;
    z-index: 10;
}

/* Textos del perfil */
.profile-username {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.profile-bio {
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 450px;
    margin: 0 auto 2rem auto;
}

/* Botón "More about me" */
.expand-trigger-container {
    border-bottom: 1px solid var(--primary-glow);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.expand-trigger {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

/* Lista desplegable de detalles */
.expand-content {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    list-style: none;
}

.expand-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.expand-item:last-child {
    border-bottom: none;
}

/* --- SECCIÓN TECLADOS (Separación y Grid) --- */

/* Espaciador principal entre perfil y teclados */
.section-spacer {
    margin-top: 4rem;
    /* Esto arregla el solapamiento */
}

/* Cabecera de la sección (Título + Botón) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Enlace que cubre toda la tarjeta */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    /* Asegura que el enlace cubra la tarjeta */
}

/* --- CORRECCIÓN PARA ENLACES EN TARJETAS --- */

/* Esta clase hace que el enlace ocupe toda la tarjeta y organice el contenido */
.card-link {
    display: flex;
    /* Activa el modo flexible */
    flex-direction: column;
    /* Apila los elementos verticalmente */
    gap: 1rem;
    /* Recupera el espacio entre Título, Estrellas y Footer */
    height: 100%;
    /* Ocupa toda la altura disponible */
    text-decoration: none;
    /* Quita el subrayado por defecto */
    color: inherit;
    /* Hereda el color de texto blanco */
    padding: 20px;
}

/* Opcional: Para asegurar que el hover funcione bien en toda la tarjeta */
.product-card:has(.card-link) {
    padding: 0;
    /* Quitamos padding al LI para dárselo al enlace si fuera necesario */
}

/* Si quieres que TODO el área sea clicable incluyendo el borde, 
   lo ideal es mover el padding de .product-card a .card-link.
   Pero para un arreglo rápido, el bloque de arriba .card-link es suficiente.
*/

/* --- DJANGO MESSAGES (Estilo Error/Orange Dark) --- */

.messages-container {
    position: fixed;
    top: 100px;
    /* Debajo del header */
    right: 50px;
    z-index: 1000;
    width: 100%;
    max-width: 400px;
    flex-direction: column;
    gap: 12px;
    margin-left: 50px;
}

.message {
    position: relative;
    background: var(--bg-card);
    /* Zinc 900 */
    color: var(--text-main);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    width: 70%;
}

/* Estilo específico para ERROR */
.message.error {
    border-left: 4px solid var(--danger);
    /* Rojo de tu paleta */
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-card) 100%);
}

.message.info {
    border-left: 4px solid rgb(0, 204, 255);
    /* Rojo de tu paleta */
    background: linear-gradient(90deg, rgba(68, 142, 239, 0.1) 0%, var(--bg-card) 100%);
}

.message.success {
    border-left: 4px solid rgb(71, 255, 71);
    /* Rojo de tu paleta */
    background: linear-gradient(90deg, rgba(117, 239, 68, 0.1) 0%, var(--bg-card) 100%);
}

.message.error i,
.message.error .message-icon {
    color: var(--danger);
    margin-right: 12px;
    font-size: 1.2rem;
}

/* Botón de cerrar */
.close-message {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0 0 15px;
    transition: 0.2s;
}

.close-message:hover {
    color: white;
}

/* Barra de tiempo (Progress bar abajo) */
.message-timeout {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--danger);
    width: 100%;
    transform-origin: left;
    animation: shrinkWidth 5s linear forwards;
}

/* Animaciones */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shrinkWidth {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Clase para ocultar con salida suave */
.message.fade-out {
    opacity: 0;
    transform: translateX(20px);
    transition: 0.4s ease;
}

/* --- COMPONENT SPECIFIC STYLES --- */

.section-container {
    animation: fadeUp 0.6s ease-out;
}

.component-card {
    border-top: 3px solid var(--primary);
    /* Acento superior naranja */
    justify-content: space-between;
}

.component-type-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 1.5px;
    font-weight: 800;
    margin-bottom: 4px;
    display: block;
}

.component-model {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: -5px;
}

.link-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    text-decoration: none;
}

.link-action:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Icono para el link (si usas FontAwesome) */
.link-action i {
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Ajuste para el grid de componentes */
.user-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Asegura que el contenedor de botones no pegue los elementos */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    /* Oscurece un poco la base */
}

/* Estilo para el ícono de compra si usas FontAwesome */
.action-buttons .btn i {
    margin-right: 8px;
}

/* Mejora la legibilidad del tipo de componente en el detalle */
.detail-header-large .component-type-badge {
    color: var(--primary);
    letter-spacing: 3px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(249, 115, 22, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    /* Fondo sutil oscuro */
    color: var(--text-muted);
    text-decoration: none;
}

/* Hover para los números NO seleccionados */
.pagination-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
    transform: translateY(-2px);
}

/* EL SELECCIONADO: Fondo Blanco, Texto Naranja */
.number-selected {
    background: #ffffff !important;
    /* !important asegura que mate el gradiente del .btn original */
    background-image: none !important;
    color: var(--primary) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2), 0 0 10px var(--primary-glow);
    transform: scale(1.1);
    z-index: 2;
}

/* --- END OF UNUSED REPORTING STYLES --- */


/* --- ENFOQUE EN TIPOGRAFÍA Y CONTRASTE (Dashboard Clean) --- */

/* Contenedor de métricas con jerarquía */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Dato destacado con reflejo */
.data-highlight {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.data-highlight:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.1);
}

.data-value-large {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(to bottom, var(--primary), #ea580c);
    -webkit-background-clip: text;
    color: transparent;
    display: block;
    margin-bottom: 0.5rem;
}

.data-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Decoración numérica para Rankings sin barras */
.ranking-badge {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--primary-glow);
}