:root {
	/* Premium Colors */
	--primary: #2f80ed;
	--primary-hover: #1e6bd6;
	--secondary: #56ccf2;
	--accent: #27ae60;
	--danger: #eb5757;
	--text-main: #2c3e50;
	--text-light: #7f8c8d;
	--bg-glass: rgba(255, 255, 255, 0.80);
	--bg-glass-dark: rgba(25, 25, 25, 0.45);
	--border-glass: rgba(255, 255, 255, 0.4);
	--shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
	--font-primary: 'Outfit', sans-serif;
}

body, html {
	height: auto;
	min-height: 100vh;
	width: 100%;
	margin: 0;
	font-family: var(--font-primary) !important;
	background-color: #f0f4f8;
	background-image: url('../img/FONDO_1.jpg');
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	color: var(--text-main);
}

/* Typography globals overrides */
h1, h2, h3, h4, h5, h6, .title, .subtitle {
	font-family: var(--font-primary) !important;
	color: var(--text-main) !important;
	letter-spacing: -0.5px;
}
.has-text-white, .has-text-white .title, .has-text-white .subtitle {
	color: #fff !important;
}

/* Global Bulma Overrides to achieve Glassmorphism */
.box, .container-is-fluid, .form-rest, .glass-container, table, .table-container {
	background: var(--bg-glass) !important;
	backdrop-filter: blur(14px) !important;
	-webkit-backdrop-filter: blur(14px) !important;
	border: 1px solid var(--border-glass) !important;
	border-radius: 12px !important;
	box-shadow: var(--shadow-glass) !important;
}

/* Specifically for sections like updates/search/new */
.container.pb-6.pt-6 {
	background: var(--bg-glass);
	backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
	border-radius: 16px;
	box-shadow: var(--shadow-glass);
	padding: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Base generic Containers */
.main-container {
	min-height: calc(100vh - 60px); 
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
}
.main-container > .login,
.main-container > .hero-body {
	height: auto;
	width: 100%;
	max-width: 400px;
	min-width: 300px;
	background: var(--bg-glass);
	backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--border-glass);
	border-radius: 16px;
	box-shadow: var(--shadow-glass);
	padding: 30px;
}

/* Inputs and Forms */
.input, .select select, .textarea {
    background: rgba(255,255,255, 0.6) !important;
    border: 1px solid #d1d5db !important;
    font-family: var(--font-primary);
    border-radius: 8px !important;
    transition: all 0.3s ease;
}
.input:focus, .select select:focus {
    background: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(47, 128, 237, 0.3) !important;
}
.label { color: var(--text-main) !important; font-weight: 600; }

/* Tables */
.table {
    width: 100%;
    background-color: transparent !important;
}
.table th {
    background: rgba(47, 128, 237, 0.1) !important;
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
}
.table td, .table th {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}
.table tr:hover {
    background: rgba(47, 128, 237, 0.05) !important;
}

/* Custom Overrides for Navbar classes */
.navbar {
	background: rgba(255, 255, 255, 0.85) !important;
	backdrop-filter: blur(12px) !important;
	-webkit-backdrop-filter: blur(12px) !important;
	box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(255,255,255,0.6) !important;
    border-radius: 20px !important;
    margin: 15px 20px !important;
    padding: 10px 15px !important;
}
.navbar-link, .navbar-item {
	font-family: var(--font-primary) !important;
	font-weight: 600 !important;
}
.navbar-item.has-dropdown:hover .navbar-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Buttons System */
.button {
    font-family: var(--font-primary) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.button.is-info, .btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(47, 128, 237, 0.3) !important;
}
.button.is-info:hover, .btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(47, 128, 237, 0.4) !important;
}

.button.is-danger {
    background: linear-gradient(135deg, #ef5e44, #b9411c) !important;
    border: none !important;
}
.button.is-success {
    background: linear-gradient(135deg, #22c587, #158072) !important;
    border: none !important;
}

.button.is-primary.is-rounded, .button-is-primary-is-rounded {
	background: transparent !important;
	color: var(--primary) !important;
	border: 2px solid var(--primary) !important;
	border-radius: 30px !important;
	padding: 8px 18px !important;
}
.button.is-primary.is-rounded:hover {
	background: var(--primary) !important;
	color: #fff !important;
}

.button.is-link.is-rounded, .button-is-link-is-rounded {
	background: transparent !important;
	color: var(--danger) !important;
	border: 2px solid var(--danger) !important;
	border-radius: 30px !important;
	padding: 8px 18px !important;
	font-weight: 600;
	transition: all 0.3s ease;
	text-decoration: none;
}
.button.is-link.is-rounded:hover {
	background: var(--danger) !important;
	color: #fff !important;
}

/* Action buttons generic specials */
.btn-premium {
	display: inline-block;
	padding: 12px 28px;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	cursor: pointer;
	text-decoration: none;
}
.btn-premium-alt {
	display: inline-block;
	background: rgba(255, 255, 255, 0.9);
	color: var(--primary) !important;
	padding: 12px 28px;
	border-radius: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	border: 1px solid var(--primary);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
}
.btn-premium-alt:hover {
	transform: translateY(-3px);
	background: white;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}
.animate-fade {
	animation: fadeIn 0.5s ease-out forwards;
}

/* Chatbot Glassmorphism */
.chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 28px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(47, 128, 237, 0.4);
    transition: transform 0.3s ease;
    z-index: 1000;
}
.chat-icon:hover { transform: scale(1.1) translateY(-5px); }

.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 320px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: none;
    overflow: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
}
.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-box {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bot {
    background: white;
    padding: 10px 14px;
    border-radius: 15px 15px 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    width: fit-content;
    max-width: 85%;
    color: var(--text-main);
}
.user {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 10px 14px;
    border-radius: 15px 15px 0 15px;
    align-self: flex-end;
    width: fit-content;
    max-width: 85%;
    box-shadow: 0 2px 5px rgba(47, 128, 237, 0.2);
}
.input-area {
    display: flex;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid var(--border-glass);
}
.input-area input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    background: white;
}
.input-area button {
    padding: 10px 15px;
    margin-left: 10px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

/* Carrito de prestamos overrides */
.carrito-container {
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    color: white;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
.contenido { display: flex; gap: 25px; }
.productos-lista {
    width: 60%;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 5px;
}
.producto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.producto:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}
.producto img { width: 55px; height: 55px; object-fit: cover; border-radius: 10px; }
.imagen-carrito-container { width: 40%; display: flex; flex-direction: column; gap: 15px; align-items: center; }
.imagen-seleccionada img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }

.modal-carrito { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-contenido { background: white; padding: 30px; border-radius: 16px; width: 320px; text-align: center; box-shadow: 0 15px 30px rgba(0,0,0,0.2); animation: aparecer 0.3s ease; }
.modal-botones { display: flex; gap: 10px; margin-top: 10px; }

/* Pendientes CSS defaults */
.boton-devuelto { background: #dc3545; color: white; border: none; padding: 8px 12px; cursor: pointer; border-radius: 5px; }
.devuelto { background: transparent !important; }
.tiempo-extendido { font-weight: bold; color: black; display: block; margin-top: 5px; }
.detalle { display: none; background-color: rgba(255,255,255,0.4); }

/* Product Grid Layout from producto_lista */
.lista-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.producto-box {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.producto-box:hover {
    transform: translateY(-5px);
}

.producto-box img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.precio {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0;
}

.acciones {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    gap: 5px;
}

.acciones .btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    color: white;
    flex: 1;
}

.btn-imagen { background: var(--primary); }
.btn-actualizar { background: var(--accent); }
.btn-eliminar { background: var(--danger); }

/* Carrito Wrapper Layout */
.carrito-wrapper {
    max-width: 1100px;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    padding: 30px;
    border-radius: 18px;
    box-shadow: var(--shadow-glass);
    margin: 50px auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* User / Category Grids fallback */
.table-container {
    padding: 20px;
}

/* Glass Tables specifically for Pendientes */
.table-glass {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: transparent !important;
}
.table-glass th, .table-glass td {
    padding: 16px 15px !important;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}
.table-glass thead th {
    background: rgba(47, 128, 237, 0.1) !important;
    color: var(--primary) !important;
    font-weight: 700;
}
.table-glass tbody tr:hover {
    background: rgba(47, 128, 237, 0.05) !important;
}
.table-glass .devuelto td { 
    background-color: rgba(255, 193, 7, 0.5) !important; 
    color: #1a1a1a !important;
    font-weight: bold;
}
