/* Modal repetir pedido (estructura base: cuerpocarrito.css) */
.modal-repetir-pedido-caja.modal-confirm-vaciar-caja {
    width: min(94vw, 500px);
    text-align: left;
}

.modal-repetir-pedido-numero {
    margin: 0 0 0.85rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f3b73;
    text-align: center;
}

.modal-repetir-pedido-caja .modal-confirm-vaciar-titulo {
    text-align: center;
}

.modal-repetir-pedido-caja .modal-confirm-vaciar-icono {
    text-align: center;
    display: block;
}

.modal-repetir-pedido-cuerpo {
    margin: 0 0 1.35rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #475569;
    padding: 0 0.15rem;
}

.modal-repetir-pedido-lead {
    margin: 0 0 0.85rem;
}

.modal-repetir-pedido-lista {
    margin: 0;
    padding-left: 1.2rem;
    list-style: disc;
}

.modal-repetir-pedido-lista li {
    margin-bottom: 0.45rem;
    padding-left: 0.2rem;
}

.modal-repetir-pedido-caja .modal-confirm-vaciar-botones {
    justify-content: stretch;
}

.btn-modal-repetir-confirmar {
    flex: 1 1 auto;
    min-width: 160px;
    padding: 0.65rem 1.1rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fef2f2;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    background: linear-gradient(165deg, #c80f0c 0%, #9f0c0a 55%, #7a0908 100%);
    box-shadow:
        0 2px 6px rgba(200, 15, 12, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-modal-repetir-confirmar:hover {
    filter: brightness(1.06);
}

.btn-modal-repetir-confirmar:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

.btn-modal-vaciar-cancelar:focus-visible,
.btn-modal-repetir-confirmar:focus-visible {
    outline: 2px solid #fdba55;
    outline-offset: 2px;
}

/* Repetir pedido — mismo lenguaje visual que modal “Guardar cantidad” / catálogo */
.btncargar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 158px;
    padding: 0.55rem 1.35rem;
    margin: 0.4rem 0.25rem;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: #f8fafc;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 11px;
    background: linear-gradient(165deg, #5676c5 0%, #3d5899 42%, #26406f 100%);
    box-shadow:
        0 2px 8px rgba(31, 59, 115, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.17s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btncargar:hover {
    filter: brightness(1.07);
    box-shadow:
        0 5px 16px rgba(31, 59, 115, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btncargar:active {
    transform: translateY(1px);
    filter: brightness(0.95);
}

.btncargar:focus-visible {
    outline: 2px solid #fdba55;
    outline-offset: 3px;
}

th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    line-height: 0.9rem;
}

td {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    line-height: 0.9rem;
}




.h3prod {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.5rem;
    line-height: 1.5rem;
    padding: 10px ;
}

.imgcablogo {
    width: 70px;
    height: 70px;
}

.cuerpo {
    padding-top: 9rem;
}

/* Igual que carrito/cat: 100% del main; antes 70% dejaba franjas blancas (también con ventana angosta tipo “móvil” en escritorio). */
.cue-contenedor {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.cue-contimg {
    width: 100%;
    height: 100%;
    /*    padding: 50px 5px; */
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.cue-contenedor1 {
    font-size: 3rem;
    line-height: 1em;
    color: rgb(8, 7, 78);
    text-align: center;
    width: 100%;
}

/* Título — Pedidos Enviados */
.pedidos-page-titulo {
    margin: 0 auto 0.35rem;
    padding: 0.75rem 1.45rem 0.95rem;
    max-width: min(32rem, 100%);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(1.3rem, 3.9vw, 1.92rem);
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: 0.042em;
    color: #0f2942;
    text-align: center;
    box-sizing: border-box;
    background: linear-gradient(172deg, #ffffff 0%, #f8fafc 48%, #edf1f8 100%);
    border-radius: 14px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.92) inset,
        0 6px 22px rgba(31, 59, 115, 0.1),
        0 0 0 1px rgba(88, 120, 202, 0.24);
}

.pedidos-page-titulo::after {
    content: "";
    display: block;
    width: 3.35rem;
    height: 3px;
    margin: 0.62rem auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ea9238 0%, #5878ca 100%);
}

.pedidos-page-titulo:focus-visible {
    outline: 2px solid #4a6bb8;
    outline-offset: 3px;
}

/* Contenedor: sombra exterior y scroll suave en pantallas angostas */
.pedidos-enviados-wrap {
    width: 100%;
    margin-top: 1.25rem;
    margin-bottom: 2.75rem;
    padding: 3px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(253, 186, 85, 0.22), rgba(88, 120, 202, 0.18));
    box-sizing: border-box;
}

/* Aire respirable entre tabla y pie de página (solo /pedidos/) */
body.pag-pedidos .cue-contenedor,
.cue-contenedor:has(.pedidos-enviados-wrap) {
    padding-bottom: 1.75rem;
    box-sizing: border-box;
}

/* Separador visual entre un pedido y el siguiente */
.pedidos.tabla-pedidos-enviados tr.pedido-espacio-tr td {
    height: 1.25rem;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    vertical-align: middle;
}

/* Tabla de pedidos — bordes y marco profesional (alinea con paleta catálogo/carrito) */
.pedidos.tabla-pedidos-enviados {
    width: 100%;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.75) inset,
        0 10px 40px rgba(15, 23, 42, 0.1),
        0 4px 12px rgba(31, 59, 115, 0.08);
}

.pedidos.tabla-pedidos-enviados th,
.pedidos.tabla-pedidos-enviados td {
    border: 1px solid rgba(203, 213, 226, 0.85);
    border-bottom-color: rgba(148, 163, 184, 0.45);
    padding: 10px 12px;
    vertical-align: middle;
    transition: filter 0.15s ease;
}

/* Cabeceras de ítems (#9DC2D4 en HTML): refuerzo de borde inferior */
.pedidos.tabla-pedidos-enviados th {
    border-color: rgba(88, 120, 202, 0.28);
    border-bottom: 2px solid rgba(31, 59, 115, 0.35);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: #1e293b;
}

.pedidos.tabla-pedidos-enviados tbody tr:last-child td,
.pedidos.tabla-pedidos-enviados tbody tr:last-child th {
    border-bottom: none;
}

/* Columnas — anchos (sin bordes “inset” heredados) */
.colcod {
    width: 80px;
    text-align: center;
}

.colcan {
    width: 80px;
    text-align: center;
}

.coldes {
    width: 400px;
    text-align: left;
}

.colimp {
    width: 100px;
    text-align: right;
}

.coltot {
    width: 100px;
    text-align: right;
}

/* Resumen del pedido: 4 cols (Cod…Precio); botón sólo en col. Tot.Item */
.pedidos.tabla-pedidos-enviados th.pedido-th-repetir {
    text-transform: none;
    vertical-align: middle;
    white-space: normal;
}

.pedidos.tabla-pedidos-enviados th.pedido-th-repetir .btncargar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0.35rem 0;
    padding: 0.5rem 0.45rem;
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.coltotf {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.85rem;
    width: auto;
    text-align: center;
    font-weight: 800;
    color: #0f2744;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2fb 100%) !important;
    border-top: 2px solid rgba(88, 120, 202, 0.28) !important;
}

.btneliminar {
    border: none;
    color: rgb(33, 30, 30);
    background-color: #df7f31;
    padding: 15PX 15PX;
    cursor: pointer;
    display: inline-block;
    background: url("/imagenes/cerrar.png");
    background-size: cover;
    background-position: center;
}

@media only screen and (max-width:767px) {
    /* Quita cualquier hueco lateral del main en /pedidos/ (class + :has por compatibilidad) */
    body.pag-pedidos main.cuerpo,
    main.cuerpo:has(.pedidos-enviados-wrap) {
        padding-inline: 0 !important;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }

    /* Ocupa todo el ancho de la pantalla (edge-to-edge con safe-area) */
    body.pag-pedidos .cue-contenedor,
    body .cue-contenedor:has(.pedidos-enviados-wrap),
    html body main.cuerpo .cue-contenedor:has(.pedidos-enviados-wrap) {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-inline: max(0px, env(safe-area-inset-left, 0px))
            max(0px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    body.pag-pedidos .cue-contenedor > .cue-contenedor1,
    body .cue-contenedor:has(.pedidos-enviados-wrap) > .cue-contenedor1 {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-inline: 0;
        box-sizing: border-box;
    }

    /* Margen sólo para el encabezado; la tabla llega de borde a borde */
    body.pag-pedidos .cue-contenedor > .cue-contenedor1 > .pedidos-page-titulo,
    body .cue-contenedor:has(.pedidos-enviados-wrap) > .cue-contenedor1 > .pedidos-page-titulo {
        margin-left: clamp(10px, 3vw, 16px);
        margin-right: clamp(10px, 3vw, 16px);
    }

    .pedidos-enviados-wrap {
        margin-left: 0;
        margin-right: 0;
        margin-top: 1rem;
        width: 100%;
        max-width: none;
        min-width: 0;
        /* Sin marco interno lateral: tabla al 100vw útil entre safe-area */
        padding-block: 0;
        padding-inline: max(0px, env(safe-area-inset-left, 0px))
            max(0px, env(safe-area-inset-right, 0px));
        border-radius: 0;
        box-sizing: border-box;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: block;
    }

    /* Auto: anchos de cod/cant/precio/tot según el valor más ancho en cada columna; descripción usa el resto del 100%. */
    body.pag-pedidos .pedidos.tabla-pedidos-enviados,
    .pedidos.tabla-pedidos-enviados {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        table-layout: auto;
        border-radius: 0;
        font-size: 0.75rem;
        box-sizing: border-box;
        display: table;
    }

    /* Celda de texto del resumen (4 columnas), no la del botón */
    body.pag-pedidos .pedidos.tabla-pedidos-enviados tbody > tr > th[colspan="4"],
    .pedidos.tabla-pedidos-enviados tbody > tr > th[colspan="4"] {
        vertical-align: middle;
        word-break: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
        font-size: clamp(0.56rem, 2.85vw, 0.72rem);
        line-height: 1.35;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: none;
    }

    .pedidos.tabla-pedidos-enviados th.pedido-th-repetir .btncargar {
        max-width: 100% !important;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 0.42rem 0.28rem;
        font-size: clamp(0.5rem, 2.4vw, 0.62rem);
    }

    .pedidos.tabla-pedidos-enviados th,
    .pedidos.tabla-pedidos-enviados td {
        padding: 7px 5px;
    }

    /*
     * Filas de 5 celdas: nowrap en cod / cant / precio / tot.item → ancho según el contenido;
     * descripción: prioridad de anchura + ajuste de líneas para ocupar el espacio libre.
     */
    .pedidos.tabla-pedidos-enviados tbody tr:has(> th:nth-child(5)) th:nth-child(1),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> td:nth-child(5)) td:nth-child(1),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> th:nth-child(5)) th:nth-child(3),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> td:nth-child(5)) td:nth-child(3),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> th:nth-child(5)) th:nth-child(4),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> td:nth-child(5)) td:nth-child(4),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> th:nth-child(5)) th:nth-child(5),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> td:nth-child(5)) td:nth-child(5) {
        white-space: nowrap;
        box-sizing: border-box;
    }

    .pedidos.tabla-pedidos-enviados tbody tr:has(> th:nth-child(5)) th:nth-child(2),
    .pedidos.tabla-pedidos-enviados tbody tr:has(> td:nth-child(5)) td:nth-child(2) {
        width: 100%;
        min-width: 0;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .imgcablogo {
        width: 50px;
        height: 50px;
        padding: 2px 5px;
    }

    .cuerpo {
        padding-top: 7rem;
    }


    /* Base móvil: si no viniera la regla :has(...) (p. ej. sin tabla), igual 100%. */
    .cue-contenedor {
        width: 100%;
        height: auto;
        max-width: 100%;
        box-sizing: border-box;
        padding-left: max(0px, env(safe-area-inset-left, 0px));
        padding-right: max(0px, env(safe-area-inset-right, 0px));
        margin-inline: 0;
    }

    .cue-contimg {
        width: 100%;
        height: auto;
        padding: 0px 0px;
        display: flex;
    }

    .cue-contenedor1 {
        color: rgb(8, 7, 78);
        text-align: center;
        width: 100%;
    }


    .pedidos-page-titulo {
        font-size: clamp(1.05rem, 4.2vw, 1.38rem);
        padding: 0.55rem 1rem 0.72rem;
        letter-spacing: 0.034em;
        border-radius: 11px;
    }

    .pedidos-page-titulo::after {
        width: 2.5rem;
        height: 2px;
        margin-top: 0.48rem;
    }

        .h3prod {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 0.8rem;
            line-height: 0.8rem;
        }

    th {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 0.6rem;
        line-height: 0.7rem;
    }

    td {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 0.6rem;
        line-height: 0.7rem;
    }
    .btncargar {
        display: inline-flex;
        width: auto;
        max-width: min(260px, 92vw);
        min-width: 0;
        min-height: 36px;
        height: auto;
        margin: 0.35rem 0.2rem;
        padding: 0.48rem 1rem;
        font-size: 0.62rem;
        letter-spacing: 0.035em;
        border-radius: 10px;
    }

}