/* =========================================
   ESTILO "DIVI ULTRA-WIDE" (ANCHO COMPLETO REAL)
   ========================================= */

/* --- 1. HACK PARA ROMPER EL CONTENEDOR (SOLO FRONTEND) --- */
/* Esto fuerza que el plugin se salga de la "caja" de Divi/WordPress y ocupe toda la pantalla */
body:not(.wp-admin) .po-wrapper {
    width: 98vw; /* 98% del ancho de la VENTANA, no del contenedor */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -49vw; /* Centrado matemático */
    margin-right: -49vw;
    padding: 0 10px;
    box-sizing: border-box;
    max-width: none !important; /* Anular límites del tema */
}

/* En el Admin de WordPress, nos comportamos normal */
.wp-admin .po-wrapper {
    max-width: 99%; /* Casi total */
    margin: 20px auto;
}

/* --- ESTILOS GENERALES --- */
.po-wrapper {
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    color: #666;
    line-height: 1.6;
}

.po-wrapper h1, .po-wrapper h2, .po-wrapper h3 {
    font-weight: 700;
    color: #333;
    letter-spacing: -0.5px;
}

/* --- TARJETAS (CARDS) --- */
.po-card, .po-results {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08); /* Sombra suave Divi */
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    width: 100%; /* Asegura que llene el wrapper expandido */
    box-sizing: border-box;
}

/* Barra superior de color */
.po-card::before, .po-results::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: #2ea3f2; /* Azul Divi puro */
}

.po-card .title, .po-results h3 {
    color: #2ea3f2;
    margin-top: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f5f9;
    font-size: 22px;
}

/* --- FORMULARIO --- */
.form-table { width: 100%; }
.form-table th {
    text-align: left;
    padding: 15px 15px 15px 0;
    width: 150px;
    font-weight: 700;
    color: #555;
}

.po-card select, 
.po-card input[type="text"], 
.po-card input[type="date"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fcfcfc;
    color: #333;
    font-size: 14px;
}

.po-card select:focus, .po-card input:focus {
    border-color: #2ea3f2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(46, 163, 242, 0.1);
    outline: none;
}

.po-flex-row { display: flex; gap: 20px; }
.po-date-input { flex: 1; }

/* --- BOTONES --- */
.po-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.po-actions button {
    cursor: pointer;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    border: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.po-actions button.button-primary {
    background: #2ea3f2;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(46, 163, 242, 0.3);
}
.po-actions button.button-primary:hover {
    background: #258cd1;
    transform: translateY(-2px);
}

.po-actions button.button-secondary {
    background: #333;
    color: #fff !important;
}
.po-actions button.button-secondary:hover {
    background: #555;
    transform: translateY(-2px);
}

/* --- TABLA DE RESULTADOS (FULL WIDTH) --- */
.po-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #eee;
}

.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
    table-layout: auto; /* Permite que las columnas se ajusten */
}

.wp-list-table thead tr {
    background: #2ea3f2;
    color: #fff;
}

.wp-list-table thead th {
    padding: 18px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    color: #fff !important;
    border: none;
    white-space: nowrap; /* Evita que los títulos se partan */
}

.wp-list-table tbody td {
    padding: 18px;
    border-top: 1px solid #f0f0f0;
    color: #444;
    vertical-align: middle;
}

/* Separador de Pedidos */
.pedido-separator {
    border-top: 4px solid #2ea3f2 !important;
}

/* Detalles del Producto */
.po-prod-name {
    color: #2ea3f2;
    font-weight: 700;
    font-size: 15px;
    display: block;
    margin-bottom: 5px;
}

/* Fecha Prod Badge */
.fecha-corte {
    background: #fff8e1;
    color: #f57c00;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

.notice {
    padding: 20px;
    background: #fff;
    border-left: 5px solid #ffba00;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.po-footer {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    margin-top: 40px;
}

/* Responsive Móvil */
@media (max-width: 768px) {
    body:not(.wp-admin) .po-wrapper {
        width: 100%; /* En móvil volvemos al 100% normal para no descuadrar */
        left: 0; margin-left: 0;
    }
    .form-table th, .form-table td { display: block; width: 100%; }
    .po-flex-row { flex-direction: column; }
    .po-actions { flex-direction: column; }
    .po-actions button { width: 100%; justify-content: center; }
}