/* --- LAYOUT GENERAL --- */
.layout-perfil {
    display: flex;
    flex-direction: row; /* Asegura que se pongan en fila */
    gap: 40px;
    max-width: 1100px;
    margin: 30px auto;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    align-items: flex-start;
}

/* --- ASIDE (IZQUIERDA) --- */
.sidebar-perfil {
    flex: 0 0 250px; /* Ancho fijo para el menú lateral */
    position: sticky;
    top: 20px;
}

.perfil-container {
    text-align: center;
}

.avatar-circulo {
    width: 100px;
    height: 100px;
    background-color: #1a1e29;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 20px;
}

.usuario-nombre {
    margin: 10px 0 5px;
    font-size: 20px;
    color: #000;
    font-weight: bold;
}

.usuario-email {
    color: #5a6e6f;
    font-size: 14px;
    margin: 0;
}
/*RESUMEN*
/* Contenedor de la sección blanca */
.seccion {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

/* Título de la sección con la línea inferior */
.seccion-titulo {
    font-size: 15px;
    font-weight: 500;
    color: #1a1c2c;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 0.5px solid #e0e0e0;
}

/* Cuadrícula para las 3 columnas */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

/* Tarjetas individuales de estadísticas */
.stat {
    background: #f7f7f8;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

/* El número grande */
.stat-num {
    font-size: 22px;
    font-weight: 500;
    color: #1a1c2c;
}

/* La etiqueta pequeña debajo del número */
.stat-label {
    font-size: 12px;
    color: #595959;
    margin-top: 2px;
}
/*Pedidos*/
/* --- CONTENEDOR DE LA SECCIÓN --- */
.seccion {
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

.seccion-titulo {
    font-size: 15px;
    font-weight: 500;
    color: #1a1c2c;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 0.5px solid #e0e0e0;
}

/* --- ESTRUCTURA DE CADA PEDIDO --- */
.item-pedido {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid #f0f0f0;
}

.item-pedido:last-child {
    border-bottom: none;
}

/* --- IMAGEN Y TEXTOS --- */
.item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #ebebeb;
    flex-shrink: 0;
    overflow: hidden; /* Asegura que la imagen no se salga de los bordes redondeados */
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-nombre {
    font-size: 14px;
    font-weight: 500;
    color: #1a1c2c;
}

.item-sub {
    font-size: 12px;
    color: #595959;
    margin-top: 2px;
}

.item-precio {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
    color: #1a1c2c;
    white-space: nowrap;
}

.btn-cancelar-pedido {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a32d2d;
    background: #fcebeb;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}

.btn-cancelar-pedido:hover {
    background: #f8d7d7;
}

/* --- Modal cancelar pedido --- */
.modal-cancelar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,28,44,.5);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-cancelar-box {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 22px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 16px 40px rgba(0,0,0,.15);
}

.modal-cancelar-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1c2c;
    margin: 0 0 6px;
}

.modal-cancelar-desc {
    font-size: 0.88rem;
    color: #595959;
    margin: 0 0 20px;
}

.modal-cancelar-acciones {
    display: flex;
    gap: 10px;
}

.modal-cancelar-acciones button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    background: #f0f0f0;
    color: #666;
    transition: background .15s;
}

.modal-cancelar-acciones button:hover { background: #e5e5e5; }

.modal-cancelar-acciones .btn-confirmar-cancelar {
    background: #e31b23;
    color: #fff;
}

.modal-cancelar-acciones .btn-confirmar-cancelar:hover { background: #b3141a; }

/* --- ESTADOS (BADGES) --- */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
}

.badge-verde {
    background: #eaf3de;
    color: #3b6d11; /* Para el estado "Listo" */
}

.badge-rojo {
    background: #fcebeb;
    color: #a32d2d; /* Para el estado "Pendiente" */
}

.badge-gris {
    background: #f1efe8;
    color: #5f5e5a; /* Para la cantidad x1, x2... */
}

.badge-naranja {
    background: #fff3e0;
    color: #b45309;
}

.item-fecha-entrega {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #595959;
}

/* Mensaje de cuando no hay datos */
.vacio {
    font-size: 14px;
    color: #595959;
    text-align: center;
    padding: 20px 0;
}
/* --- MAIN (DERECHA - RESERVAS) --- */
.contenido-principal {
    flex: 1; /* Ocupa el resto del espacio */
}

.seccion {
    background: white;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.seccion-titulo {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Ítem de Reserva */
.item-pedido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.item-pedido:last-child {
    border-bottom: none;
}

.item-info-izquierda {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-img {
    width: 65px;
    height: 65px;
    background-color: #f2f2f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-img img {
    max-width: 100%;
    border-radius: 4px;
}

.item-nombre {
    font-weight: bold;
    font-size: 16px;
    margin: 0;
    color: #333;
}

.badge-gris {
    background: #f0f0f0;
    color: #595959;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 12px;
    margin-left: 5px;
}

.item-sub {
    color: #666;
    font-size: 13px;
    margin: 4px 0 0;
}

/* Precios y Eliminar */
.item-info-derecha {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-precio {
    font-weight: bold;
    font-size: 16px;
}

.item-sindescuento {
    text-decoration: line-through;
    color: #767676;
    font-size: 13px;
    margin-right: 8px;
}

/* --- BOTÓN ELIMINAR ESTILO CÁPSULA --- */
.btn-eliminar {
    /* Colores y Fondo */
    background-color: #c4121c;  /* Rojo oscuro — contraste 6:1 con blanco (WCAG AA) */
    color: #ffffff;             /* Texto e icono en blanco */
    border: none;               /* Sin bordes extraños */

    /* Forma y Tamaño */
    border-radius: 50px;        /* Crea el efecto redondeado de cápsula */
    padding: 8px 20px;          /* Espaciado interno para que respire */

    /* Tipografía */
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;           /* Semi-negrita */

    /* Alineación de Icono y Texto */
    display: inline-flex;       /* Para que el icono y el texto se alineen */
    align-items: center;        /* Centrado vertical */
    justify-content: center;    /* Centrado horizontal */
    gap: 8px;                   /* Espacio entre el icono de papelera y la palabra */

    /* Interactividad */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra suave */
}

/* --- BOTÓN ELIMINAR ARREGLADO Y ESTILIZADO --- */
.btn-eliminar {
    /* 1. Resetear estilos por defecto del navegador */
    border: none;
    background: none;
    padding: 0;
    margin: 0;

    /* 2. Aplicar el nuevo diseño (Cápsula Roja) */
    background-color: #c4121c;  /* Rojo oscuro — contraste 6:1 con blanco (WCAG AA) */
    color: #ffffff;
    border-radius: 50px;
    padding: 10px 24px;

    /* 3. Alineación */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    /* 4. Tipografía */
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;

    /* 5. Interactividad */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- ESTADOS DEL BOTÓN --- */

/* Cuando el usuario pasa el ratón por encima */
.btn-eliminar:hover {
    background-color: #ad1018;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.btn-eliminar:active {
    background-color: #960e14;
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Ajuste específico para asegurar que el icono de Flaticon se alinee bien */
.btn-eliminar i {
    font-size: 18px;
    line-height: 0;
    display: flex;
    align-items: center;
}

/* --- EDITAR PERFIL --- */
.seccion-editar { margin-top: 20px; }

.form-editar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grupo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-grupo label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1c2c;
}

.form-grupo input[type="text"] {
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    max-width: 320px;
    transition: border-color 0.2s;
}

.form-grupo input[type="text"]:focus { border-color: #1a1e29; }

.btn-guardar {
    align-self: flex-start;
    background-color: #1a1e29;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-guardar:hover {
    background-color: #2e3550;
    transform: translateY(-1px);
}

.btn-guardar:active { transform: translateY(1px); }

.editar-ok {
    font-size: 13px;
    color: #3b6d11;
    background: #eaf3de;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 8px;
}

.editar-error {
    font-size: 13px;
    color: #a32d2d;
    background: #fcebeb;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 8px;
}