/* ===== Wrapper general ===== */
.ce-wrapper {
    margin: 18px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ===== Card base ===== */
.ce-card {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 20px 22px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ce-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.ce-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.ce-card-titulo {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.ce-card-sub {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: #444;
    line-height: 1.35;
}

.ce-card-bonificado .ce-card-sub {
    font-size: 12.5px;
}

/* ===== Iconos ===== */
.ce-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: #e8f5e9;
    transition: background 0.2s ease, transform 0.2s ease;
}

/* ===== Formulario inline ===== */
.ce-inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.ce-input-wrapper {
    flex: 1;
    position: relative;
}

.ce-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
    transition: opacity 0.2s;
}

.ce-input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14.5px;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ce-input-wrapper input:hover {
    border-color: #c0c0c0;
    background: #f5f5f5;
}

.ce-input-wrapper input:focus {
    border-color: #2d6a4f;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.ce-input-wrapper input::placeholder {
    color: #b0b0b0;
    font-size: 14px;
}

.ce-btn-calcular {
    background: #2d6a4f;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ce-btn-calcular:hover {
    background: #245a42;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
    transform: translateY(-1px);
}

.ce-btn-calcular:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(45, 106, 79, 0.2);
}

/* Info text con icono */
.ce-card-info {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #444;
    margin: 0;
    line-height: 1.4;
}

/* ===== Resultado inline ===== */
.ce-inline-resultado {
    margin-bottom: 14px;
    padding: 14px 16px;
    background: #f8faf9;
    border-radius: 10px;
    border: 1px solid #e0e8e4;
    animation: ce-fadeIn 0.3s ease;
}

@keyframes ce-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ce-inline-fila {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13.5px;
    color: #666;
}

.ce-inline-fila strong {
    color: #333;
    font-weight: 600;
}

.ce-inline-fila-bonif strong {
    color: #2d6a4f;
}

.ce-inline-fila-final {
    margin-top: 8px;
    padding: 11px 14px;
    background: #e8f5e9;
    border-radius: 8px;
}

.ce-inline-fila-final span,
.ce-inline-fila-final strong {
    font-size: 15.5px;
    font-weight: 700;
    color: #1b4332;
}

.ce-inline-zona {
    font-size: 11.5px;
    color: #aaa;
    margin: 8px 0 0;
}

.ce-inline-error p {
    color: #c0392b;
    font-size: 13.5px;
    margin: 0;
}

.ce-spinner-sm {
    width: 22px;
    height: 22px;
    border-width: 2.5px;
    margin: 8px auto;
}

.ce-inline-loader {
    text-align: center;
}

/* ===== Card bonificado (clickeable) ===== */
.ce-card-bonificado {
    border-color: #2d6a4f;
    border-width: 1.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.ce-card-bonificado:hover {
    background: #f0f7f4;
    box-shadow: 0 4px 16px rgba(45, 106, 79, 0.12);
    transform: translateY(-1px);
}

.ce-card-bonificado:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.1);
}

.ce-card-bonificado:hover .ce-icon {
    background: #d0ebda;
    transform: scale(1.05);
}

.ce-card-bonificado:hover .ce-badge-total {
    background: #d0ebda;
}

.ce-card-bonif-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ce-card-bonif-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ce-card-bonif-right svg {
    transition: transform 0.2s ease;
}

.ce-card-bonificado:hover .ce-card-bonif-right svg {
    transform: translateX(3px);
}

.ce-badge-total {
    background: #e8f5e9;
    color: #2d6a4f;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    transition: background 0.2s ease;
}

/* Texto pie */
.ce-texto-pie {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #a0a0a0;
    margin: 0;
    padding-left: 4px;
}

/* ===== Boton wrapper carrito ===== */
.ce-boton-wrapper {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.ce-boton-carrito { margin-top: 20px; }

.ce-boton-principal {
    background: #2d6a4f;
    color: #fff;
    border: none;
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ce-boton-principal:hover {
    background: #245a42;
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
    transform: translateY(-1px);
}

.ce-boton-principal:active {
    transform: translateY(0);
}

.ce-boton-subtexto {
    font-size: 12px;
    color: #888;
}

/* ===== Modal overlay ===== */
.ce-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ce-modal {
    background: #fff;
    border-radius: 18px;
    max-width: 440px;
    width: 100%;
    padding: 34px 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: ce-modalIn 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

@keyframes ce-modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ce-modal-cerrar {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #bbb;
    line-height: 1;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.ce-modal-cerrar:hover {
    background: #f0f0f0;
    color: #555;
}

/* ===== Modal paso 1: header ===== */
.ce-modal-icon-top {
    text-align: center;
    margin-bottom: 18px;
}

.ce-icon-circle-big {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #e8f5e9;
}

.ce-modal-titulo {
    margin: 0 0 8px;
    font-size: 23px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    letter-spacing: -0.3px;
}

.ce-modal-sub {
    font-size: 14.5px;
    color: #888;
    text-align: center;
    margin: 0 0 22px;
    line-height: 1.45;
}

/* ===== Compra actual ===== */
.ce-compra-actual {
    border: 1.5px solid #2d6a4f;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    background: #f0f7f4;
}

.ce-compra-actual-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.ce-compra-label {
    font-size: 12.5px;
    color: #777;
    display: block;
    letter-spacing: 0.1px;
}

.ce-compra-monto {
    font-size: 26px;
    font-weight: 700;
    color: #2d6a4f;
    display: block;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.ce-compra-falta {
    font-size: 12.5px;
    color: #777;
    display: block;
    margin-top: 3px;
    line-height: 1.4;
}

.ce-compra-falta strong {
    color: #2d6a4f;
}

/* ===== Escalas cards ===== */
.ce-escalas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.ce-escala-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px 18px;
    background: #fff;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ce-escala-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ce-escala-card.ce-escala-active {
    border-color: #2d6a4f;
    background: #f0f7f4;
    box-shadow: 0 2px 10px rgba(45, 106, 79, 0.08);
}

.ce-escala-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ce-escala-monto {
    display: block;
    font-size: 19px;
    font-weight: 700;
    color: #2d6a4f;
    letter-spacing: -0.3px;
}

.ce-escala-desc {
    font-size: 13.5px;
    color: #777;
}

.ce-escala-desc strong {
    color: #2d6a4f;
    font-weight: 600;
}

.ce-badge-objetivo {
    font-size: 11px;
    font-weight: 600;
    color: #2d6a4f;
    background: #e8f5e9;
    padding: 5px 11px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.1px;
}

/* ===== Notas del modal ===== */
.ce-notas {
    background: #fef7f2;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.ce-nota-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #333;
    margin: 0;
    padding: 8px 0;
    line-height: 1.4;
    border-bottom: 1px solid #f0ddd3;
}

.ce-nota-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ce-nota-item:first-child {
    padding-top: 0;
}

.ce-nota-item svg {
    min-width: 14px;
}

/* ===== Botones del modal ===== */
.ce-btn-entendido {
    width: 100%;
    padding: 15px;
    background: #e8755e;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    margin-bottom: 10px;
    letter-spacing: 0.1px;
}

.ce-btn-entendido:hover {
    background: #d4614a;
    box-shadow: 0 4px 16px rgba(232, 117, 94, 0.3);
    transform: translateY(-1px);
}

.ce-btn-entendido:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(232, 117, 94, 0.2);
}

.ce-btn-cotizar-menor {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #2d6a4f;
    border: 1.5px solid #2d6a4f;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ce-btn-cotizar-menor:hover {
    background: #f0f7f4;
    border-color: #2d6a4f;
    color: #2d6a4f;
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.1);
    transform: translateY(-1px);
}

.ce-btn-cotizar-menor:active {
    transform: translateY(0);
}

/* ===== Formulario modal ===== */
.ce-campo {
    margin-bottom: 16px;
}

.ce-campo label {
    display: block;
    font-size: 13.5px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.ce-campo input,
.ce-campo select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14.5px;
    box-sizing: border-box;
    background: #fafafa;
    color: #333;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ce-campo input:hover,
.ce-campo select:hover {
    border-color: #c0c0c0;
    background: #f5f5f5;
}

.ce-campo input:focus,
.ce-campo select:focus {
    border-color: #2d6a4f;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.ce-link-volver {
    background: none;
    border: none;
    color: #2d6a4f;
    cursor: pointer;
    font-size: 14px;
    padding: 12px 0;
    text-decoration: none;
    display: block;
    text-align: center;
    width: 100%;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ce-link-volver:hover {
    color: #2d6a4f;
    text-decoration: underline;
    background: none;
}

/* ===== Resultados modal ===== */
.ce-resultado {
    margin: 18px 0;
}

.ce-resultado-fila {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.ce-resultado-fila span {
    color: #777;
}

.ce-resultado-fila strong {
    color: #333;
    font-weight: 600;
}

.ce-resultado-bonif strong {
    color: #2d6a4f;
}

.ce-resultado-final {
    border-bottom: none;
    background: #e8f5e9;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 10px;
}

.ce-resultado-final span,
.ce-resultado-final strong {
    font-size: 16.5px;
    color: #1b4332;
    font-weight: 700;
}

.ce-aclaracion {
    font-size: 11.5px;
    color: #aaa;
    font-style: italic;
    margin: 14px 0 18px;
    text-align: center;
    line-height: 1.4;
}

/* ===== Loader ===== */
.ce-loader {
    text-align: center;
    padding: 44px 0;
}

.ce-loader p {
    font-size: 14px;
    color: #999;
}

.ce-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #2d6a4f;
    border-radius: 50%;
    animation: ce-spin 0.7s linear infinite;
    margin: 0 auto 14px;
}

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

/* ===== Error ===== */
.ce-error {
    text-align: center;
    padding: 24px 0;
}

.ce-error p {
    color: #c0392b;
    font-size: 14.5px;
    margin-bottom: 18px;
    line-height: 1.4;
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    .ce-modal {
        padding: 26px 20px;
        border-radius: 14px;
    }
    .ce-escala-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .ce-card-bonificado {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .ce-card-bonif-right {
        align-self: flex-end;
    }
    .ce-inline-form {
        flex-direction: column;
    }
    .ce-btn-calcular {
        width: 100%;
        padding: 13px;
    }
    .ce-modal-titulo {
        font-size: 20px;
    }
    .ce-compra-monto {
        font-size: 22px;
    }
    .ce-escala-monto {
        font-size: 17px;
    }
}
