/**
 * tienda.css - Estilos principales de la tienda IPECAL
 * Compatible con todos los navegadores modernos
 * Versión optimizada para PHP 8.2
 */

:root {
    --azul-ipecal: #244093;
    --azul-claro: #1a4d8c;
    --azul-oscuro: #1a1a2e;
    --rojo-ipecal: #cc3333;
    --morado: #8224e3;
    --gris-ipecal: #666666;
    --gris-fondo: #f4f6f9;
    --gris-texto: #6c757d;
    --verde-exito: #27ae60;
    --naranja-warning: #f39c12;
    --sombra: 0 5px 15px rgba(36, 64, 147, 0.1);
    --sombra-hover: 0 8px 25px rgba(36, 64, 147, 0.15);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* ============================================ */
/* RESET Y BASE */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gris-fondo);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================ */
/* LOGO */
/* ============================================ */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo-img {
    height: 55px;
    width: auto;
    max-height: 55px;
    object-fit: contain;
}

.logo p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

@media (max-width: 768px) {
    .logo {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
    
    .logo-img {
        height: 45px;
    }
}

/* ============================================ */
/* HEADER - TIENDA */
/* ============================================ */
.tienda-header {
    background: linear-gradient(135deg, var(--azul-ipecal) 0%, var(--azul-claro) 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: var(--sombra);
}

.tienda-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.tienda-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ============================================ */
/* CATÁLOGO */
/* ============================================ */
.catalogo-header {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    box-shadow: var(--sombra);
}

/* ============================================ */
/* FORMULARIO DE BÚSQUEDA */
/* ============================================ */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    min-width: 200px;
}

.search-form input:focus {
    outline: none;
    border-color: var(--azul-ipecal);
    box-shadow: 0 0 0 3px rgba(36, 64, 147, 0.1);
}

.search-form button {
    padding: 12px 30px;
    background: var(--azul-ipecal);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.search-form button:hover {
    background: var(--azul-claro);
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

/* ============================================ */
/* FILTROS */
/* ============================================ */
.filtros-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filtros-section select {
    padding: 8px 15px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.filtros-section select:focus {
    outline: none;
    border-color: var(--azul-ipecal);
}

.vista-toggle {
    display: flex;
    gap: 10px;
}

.vista-icon {
    padding: 5px 12px;
    text-decoration: none;
    color: #666;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.vista-icon:hover {
    background: #f0f0f0;
}

.vista-icon.active {
    background: var(--azul-ipecal);
    color: white;
    border-color: var(--azul-ipecal);
}

/* ============================================ */
/* GRID DE LIBROS */
/* ============================================ */
.libros-container {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.vista-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.vista-lista {
    grid-template-columns: 1fr;
}

/* ============================================ */
/* TARJETA DE LIBRO */
/* ============================================ */
.libro-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.libro-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

.libro-imagen {
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    flex-shrink: 0;
}

.libro-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.libro-card:hover .libro-imagen img {
    transform: scale(1.03);
}

.libro-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.libro-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--azul-ipecal);
    line-height: 1.3;
}

.libro-info .autor {
    color: var(--gris-ipecal);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.precio-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    gap: 5px;
}

.precio {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--rojo-ipecal);
}

.stock {
    font-size: 0.9rem;
}

.in-stock {
    color: var(--verde-exito);
}

.out-of-stock {
    color: var(--rojo-ipecal);
}

/* ============================================ */
/* BOTONES */
/* ============================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    font-weight: 600;
}

.btn-primary {
    background: var(--azul-ipecal);
    color: white;
}

.btn-primary:hover {
    background: var(--azul-claro);
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

.btn-success {
    background: var(--verde-exito);
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

.btn-danger {
    background: var(--rojo-ipecal);
    color: white;
}

.btn-danger:hover {
    background: #a82828;
    transform: translateY(-2px);
    box-shadow: var(--sombra-hover);
}

.btn-block {
    width: 100%;
}

.btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================ */
/* CHECKOUT */
/* ============================================ */
.checkout-container {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--sombra);
}

.checkout-header {
    background: linear-gradient(135deg, var(--azul-ipecal) 0%, var(--azul-claro) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* ============================================ */
/* FORMULARIOS */
/* ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--azul-oscuro);
}

.form-group label .required {
    color: var(--rojo-ipecal);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: var(--azul-ipecal);
    background: white;
    box-shadow: 0 0 0 3px rgba(36, 64, 147, 0.1);
}

.form-control.is-valid {
    border-color: var(--verde-exito);
    background: #f0fdf4;
}

.form-control.is-invalid {
    border-color: var(--rojo-ipecal);
    background: #fef2f2;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-text {
    font-size: 12px;
    color: var(--gris-texto);
    margin-top: 4px;
}

.form-text .text-success {
    color: var(--verde-exito);
}

.form-text .text-danger {
    color: var(--rojo-ipecal);
}

/* ============================================ */
/* CONFIRMACIÓN */
/* ============================================ */
.confirmation-card {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--sombra);
    text-align: center;
}

.confirmation-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.folio-box {
    background: #f0f0f0;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.folio {
    font-size: 2rem;
    font-weight: bold;
    color: var(--azul-ipecal);
    letter-spacing: 2px;
    margin: 10px 0;
}

.order-details {
    text-align: left;
    margin: 30px 0;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th,
.details-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.details-table th {
    width: 30%;
    background: #f5f5f5;
    font-weight: 600;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* ============================================ */
/* ADMIN PANEL */
/* ============================================ */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--azul-oscuro);
    color: white;
    flex-shrink: 0;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo-img {
    height: 50px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 18px;
    margin: 0;
}

.sidebar-header small {
    color: #888;
    font-size: 12px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav a.active {
    background: var(--azul-ipecal);
    color: white;
}

.sidebar-nav a i {
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: var(--gris-fondo);
}

/* ============================================ */
/* TABLAS */
/* ============================================ */
.inventory-table,
.orders-table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow-x: auto;
    box-shadow: var(--sombra);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: var(--azul-ipecal);
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f8f9ff;
}

/* ============================================ */
/* BADGES */
/* ============================================ */
.badge-estado {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

.badge-pendiente { 
    background: #fff3cd; 
    color: #856404; 
}
.badge-pendiente_pago { 
    background: #ffe5b4; 
    color: #000000; 
    font-weight: 700;
}
.badge-pagado { 
    background: #d4edda; 
    color: #155724; 
}
.badge-enviado { 
    background: #cce5ff; 
    color: #004085; 
}
.badge-entregado { 
    background: #d4edda; 
    color: #155724; 
}
.badge-cancelado { 
    background: #f8d7da; 
    color: #721c24; 
}

.badge-metodo-pago {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-transferencia {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.badge-paypal {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #1976d2;
}

.badge-stripe {
    background: #f3e5f5;
    color: #6a1b9a;
    border: 1px solid #9c27b0;
}

.badge-default {
    background: #f5f5f5;
    color: #616161;
    border: 1px solid #bdbdbd;
}

/* ============================================ */
/* STATUS BADGE (genérico) */
/* ============================================ */
.status-badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.status-pendiente {
    background: var(--naranja-warning);
    color: black;
}

.status-confirmado {
    background: var(--azul-ipecal);
    color: white;
}

.status-enviado {
    background: #3498db;
    color: white;
}

.status-entregado {
    background: var(--verde-exito);
    color: white;
}

.status-cancelado {
    background: var(--rojo-ipecal);
    color: white;
}

/* ============================================ */
/* MODAL */
/* ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    padding: 30px;
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--azul-oscuro);
}

.close {
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    color: #888;
    transition: var(--transition);
}

.close:hover {
    color: var(--rojo-ipecal);
}

/* ============================================ */
/* FORM ROW */
/* ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* ALERTAS */
/* ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert i {
    font-size: 20px;
    flex-shrink: 0;
}

/* ============================================ */
/* LOGIN */
/* ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--azul-ipecal), var(--azul-claro));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--sombra);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

/* ============================================ */
/* CARRITO HEADER */
/* ============================================ */
.carrito-header {
    position: relative;
}

.btn-carrito-header {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-carrito-header:hover {
    background: rgba(255,255,255,0.3);
}

.btn-carrito-header span {
    background: var(--naranja-warning);
    color: var(--azul-oscuro);
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================ */
/* BOTÓN CARRITO (AGREDAR) */
/* ============================================ */
.btn-carrito {
    background: var(--verde-exito) !important;
    color: white !important;
    transition: var(--transition);
}

.btn-carrito:hover {
    background: #219a52 !important;
    color: white !important;
    transform: translateY(-2px);
}

.btn-carrito.agregado {
    background: var(--rojo-ipecal) !important;
}

.btn-carrito:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================ */
/* TOAST NOTIFICACIONES */
/* ============================================ */
.toast-carrito {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.toast-carrito.show {
    transform: translateX(0);
}

.toast-carrito .toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: var(--transition);
}

.toast-carrito .toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: var(--verde-exito);
}

.toast-error {
    background: var(--rojo-ipecal);
}

.toast-info {
    background: var(--azul-ipecal);
}

/* ============================================ */
/* LIBROS DESTACADOS - ULTRA COMPACTO */
/* ============================================ */
.libros-destacados {
    background: #f8f9fa;
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.section-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

.section-header .section-title::after {
    left: 0;
    transform: none;
    width: 60px;
}

.ver-todos-link {
    color: var(--azul-ipecal);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.ver-todos-link:hover {
    color: var(--naranja-warning);
}

.libros-grid-compacto {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

@media (max-width: 1300px) {
    .libros-grid-compacto {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1050px) {
    .libros-grid-compacto {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .libros-grid-compacto {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 550px) {
    .libros-grid-compacto {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 400px) {
    .libros-grid-compacto {
        grid-template-columns: 1fr;
    }
}

.libro-card-compacto {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.libro-card-compacto:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.libro-enlace {
    text-decoration: none;
    display: block;
    color: inherit;
}

.libro-portada-compacta {
    background: #f0f2f5;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.libro-portada-compacta img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.libro-card-compacto:hover .libro-portada-compacta img {
    transform: scale(1.02);
}

.portada-sin-imagen {
    font-size: 45px;
    color: var(--azul-ipecal);
    opacity: 0.4;
}

.libro-info-compacta {
    padding: 10px;
    text-align: center;
}

.libro-info-compacta .libro-titulo {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--azul-ipecal);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.libro-info-compacta .libro-autor {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.libro-info-compacta .libro-precio {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--rojo-ipecal);
    margin-bottom: 8px;
}

.btn-compra-rapida {
    background: var(--verde-exito);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-compra-rapida:hover {
    background: #219a52;
}

.empty-message {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    grid-column: 1/-1;
}

.empty-message p {
    margin-bottom: 8px;
    color: #666;
}

/* ============================================ */
/* ANIMACIONES */
/* ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================ */
/* UTILIDADES */
/* ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--gris-texto); }
.text-success { color: var(--verde-exito); }
.text-danger { color: var(--rojo-ipecal); }
.text-warning { color: var(--naranja-warning); }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.no-print { 
    @media print {
        display: none !important;
    }
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar-nav a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .vista-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
        width: 95%;
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .confirmation-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .libro-imagen {
        height: 200px;
    }
    
    .libro-info h3 {
        font-size: 0.95rem;
    }
    
    .precio {
        font-size: 1.2rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input {
        min-width: auto;
    }
}