/* P-11 — CSS verbatim de los bloques de estilo de Pages/Ventas/POS/Modals/MDSeleccionarListaPreciosPage.razor. Igual que hoy, es global mientras el componente está en pantalla:
   se enlaza con <link> donde estaba el bloque. Cambios: @@ → @ y capas D-51. */
/* ─── OVERLAY ─────────────────────────────────────── */
.cdlg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 54, 0.46);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal); /* D-51 (era 99999) */
    padding: 16px;
    animation: cdlg-fade .2s ease;
}

@keyframes cdlg-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── MODAL ───────────────────────────────────────── */
.cdlg-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(26,79,186,.20), 0 4px 18px rgba(0,0,0,.07);
    width: 50%;
    max-width: 900px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cdlg-up .25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes cdlg-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── HEADER ──────────────────────────────────────── */
.cdlg-header {
    background: #f8fafd;
    border-bottom: 1.5px solid #dce6f5;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.cdlg-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.cdlg-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a4fba 0%, #2d6ae0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cdlg-header-texts {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.cdlg-header-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #8ca0c4;
    margin: 0;
    line-height: 1;
}

.cdlg-header-title {
    font-size: 15px;
    font-weight: 800;
    color: #1a2540;
    margin: 0;
    letter-spacing: -.3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdlg-header-badge {
    padding: 3px 11px;
    border-radius: 20px;
    background: #e8eef9;
    border: 1.5px solid #c5d4f0;
    color: #1a4fba;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .3px;
    flex-shrink: 0;
}

/* ─── CONTENT ─────────────────────────────────────── */
.cdlg-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 14px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

/* ─── LOADING ────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(240,244,251,.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #c5d4f0;
    border-top-color: #1a4fba;
    border-radius: 50%;
    animation: cdlg-spin .75s linear infinite;
}

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

/* ─── GRID CONTAINER — flex para que el listview ocupe todo ── */
.grid-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ─── LISTVIEW ────────────────────────────────────── */
.cdlg-listview {
    
    flex: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e4ecf7;
    background: #fafbfe;
}

.cdlg-list-header {
    padding: 7px 14px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #6b8fd4;
    background: #f4f7fd;
    border-bottom: 1px solid #e4ecf7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

    .cdlg-list-header::before {
        content: '';
        display: inline-block;
        width: 3px;
        height: 11px;
        background: linear-gradient(180deg, #1a4fba, #2d6ae0);
        border-radius: 2px;
        flex-shrink: 0;
    }

.cdlg-list {
    list-style: none;
    margin: 5px;
    padding: 5px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #d6e3f5 transparent;
}

    .cdlg-list::-webkit-scrollbar {
        width: 4px;
    }

    .cdlg-list::-webkit-scrollbar-thumb {
        background: #d6e3f5;
        border-radius: 2px;
    }

.cdlg-list-item {
    cursor: pointer;
    border-bottom: 1px solid #f0f5fb;
    transition: background 0.12s ease;
}

    .cdlg-list-item:last-child {
        border-bottom: none;
    }

    .cdlg-list-item:hover {
        background: #f0f5fb;
    }

    .cdlg-list-item.selected {
        background: #eaf0fb;
        border-left: 3px solid #1a4fba;
    }

/* ─── TARJETA INTERNA — texto más compacto ───────── */
.card {
    margin:3px !important;
    padding:6px !important;
    background: transparent;
    border: none;
    box-shadow: none;
}

.card-content {
    padding: 0;
}

.horizontal-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-product-box {
    padding: 0;
}

.horizontal-product-box {
    display: flex;
    align-items: center;
}

.horizontal-product-details {
    flex: 1;
    /* padding reducido para que quepan más items */
    padding: 1px 7px;
}

.product-info {
    font-size: 10px; /* antes 12.5px — ahora más compacto */
    font-weight: 600;
    color: #1a2540;
    margin: 0 0 3px 0;
    letter-spacing: -.1px;
}

.producto-linea2 {
    flex: 1;
}

.botones-producto-linea2 {
    flex-shrink: 0;
}

.spanstyle {
    font-size: 10px; /* antes 12px */
    color: #4a5e82;
    font-weight: 500;
}

.botones-producto-linea2 .spanstyle {
    font-size: 10px;
    font-weight: 700;
    color: #1a4fba;
    background: #eaf0fb;
    padding: 2px 9px;
    border-radius: 5px;
    border: 1px solid #c5d4f0;
}

/* ─── INPUT CONTAINER ─────────────────────────────── */
.input-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: flex-end;
}

/*
      FLOAT LABEL — estrategia definitiva:
      ─────────────────────────────────────
      • .cdlg-field tiene padding-top: 16px → espacio para el label activo
      • El input ocupa desde top:0 dentro del field (después del padding)
      • label reposo: centrado verticalmente en el input
          top = padding-top(16) + altura-input(31)/2 = 31.5px
          transform: translateY(-50%)
      • label activo: sube al borde superior del input
          top = padding-top(16)/2 = 8px  (mitad → queda sobre el borde)
          transform: translateY(-50%)
          bg blanco para tapar el borde
      • El input NO tiene placeholder → evita doble texto con el label
    */
.cdlg-field {
    position: relative;
    flex: 1;
    min-width: 150px;
    padding-top: 16px;
}

.cdlg-float-label {
    position: absolute;
    top: 31.5px;
    left: 11px;
    transform: translateY(-50%);
    font-size: 12px;
    color: #8ca0c4;
    pointer-events: none;
    transition: top 0.14s ease, font-size 0.14s ease, color 0.14s ease, background 0.14s ease;
    background: transparent;
    padding: 0 2px;
    line-height: 1;
    white-space: nowrap;
    z-index: 1;
}

    .cdlg-float-label.active {
        top: 8px;
        font-size: 9.5px;
        font-weight: 700;
        color: #1a4fba;
        background: #ffffff;
        padding: 0 3px;
        letter-spacing: .3px;
    }

/* ─── INPUTS ──────────────────────────────────────── */
.cdlg-input {
    display: block;
    width: 100%;
    height: 31px;
    /*
          padding-right por defecto 11px.
          Cuando haya clear btn → clase has-clear → 30px
          Cuando haya spinners  → clase has-spinners → 50px
        */
    padding: 0 11px;
    border: 1.5px solid #dce6f5;
    border-radius: 5px;
    background: #ffffff;
    color: #1a2540;
    font-size: 12.5px;
    font-family: inherit;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

    .cdlg-input::-webkit-inner-spin-button,
    .cdlg-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* SIN placeholder — el label flotante lo reemplaza */
    .cdlg-input::placeholder {
        color: transparent;
    }

    .cdlg-input:focus {
        border-color: #2d6ae0;
        box-shadow: 0 0 0 3px rgba(45,106,224,0.13);
    }

    .cdlg-input:disabled,
    .cdlg-input-disabled {
        background: #f4f7fd;
        color: #8ca0c4;
        cursor: not-allowed;
        border-color: #e8eef9;
    }

    .cdlg-input.has-clear {
        padding-right: 30px;
    }

    .cdlg-input.has-spinners {
        padding-right: 50px;
    }

.responsive-input {
    width: 100%;
}

.responsive-numeric {
    width: 100%;
}

/* ─── CLEAR BUTTON ────────────────────────────────── */
/*
      Siempre visible y alineado al centro del input:
      - top del input dentro del field = padding-top = 16px
      - centro = 16 + 31/2 = 31.5px desde el top del .cdlg-field
      Para el clear dentro del spin-wrap el .cdlg-field sigue siendo
      el ancestro con padding-top, así que la fórmula es la misma.
    */
.cdlg-clear-btn {
    position: absolute;
    right: 7px;
    top: 31.5px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: #aec2e8;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s ease;
    z-index: 4;
    flex-shrink: 0;
    /* siempre visible sin opacity condicional */
    opacity: 1;
    pointer-events: auto;
}

    .cdlg-clear-btn:hover {
        background: #1a4fba;
    }

/* ─── SPIN WRAPPER ────────────────────────────────── */
/*
      spin-wrap es solo un contenedor relativo para los botones de spin.
      El clear-btn sigue siendo hijo de .cdlg-field, no de spin-wrap,
      para que el top: 31.5px funcione correctamente.
    */
.cdlg-spin-wrap {
    position: relative;
}

.cdlg-spinners {
    position: absolute;
    /* alineado con el borde interior del input */
    right: 27px; /* 7px(clear) + 16px(btn) + 4px(gap) */
    top: 1px;
    bottom: 1px;
    width: 20px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dce6f5;
    overflow: hidden;
    border-radius: 0 4px 4px 0;
}

.cdlg-spin-btn {
    flex: 1;
    border: none;
    background: #f4f7fd;
    color: #6b8fd4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s ease, color 0.12s ease;
    line-height: 1;
}

    .cdlg-spin-btn:first-child {
        border-bottom: .5px solid #dce6f5;
    }

    .cdlg-spin-btn:hover {
        background: #e4ecf7;
        color: #1a4fba;
    }

    .cdlg-spin-btn:active {
        background: #1a4fba;
        color: #ffffff;
    }

/* ─── FOOTER ──────────────────────────────────────── */
.cdlg-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 20px 12px;
    border-top: 1.5px solid #dce6f5;
    background: #f8fafd;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

/* ─── BUTTONS ─────────────────────────────────────── */
.cdlg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    height: 33px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    border: none;
    letter-spacing: .1px;
    font-family: inherit;
}

.cdlg-btn-primary {
    background: linear-gradient(135deg, #0f3494 0%, #1a4fba 50%, #2d6ae0 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(26,79,186,.28);
}

    .cdlg-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 16px rgba(26,79,186,.38);
    }

    .cdlg-btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 2px 5px rgba(26,79,186,.22);
    }

.cdlg-btn-secondary {
    background: #ffffff;
    color: #4a5e82;
    border: 1.5px solid #dce6f5;
}

    .cdlg-btn-secondary:hover {
        background: #e8eef9;
        border-color: #c5d4f0;
        color: #1a4fba;
    }

/* ─── UTILIDADES ──────────────────────────────────── */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-start {
    justify-content: flex-start;
}

.gap-2 {
    gap: 8px;
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 600px) {
    .cdlg-modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .cdlg-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .input-container {
        flex-direction: column;
    }

    .cdlg-field {
        min-width: 100%;
    }

    .cdlg-footer {
        flex-direction: column-reverse;
    }

    .cdlg-btn {
        width: 100%;
        justify-content: center;
    }
}

.num-input {
    width:100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 5px;
    padding: 4px 8px;
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    background: #f8fafc;
    font-family: inherit;
    transition: border-color .15s, background .15s;
    -moz-appearance: textfield;
}

.pl-item {
    margin-bottom:6px;
    list-style: none;
    cursor: pointer;
    border-radius: 6px;
    border: 0.5px solid #e2e0d8;
    background: #ffffff;
    transition: background 0.15s, border-color 0.15s;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

    .pl-item:hover {
        background: #f5f4f0;
        border-color: #c8c6be;
    }

    .pl-item.selected {
        background: #E6F1FB;
        border-color: #85B7EB;
    }

.pl-badge {
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f5f4f0;
    border: 0.5px solid #e2e0d8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    color: #888780;
    padding: 0 6px;
}

.pl-item.selected .pl-badge {
    background: #B5D4F4;
    border-color: #85B7EB;
    color: #0C447C;
}

.pl-item.selected .pl-id {
    color: #0C447C;
}

.pl-body {
    flex: 1;
    min-width: 0;
}

.pl-name {
    font-size: 12px;
    font-weight: 500;
    color: #2c2c2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.pl-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.pl-tag {
    font-size: 10px;
    color: #888780;
    background: #f5f4f0;
    border: 0.5px solid #e2e0d8;
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.5;
}

.pl-price {
    font-size: 12px;
    font-weight: 500;
    color: #2c2c2a;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.pl-price-label {
    font-size: 10px;
    color: #888780;
    display: block;
    text-align: right;
    line-height: 1;
    margin-bottom: 1px;
}
