/* ═══════════════════════════════════════════════════════
    OFFLINE PAYMENT — Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Tabla principal */
.op-payment-list {
    width: 100%;
}

.op-front-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.op-front-table thead th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.op-front-table tbody td {
    padding: 12px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.op-front-table tbody tr:last-child td {
    border-bottom: none;
}

.op-front-table tbody tr:hover td {
    background: #fafafa;
}

/* ── Anchos de columna */
.op-col-order   { width: 8%;  }
.op-col-total   { width: 10%; }
.op-col-date    { width: 14%; }
.op-col-expiry  { width: 14%; }
.op-col-details { width: 34%; }
.op-col-status  { width: 12%; }
.op-col-actions { width: 8%;  }

/* ── Enlace de número de orden */
.op-order-number {
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
}
.op-order-number:hover { text-decoration: underline; }

/* ── Expiración */
.op-expiry-expired {
    color: #dc2626;
    font-weight: 600;
    font-size: 12px;
}

.op-expiry-active {
    color: #374151;
    font-size: 12px;
}

/* ── Detalles del pago */
.op-payment-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.op-detail-row {
    gap: 6px;
    align-items: baseline;
    font-size: 12px;
}

.op-detail-key {
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 90px;
    font-size: 11px;
}

.op-detail-val {
    color: #111827;
    word-break: break-word;
}

.op-no-data {
    color: #9ca3af;
}

/* ── Estados */
.op-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
}

/* ── Responsive: colapsar tabla en móvil */
@media ( max-width: 768px ) {

    .op-front-table,
    .op-front-table thead,
    .op-front-table tbody,
    .op-front-table th,
    .op-front-table td,
    .op-front-table tr {
        display: block;
        width: 100%;
    }

    .op-front-table thead {
        display: none;
    }

    .op-front-table tbody td {
        display: flex;
        gap: 8px;
        padding: 8px 12px;
        border-bottom: none;
    }

    .op-front-table tbody td::before {
        content: attr( data-title );
        font-weight: 600;
        font-size: 11px;
        color: #9ca3af;
        text-transform: uppercase;
        min-width: 110px;
        flex-shrink: 0;
    }

    .op-front-table tbody tr {
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 8px;
    }

    .op-col-order,
    .op-col-total,
    .op-col-date,
    .op-col-expiry,
    .op-col-details,
    .op-col-status,
    .op-col-actions {
        width: 100%;
    }
}

/* ── Popup */
.op-popup-form {
    text-align: left;
    padding: 0 4px;
}

.op-popup-order-info {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.op-popup-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    gap: 2px;
    border-right: 1px solid #e5e7eb;
}

.op-popup-info-item:last-child {
    border-right: none;
}

.op-popup-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.op-popup-info-value {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.op-popup-field {
    margin-bottom: 16px;
}

.op-popup-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.op-required {
    color: #cc0000;
    margin-left: 2px;
}

.op-popup-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.op-popup-input:focus {
    outline: none;
    border-color: #999;
}

.op-popup-error {
    color: #cc0000;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff0f0;
    border-left: 3px solid #cc0000;
    border-radius: 2px;
}

/* SweetAlert2 */
.op-swal-popup  { border-radius: 8px !important; }
.op-swal-title  { font-weight: 600 !important; }
.op-swal-body   { text-align: left !important; }
.op-swal-close  { font-size: 20px !important; }
.op-swal-confirm,
.op-swal-cancel { margin: 4px !important; }

button.swal2-close{
    display: flex;
    position: absolute;
    top: -12.5px;
    right: -12.5px;
    width: 30px;
    height: 30px;
    background-color: #000;
    color: #fff;
    text-align: center;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 100;
}

button.swal2-close:hover{
    background-color: #000 !important;
    color: #fff !important;
}

/* ── Filtros */
.op-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.op-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.op-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.op-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.op-filter-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    cursor: pointer;
}

.op-filter-select:focus {
    outline: none;
    border-color: #6366f1;
}

.op-filter-btn {
    font-size: 13px !important;
    padding: 6px 14px !important;
}

.op-filter-clear {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
}

.op-filter-clear:hover {
    color: #374151;
    text-decoration: underline;
}

.op-results-count {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* ── Paginación */
.op-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.op-page-btn {
    font-size: 13px !important;
    padding: 6px 14px !important;
    text-decoration: none !important;
}

.op-page-info {
    font-size: 13px;
    color: #6b7280;
}

/* ── Botones de acción con iconos */
.op-action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.op-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
}

.op-action-btn:hover { border-color: #9ca3af; background: #f9fafb; }

.op-btn-view    { color: #6366f1; }
.op-btn-view:hover { border-color: #6366f1; background: #eef2ff; }

.op-btn-confirm { color: #16a34a; }
.op-btn-confirm:hover { border-color: #16a34a; background: #f0fdf4; }

.op-btn-reorder { color: #d97706; }
.op-btn-reorder:hover { border-color: #d97706; background: #fffbeb; }

/* ── Popup de detalle de orden */
.op-order-detail-popup {
    text-align: left;
}

.op-detail-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.op-detail-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    background: #f9fafb;
}

.op-detail-summary-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.op-detail-summary-val {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.op-detail-section {
    margin-bottom: 16px;
}

.op-detail-section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: #9ca3af !important;
    margin: 0 0 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.op-order-detail-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.op-order-detail-items th {
    text-align: left;
    padding: 6px 8px;
    font-size: 11px !important;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
}

.op-order-detail-items td {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.op-order-detail-items tr:last-child td { border-bottom: none; }
.op-order-detail-qty  { width: 50px; text-align: center; }
.op-order-detail-price { width: 80px; text-align: right; }

.op-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.op-detail-address {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.op-detail-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 13px;
    align-items: baseline;
}

.op-detail-kv span { color: #9ca3af; white-space: nowrap; }
.op-detail-kv strong { color: #111827; }

.op-reorder-skipped {
    font-size: 12px;
    color: #d97706;
    margin-top: 8px;
}

.op-swal-loading-popup{
    background: transparent !important;
    box-shadow: none !important;
}

.op-swal-loader {
    border-color: #000 rgba(0,0,0,0) #000 rgba(0,0,0,0);
}

.op-price-regular {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 11px;
    margin-right: 3px;
}

.op-price-sale {
    /* color: #dc2626; */
    font-weight: 600;
}

.op-sku {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.op-order-detail-total { width: 90px; text-align: right; }

.op-expired-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-left: 4px solid #d97706;
    border-radius: 4px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

.op-expired-notice p { margin: 0; }

/* ── Summary financiero en popup de detalle  */
.op-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.op-summary-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
}

.op-summary-table tr:last-child td {
    border-bottom: none;
}

.op-summary-label {
    color: #6b7280;
    width: 60%;
}

.op-summary-label small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

.op-summary-value {
    text-align: right;
    color: #111827;
    font-weight: 500;
}

.op-summary-discount .op-summary-label,
.op-summary-discount .op-summary-value {
    color: #16a34a;
}

.op-summary-total td {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    padding-top: 10px;
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
}
