/**
 * Prido Cotizador - Estilos de la Página /cotizador
 * Replica visualmente el formato del PDF de referencia CT-229196.
 *
 * Convenciones BEM: .prido-cot__[bloque]--[modificador]
 *
 * @package Prido_Cotizador
 */

/* =====================================================================
   VARIABLES
   ===================================================================== */
:root {
    --pcot-primary: #E8721C;
    --pcot-primary-dark: #d4640f;
    --pcot-border: color-mix(in srgb, var(--prido-theme-ink, #1a2a3a) 38%, var(--prido-theme-border-strong, #c8d4de) 62%);
    --pcot-border-light: var(--prido-theme-border, #cccccc);
    --pcot-bg-readonly: var(--prido-theme-surface-alt, #f7f7f7);
    --pcot-text: var(--prido-theme-ink, #222222);
    --pcot-text-main: var(--pcot-text);
    --pcot-text-light: var(--prido-theme-muted, #666666);
    --pcot-bg-header: var(--prido-theme-surface-strong, #ffffff);
    --pcot-bg-page: var(--prido-theme-canvas, #f5f5f5);
    --pcot-bg-page-soft: var(--prido-theme-canvas-soft, #f2f6f9);
    --pcot-bg-surface: var(--prido-theme-surface-strong, #ffffff);
    --pcot-bg-surface-soft: var(--prido-theme-surface, #fafafa);
    --pcot-bg-row: color-mix(in srgb, var(--prido-theme-surface-alt, #f8fbfd) 82%, var(--pcot-primary) 18%);
    --pcot-bg-hover: color-mix(in srgb, var(--prido-theme-surface-strong, #ffffff) 84%, var(--pcot-primary) 16%);
    --pcot-bg-focus: color-mix(in srgb, var(--prido-theme-surface-strong, #ffffff) 88%, var(--pcot-primary) 12%);
    --pcot-bg-alt: color-mix(in srgb, var(--prido-theme-surface-alt, #f8fbfd) 88%, var(--prido-theme-canvas, #f5f5f5) 12%);
    --pcot-success: #16a34a;
    --pcot-danger: #d63638;
    --pcot-teal: var(--prido-secondary, #2DC6C1);
    --pcot-white: #ffffff;
    --pcot-disabled-start: color-mix(in srgb, var(--pcot-text-light) 50%, var(--pcot-bg-surface) 50%);
    --pcot-disabled-end: color-mix(in srgb, var(--pcot-text-light) 64%, var(--pcot-bg-surface) 36%);
    --pcot-danger-soft: color-mix(in srgb, var(--prido-theme-surface-strong, #ffffff) 86%, var(--pcot-danger) 14%);
    --pcot-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --pcot-font-mono: "Courier New", Courier, monospace;
    --pcot-radius: 0;
    --pcot-shadow: var(--prido-theme-shadow-soft, 0 1px 4px rgba(0,0,0,0.08));
}

/* =====================================================================
   PAGE WRAPPER
   ===================================================================== */
.prido-cotizador-page-wrap {
    padding: 30px 0 60px;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--pcot-primary) 9%, transparent 91%), transparent 34vw),
        linear-gradient(180deg, var(--pcot-bg-page-soft), var(--pcot-bg-page));
    min-height: 80vh;
}

.prido-cotizador-page-wrap .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =====================================================================
   CONTENEDOR PRINCIPAL (.prido-cot)
   ===================================================================== */
.prido-cot {
    background: var(--pcot-bg-surface);
    border: 1px solid var(--pcot-border);
    border-radius: 10px;
    box-shadow: var(--pcot-shadow);
    font-family: var(--pcot-font);
    font-size: 13px;
    color: var(--pcot-text);
    line-height: 1.4;
    overflow: hidden;
}

/* =====================================================================
   SECCIÓN A: ENCABEZADO
   ===================================================================== */
.prido-cot__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pcot-border);
    gap: 20px;
    background: var(--pcot-bg-header);
}

.prido-cot__header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
}

.prido-cot__logo {
    width: 150px;
    max-width: 180px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.prido-cot__empresa-info {
    flex: 1;
}

.prido-cot__empresa-nombre {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--pcot-text);
    text-transform: uppercase;
}

.prido-cot__empresa-info p {
    margin: 0;
    font-size: 12px;
    color: var(--pcot-text-light);
    line-height: 1.5;
}

.prido-cot__header-right {
    flex-shrink: 0;
}

.prido-cot__folio-box {
    border: 2px solid var(--pcot-primary);
    border-radius: 4px;
    padding: 12px 20px;
    text-align: center;
    min-width: 180px;
    background: color-mix(in srgb, var(--pcot-bg-surface) 88%, var(--pcot-primary) 12%);
}

.prido-cot__rut-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--pcot-primary);
    margin: 0 0 6px;
}

.prido-cot__cotizacion-label {
    font-size: 14px;
    font-style: italic;
    color: var(--pcot-primary);
    margin: 0 0 4px;
}

.prido-cot__folio-numero {
    font-size: 13px;
    font-weight: 600;
    color: var(--pcot-text);
    margin: 0;
}

/* =====================================================================
   SECCIÓN B: DATOS DEL CLIENTE
   ===================================================================== */
.prido-cot__cliente {
    padding: 0;
    border-bottom: 1px solid var(--pcot-border);
}

.prido-cot__cliente-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    border-collapse: collapse;
}

.prido-cot__field {
    padding: 6px 10px;
    border: 1px solid var(--pcot-border-light);
    margin: -1px 0 0 -1px;
}

.prido-cot__field--span2 {
    grid-column: span 2;
}

.prido-cot__field label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--pcot-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.prido-cot__field input,
.prido-cot__field textarea {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    font-family: var(--pcot-font);
    font-size: 12px;
    color: var(--pcot-text);
    padding: 2px 0;
    outline: none;
    line-height: 1.3;
}

.prido-cot__field input:focus {
    background: var(--pcot-bg-focus);
}

.prido-cot__field input.prido-cot__readonly {
    background: var(--pcot-bg-readonly);
    color: var(--pcot-text-light);
    cursor: default;
    padding: 2px 4px;
}

.prido-cot__field input::placeholder {
    color: color-mix(in srgb, var(--pcot-text-light) 58%, transparent 42%);
    font-style: italic;
}

/* [Hito 7] Estilos para selects (Región, Comuna) */
.prido-cot__field select,
.prido-cot__field .prido-cot__select {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    font-family: var(--pcot-font);
    font-size: 12px;
    color: var(--pcot-text);
    padding: 2px 0;
    outline: none;
    line-height: 1.3;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: var(--prido-theme-arrow-url, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"));
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 18px;
}

.prido-cot__field select:focus {
    background-color: var(--pcot-bg-focus);
    background-image: var(--prido-theme-arrow-url, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"));
    background-repeat: no-repeat;
    background-position: right 4px center;
}

.prido-cot__field select.prido-cot__readonly,
.prido-cot__field select:disabled {
    background-color: var(--pcot-bg-readonly);
    color: var(--pcot-text-light);
    cursor: default;
    padding: 2px 4px;
    opacity: 1;
    background-image: none;
}

/* =====================================================================
   SECCIÓN C: GRILLA DE PRODUCTOS
   ===================================================================== */
.prido-cot__grilla {
    border-bottom: 1px solid var(--pcot-border);
}

/* Toolbar de búsqueda */
.prido-cot__grilla-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--pcot-bg-alt);
    border-bottom: 1px solid var(--pcot-border-light);
}

.prido-cot__search-wrap {
    flex: 1;
    position: relative;
}

.prido-cot__search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--pcot-border-light);
    background: var(--pcot-bg-surface);
    color: var(--pcot-text);
    border-radius: 4px;
    font-family: var(--pcot-font);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.prido-cot__search-input:focus {
    border-color: var(--pcot-primary);
}

.prido-cot__search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pcot-bg-surface);
    border: 1px solid var(--pcot-border-light);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--pcot-shadow);
}

.prido-cot__search-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--pcot-border-light);
    transition: background 0.15s;
}

.prido-cot__search-item:hover {
    background: var(--pcot-bg-hover);
}

.prido-cot__search-item:last-child {
    border-bottom: none;
}

.prido-cot__search-sku {
    font-weight: 600;
    font-size: 11px;
    color: var(--pcot-primary);
    margin-right: 8px;
}

.prido-cot__search-name {
    font-size: 12px;
    color: var(--pcot-text);
}

.prido-cot__search-price {
    float: right;
    font-size: 11px;
    color: var(--pcot-text-light);
}

/* Botones */
.prido-cot__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--pcot-font);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.prido-cot__btn--add {
    display: none !important;
}

/* Tabla principal */
.prido-cot__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.prido-cot__table thead th {
    background: var(--pcot-bg-alt);
    border: 1px solid var(--pcot-border-light);
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
    color: var(--pcot-text);
    letter-spacing: 0.3px;
}

/* Anchos de columnas */
.prido-cot__th--item     { width: 40px; text-align: center; }
.prido-cot__th--codigo   { width: 110px; }
.prido-cot__th--detalle  { width: auto; }
.prido-cot__th--cant     { width: 80px; text-align: center; }
.prido-cot__th--precio     { width: 100px; text-align: right; }
.prido-cot__th--desc       { width: auto; text-align: right; white-space: nowrap; }
.prido-cot__th--preciodesc { width: 105px; text-align: right; font-size: 11px; }
.prido-cot__th--total      { width: 100px; text-align: right; }
.prido-cot__th--acciones { width: 36px; }

/* Celdas del tbody */
.prido-cot__table tbody td {
    border: 1px solid var(--pcot-border-light);
    padding: 8px 6px;
    font-size: 12px;
    vertical-align: top;
    background: var(--pcot-bg-surface);
}

.prido-cot__td--item {
    text-align: center;
    font-weight: 600;
    color: var(--pcot-text-light);
}

.prido-cot__td--codigo {
    font-family: var(--pcot-font-mono);
    font-size: 11px;
    word-break: break-all;
}

.prido-cot__td--detalle {
    line-height: 1.4;
}

.prido-cot__prod-nombre {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.prido-cot__prod-desc {
    display: none !important;
}

/* Hito 10: Atributos de variación debajo del nombre */
.prido-cot__prod-attrs {
    display: block;
    font-size: 11px;
    color: var(--pcot-primary-dark);
    line-height: 1.4;
    font-weight: 400;
    margin-top: 2px;
}

.prido-cot__td--cant {
    text-align: center;
}

.prido-cot__input-cant {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1px solid var(--pcot-border-light);
    background: var(--pcot-bg-surface);
    color: var(--pcot-text);
    border-radius: 3px;
    font-size: 12px;
    font-family: var(--pcot-font);
}

.prido-cot__input-cant:focus {
    border-color: var(--pcot-primary);
    outline: none;
}

.prido-cot__unidad {
    display: block;
    font-size: 10px;
    color: var(--pcot-text-light);
    margin-top: 2px;
}

.prido-cot__td--precio,
.prido-cot__td--desc,
.prido-cot__td--total {
    text-align: right;
    white-space: nowrap;
    font-family: var(--pcot-font-mono);
    font-size: 12px;
}

.prido-cot__td--desc {
    color: var(--pcot-danger);
    white-space: nowrap;
}

/* Hito 10: Precio unitario con descuento */
.prido-cot__td--preciodesc {
    text-align: right;
    white-space: nowrap;
    font-family: var(--pcot-font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--pcot-primary-dark);
}

.prido-cot__td--total {
    font-weight: 600;
}

.prido-cot__td--acciones {
    text-align: center;
    vertical-align: middle;
    padding: 4px !important;
    background: transparent !important;
    border-left-color: transparent !important;
    border-right-color: transparent !important;
    width: 36px;
    overflow: visible;
}

.prido-cot__btn-remove {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 5px !important;
    color: var(--pcot-text-light);
    transition: color 0.2s, background-color 0.2s;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 4px !important;
    line-height: 1;
    width: 28px !important;
    height: 28px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
}

.prido-cot__btn-remove svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    stroke-width: 2.5 !important;
    stroke: var(--pcot-text-light) !important;
    fill: none !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
}

.prido-cot__btn-remove svg line {
    stroke: inherit !important;
    stroke-width: inherit !important;
    visibility: visible !important;
}

.prido-cot__btn-remove:hover svg,
.prido-cot__btn-remove:hover svg line {
    stroke: var(--pcot-danger) !important;
}

.prido-cot__btn-remove:hover {
    color: var(--pcot-danger);
    background-color: color-mix(in srgb, var(--pcot-danger) 12%, transparent 88%) !important;
}

.prido-cot__btn-remove:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pcot-danger) 25%, transparent 75%) !important;
}

.prido-cot__btn-remove:active {
    background-color: color-mix(in srgb, var(--pcot-danger) 18%, transparent 82%) !important;
}

/* Tabla logística */
.prido-cot__table--logistica {
    border-top: none;
}

.prido-cot__row--embalaje td,
.prido-cot__row--despacho td {
    background: var(--pcot-bg-row);
    font-style: italic;
}

/* Fila vacía (sin productos) */
.prido-cot__empty-row td {
    text-align: center;
    padding: 24px;
    color: var(--pcot-text-light);
    font-style: italic;
}

/* =====================================================================
   SECCIÓN D: FOOTER — Comentario + Totales
   ===================================================================== */
.prido-cot__footer {
    display: flex;
    gap: 0;
    border-bottom: none;
}

.prido-cot__footer-left {
    flex: 1;
    padding: 16px;
    border-right: 1px solid var(--pcot-border-light);
}

.prido-cot__footer-left label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pcot-text-light);
    margin-bottom: 4px;
}

.prido-cot__footer-left textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--pcot-border-light);
    background: var(--pcot-bg-surface);
    color: var(--pcot-text);
    border-radius: 3px;
    font-family: var(--pcot-font);
    font-size: 12px;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.prido-cot__footer-left textarea:focus {
    border-color: var(--pcot-primary);
}

.prido-cot__bancario {
    font-size: 11px;
    color: var(--pcot-text-light);
    line-height: 1.6;
    padding: 10px;
    background: var(--pcot-bg-alt);
    border: 1px solid var(--pcot-border-light);
}

.prido-cot__vigencia {
    margin-top: 8px;
    font-weight: 700;
    color: var(--pcot-text);
    font-size: 11px;
}

.prido-cot__footer-right {
    width: 280px;
    flex-shrink: 0;
    padding: 16px;
}

.prido-cot__totales {
    width: 100%;
    border-collapse: collapse;
}

.prido-cot__totales td {
    padding: 6px 8px;
    font-size: 12px;
    border-bottom: 1px solid var(--pcot-border-light);
}

.prido-cot__totales tr:first-child td {
    border-top: 1px solid var(--pcot-border-light);
}

.prido-cot__total-val {
    text-align: right;
    font-family: var(--pcot-font-mono);
    font-weight: 500;
    white-space: nowrap;
}

.prido-cot__total-row td {
    border-top: 2px solid var(--pcot-border) !important;
    border-bottom: 2px solid var(--pcot-border) !important;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 8px;
}

.prido-cot__total-final {
    font-size: 16px;
    color: var(--pcot-primary);
}

.prido-cot__total-palabras {
    font-size: 10px;
    color: var(--pcot-text-light);
    text-transform: uppercase;
    text-align: right;
    padding-top: 6px;
    line-height: 1.4;
    font-style: italic;
}

/* =====================================================================
   BOTÓN ENVIAR
   ===================================================================== */
.prido-cot__actions {
    padding: 20px 24px;
    text-align: center;
    background: var(--pcot-bg-alt);
    border-top: 1px solid var(--pcot-border-light);
}

.prido-cot__btn--submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 700;
    color: var(--pcot-white);
    background: linear-gradient(135deg, var(--pcot-primary) 0%, var(--pcot-primary-dark) 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pcot-primary) 25%, transparent 75%);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--pcot-font);
}

.prido-cot__btn--submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pcot-primary-dark) 0%, color-mix(in srgb, var(--pcot-primary-dark) 82%, #000000 18%) 100%);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--pcot-primary) 35%, transparent 65%);
    transform: translateY(-1px);
}

.prido-cot__btn--submit:disabled {
    background: linear-gradient(135deg, var(--pcot-disabled-start) 0%, var(--pcot-disabled-end) 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.prido-cot__actions-hint {
    font-size: 12px;
    color: var(--pcot-text-light);
    margin-top: 8px;
}

/* =====================================================================
   BÚSQUEDA — ESTADOS Y MEJORAS (Hito 3)
   ===================================================================== */

/* Item de resultado con thumbnail */
.prido-cot__search-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prido-cot__search-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid var(--pcot-border-light);
}

.prido-cot__search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.prido-cot__search-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prido-cot__search-attrs {
    font-size: 11px;
    color: var(--pcot-text-light);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prido-cot__search-item--active,
.prido-cot__search-item--active:hover {
    background: var(--pcot-bg-hover);
    outline: 2px solid var(--pcot-primary);
    outline-offset: -2px;
}

.prido-cot__search-item--outofstock {
    opacity: 0.5;
}

.prido-cot__search-stock-badge {
    font-size: 9px;
    background: var(--pcot-danger);
    color: var(--pcot-white);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.prido-cot__search-discount {
    color: var(--pcot-danger);
    font-weight: 600;
    font-size: 10px;
}

/* Estados de carga y vacío */
.prido-cot__search-loading,
.prido-cot__search-empty,
.prido-cot__search-error {
    padding: 14px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--pcot-text-light);
}

.prido-cot__search-loading {
    color: var(--pcot-primary);
}

.prido-cot__search-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--pcot-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: pcot-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

.prido-cot__search-error {
    color: var(--pcot-danger);
}

/* Highlight de fila al duplicar */
.prido-cot__row--highlight {
    animation: pcot-highlight 1s ease-out;
}

@keyframes pcot-highlight {
    0%   { background-color: var(--pcot-bg-hover); }
    100% { background-color: transparent; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 768px) {
    .prido-cotizador-page-wrap {
        padding: 15px 0 40px;
    }

    .prido-cotizador-page-wrap .container {
        padding: 0 10px;
    }

    /* Header */
    .prido-cot__header {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .prido-cot__header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .prido-cot__header-right {
        width: 100%;
    }

    .prido-cot__folio-box {
        min-width: auto;
    }

    /* Cliente grid: stack vertical */
    .prido-cot__cliente-grid {
        grid-template-columns: 1fr 1fr;
    }

    .prido-cot__field--span2 {
        grid-column: span 2;
    }

    /* Grilla toolbar */
    .prido-cot__grilla-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .prido-cot__btn--add {
        width: 100%;
        justify-content: center;
    }

    /* Tabla: scroll horizontal */
    .prido-cot__grilla {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .prido-cot__table {
        min-width: 700px;
    }

    /* Footer: stack vertical */
    .prido-cot__footer {
        flex-direction: column;
    }

    .prido-cot__footer-left {
        border-right: none;
        border-bottom: 1px solid var(--pcot-border-light);
    }

    .prido-cot__footer-right {
        width: 100%;
    }

    .prido-cot__totales {
        max-width: 100%;
    }

    .prido-cot__btn--submit {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .prido-cot__cliente-grid {
        grid-template-columns: 1fr;
    }

    .prido-cot__field--span2 {
        grid-column: span 1;
    }

    .prido-cot__empresa-nombre {
        font-size: 14px;
    }
}

/* =====================================================================
   HITO 4: BADGE DESCUENTO POR VOLUMEN
   ===================================================================== */

/* [Hito 12] Badge de volumen global eliminado. Solo se mantienen los indicadores per-fila. */
/* Safety net: forzar ocultamiento por si queda en caché del navegador */
#prido-cot-volumen-badge,
.prido-cot__volumen-badge {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Indicador en cada fila cuando el descuento proviene de volumen */
.prido-cot__desc--volumen {
    color: var(--pcot-primary-dark);
    font-weight: 600;
    position: relative;
}

.prido-cot__desc--volumen::after {
    content: "vol.";
    display: inline-block;
    margin-left: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pcot-white);
    background: var(--pcot-primary);
    padding: 1px 4px;
    border-radius: 2px;
    vertical-align: middle;
    line-height: 1.3;
}

/* Hito 11: Indicador cuando el descuento fue calculado con fórmula costo_oferta */
.prido-cot__desc--formula.prido-cot__desc--volumen::after {
    content: "cot.";
    background: var(--pcot-primary-dark);
}

/* Indicador en fila cuando el descuento proviene de oferta/sale_price */
.prido-cot__desc--oferta {
    color: var(--pcot-text);
    font-weight: 400;
}

/* Fila de embalaje visible */
.prido-cot__logistics-row.visible {
    display: table-row;
}

/* Estilo del total de embalaje */
.prido-cot__embalaje-total {
    font-weight: 600;
}

/* Spinner de recálculo en totales */
.prido-cot__totales-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--pcot-text-light);
}

.prido-cot__totales-loading.visible {
    display: flex;
}

.prido-cot__totales-loading .pcot-mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--pcot-border-light);
    border-top-color: var(--pcot-primary);
    border-radius: 50%;
    animation: pcot-spin 0.7s linear infinite;
}

/* =====================================================================
   HITO 5: FEEDBACK DE ENVÍO DE COTIZACIÓN
   ===================================================================== */

/* Contenedor del feedback */
.prido-cot__submit-feedback {
    padding: 30px;
    text-align: center;
    border-top: 1px solid var(--pcot-border-light);
    margin-top: 20px;
}

/* Feedback: Éxito */
.prido-cot__submit-feedback--success {
    padding: 40px 30px;
}

.prido-cot__success-icon {
    margin-bottom: 15px;
}

.prido-cot__success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--pcot-success);
    margin: 0 0 8px;
}

.prido-cot__success-folio {
    font-size: 16px;
    color: var(--pcot-text);
    margin: 0 0 15px;
}

.prido-cot__success-folio strong {
    color: var(--pcot-primary);
}

.prido-cot__success-msg {
    font-size: 14px;
    color: var(--pcot-text-light);
    margin: 0 0 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Botón "Nueva Cotización" */
.prido-cot__btn--new {
    display: inline-block;
    padding: 10px 25px;
    background: var(--pcot-primary);
    color: var(--pcot-white);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.prido-cot__btn--new:hover {
    background: var(--pcot-primary-dark);
    color: var(--pcot-white);
    text-decoration: none;
}

/* Feedback: Error */
.prido-cot__submit-feedback--error {
    background: var(--pcot-danger-soft);
    border: 1px solid var(--pcot-danger);
    border-radius: 4px;
    padding: 12px 20px;
    margin-top: 15px;
    text-align: left;
}

.prido-cot__submit-feedback--error p {
    margin: 0;
    font-size: 13px;
    color: var(--pcot-danger);
    font-weight: 500;
}

/* Botón loading state */
.prido-cot__btn-loading {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

/* =====================================================================
   HITO 6: AJUSTES VISUALES Y LIMPIEZA UI/UX
   ===================================================================== */

/* [Ref.9] Ocultar el page-title por defecto de Woodmart ("BLOG")
   cuando se carga la página del cotizador */
.prido-cotizador-page-wrap ~ .page-title,
.page-title + .prido-cotizador-page-wrap,
body.prido-cotizador-active .page-title,
body.prido-cotizador-active .wd-page-title,
body.prido-cotizador-active .title-size-default,
body.prido-cotizador-active .prido-page-hero {
    display: none !important;
}

/* [Ref.4] Ocultar descripción corta residual si llegase a renderizarse */
.prido-cot__prod-desc {
    display: none !important;
}

/* =====================================================================
   HITO 13: MODO "BLIND" — Vista pública sin precios ni logística
   Solo muestra: ITEM, CÓDIGO, DETALLE, CANTIDAD y ACCIONES
   ===================================================================== */

/* --- Ocultar columnas financieras en la tabla principal y logística --- */
.prido-cot--blind .prido-cot__th--precio,
.prido-cot--blind .prido-cot__th--desc,
.prido-cot--blind .prido-cot__th--preciodesc,
.prido-cot--blind .prido-cot__th--total,
.prido-cot--blind .prido-cot__td--precio,
.prido-cot--blind .prido-cot__td--desc,
.prido-cot--blind .prido-cot__td--preciodesc,
.prido-cot--blind .prido-cot__td--total {
    display: none !important;
}

/* --- Ocultar tabla de logística (embalaje + despacho) --- */
.prido-cot--blind .prido-cot__table--logistica {
    display: none !important;
}

/* --- Ocultar cuadro de totales (footer derecho) --- */
.prido-cot--blind .prido-cot__footer-right {
    display: none !important;
}

/* --- Ocultar datos bancarios y vigencia (no relevantes sin precios) --- */
.prido-cot--blind .prido-cot__bancario {
    display: none !important;
}

/* --- Footer: Ajustar layout cuando solo queda el lado izquierdo --- */
.prido-cot--blind .prido-cot__footer-left {
    border-right: none;
    flex: 1;
}

/* --- Ocultar precio en resultados de búsqueda --- */
.prido-cot--blind .prido-cot__search-price,
.prido-cot--blind .prido-cot__search-discount {
    display: none !important;
}

/* --- Tabla simplificada: columna Detalle se expande más --- */
.prido-cot--blind .prido-cot__table {
    table-layout: auto;
}

.prido-cot--blind .prido-cot__th--detalle {
    width: auto;
}

/* --- Responsive: tabla blind necesita menos ancho mínimo --- */
@media (max-width: 768px) {
    .prido-cot--blind .prido-cot__table {
        min-width: 400px;
    }
}

/* =====================================================================
   HITO 36: DIRECCIÓN DE ENVÍO ALTERNATIVA
   ===================================================================== */

.prido-cot__shipping-alt {
    border: 1px solid var(--pcot-border-light);
    border-top: none;
    background: var(--pcot-bg-surface);
}

.prido-cot__shipping-alt-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--pcot-bg-alt);
    border-bottom: 1px solid var(--pcot-border-light);
}

.prido-cot__shipping-alt-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pcot-text-main);
}

/* Toggle switch (estilo turquesa — Bugfix v1.0.50: alta especificidad) */
.prido-cot__shipping-alt-toggle .prido-cot__switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    vertical-align: middle;
}

.prido-cot__shipping-alt-toggle .prido-cot__switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

.prido-cot__shipping-alt-toggle .prido-cot__switch .prido-cot__switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--pcot-border-light);
    -webkit-transition: 0.3s;
    transition: 0.3s;
    border-radius: 24px;
    border: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.prido-cot__shipping-alt-toggle .prido-cot__switch .prido-cot__switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--pcot-bg-surface);
    -webkit-transition: 0.3s;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.prido-cot__shipping-alt-toggle .prido-cot__switch input[type="checkbox"]:checked + .prido-cot__switch-slider {
    background-color: var(--pcot-teal);
}

.prido-cot__shipping-alt-toggle .prido-cot__switch input[type="checkbox"]:checked + .prido-cot__switch-slider:before {
    -webkit-transform: translateX(20px);
    transform: translateX(20px);
}

/* Hito 41: Campos condicionales de envío — ocultos por defecto, slideDown en JS */
.prido-cot__shipping-alt-fields {
    display: none;
    padding: 12px 14px;
}

.prido-cot__shipping-alt-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
}

.prido-cot__shipping-alt-fields .prido-cot__field input,
.prido-cot__shipping-alt-fields .prido-cot__field select {
    background: var(--pcot-bg-focus);
    border-color: color-mix(in srgb, var(--pcot-primary) 42%, var(--pcot-border-light) 58%);
}

.prido-cot__shipping-alt-fields .prido-cot__field input:focus,
.prido-cot__shipping-alt-fields .prido-cot__field select:focus {
    border-color: var(--pcot-teal);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pcot-teal) 15%, transparent 85%);
}

@media (max-width: 768px) {
    .prido-cot__shipping-alt-grid {
        grid-template-columns: 1fr;
    }
    .prido-cot__shipping-alt-grid .prido-cot__field--span2 {
        grid-column: span 1;
    }
}
